of-the-king-the-power
Version:
A library for generating and working with glossolalia (speaking in tongues)
229 lines (228 loc) • 6.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateWord = generateWord;
exports.generatePhrase = generatePhrase;
exports.generateParagraph = generateParagraph;
exports.generateText = generateText;
exports.ofTheKing = ofTheKing;
/**
* Common phrases in the angelic language
*/
const ANGELIC_PHRASES = [
'of the king the power',
'demember',
'the best',
'the king',
'the ferry',
'des nay',
'powerfire',
'glory jump',
'fire tongue',
'amenstorm',
'angel crash',
'glory slap',
'holy trip',
'yes gospel',
'spirit break',
'hallelujah drop',
'devil out',
'sin boom',
'resurrect flex',
'shalala',
'shababa',
'shadada',
'shakaka',
'shamama',
'sharana',
'shasasa',
'shavava',
'shazaza',
'alleluia',
'gloria',
'poder',
'força',
'vitória',
'bênção',
'unção',
'graça',
'cantarabashéia',
'urabachai',
'decalamassubia',
'xandarabassuri',
'fogo',
'glória',
'kabassundéria',
'labarashourei',
'power',
'fire',
'tongues',
'glory',
'kabashunderia',
'holy',
'deliverance',
'andalamanagaz',
'xéresmicalabri',
'suriandalavá',
'tetemachurialei',
'dalamanagá',
'rebaxurianatá',
'flamabashundê',
'andaramanás',
'remandorébia',
'nagaralamassubri',
'telecanderevá',
'subriaxéterion',
'manabalaxuélia',
'xandracalabriá',
'urabasuricalé',
'xereblandará',
'calemassuriantê',
'xolamanagandé',
'bererevandolabaxé',
'managlabassubia',
'técalandurabashé',
'duramassébia',
'shobalakantaréia',
'rendalamassébia',
'farandocalassurí',
'berandurianeké',
'xolabarrandurê',
'tubalacantarabaxéia',
'kalabashundarakai',
'barandecalassuri',
'mandurievaxeté',
'kalashunderevá',
'sobriasandalaxuélia',
'chandaramanarashu',
'balakundarabassia',
'gandoriamassubria',
'remandolabashéia',
'xerandalamanakô',
'kamanderevassu',
'olobrachariandakô',
'sobralecantarabassé',
'jubalaxandoravé',
'monandoraxurilé',
'seramalakântia',
'glorialabarakaché',
'xirebassuriandé',
'batandolamassurí',
'canderabaxunthaléia',
'tchalakundaré',
'subramalassurundê',
'glandurassévia',
'kanderebaxondolá'
];
/**
* Default options for glossolalia generation
*/
const DEFAULT_OPTIONS = {
minLength: 3,
maxLength: 8,
includeIntro: true,
intensity: 'medium'
};
/**
* Generates a random number between min and max (inclusive)
*/
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
/**
* Generates a random phrase from the angelic language
*/
function generateRandomPhrase() {
return ANGELIC_PHRASES[getRandomInt(0, ANGELIC_PHRASES.length - 1)];
}
/**
* Capitalizes the first letter of a string
*/
function capitalizeFirstLetter(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
/**
* Generates a word in the angelic language
*/
function generateWord(options = {}) {
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
return generateRandomPhrase();
}
/**
* Generates a phrase in the angelic language
*/
function generatePhrase(wordCount = 5, options = {}) {
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
const words = [];
if (mergedOptions.includeIntro) {
words.push('of the king the power');
words.push('the best the king');
words.push('the ferry des nay');
}
const remainingWords = wordCount - (mergedOptions.includeIntro ? 3 : 0);
for (let i = 0; i < remainingWords; i++) {
words.push(generateRandomPhrase());
}
return words.join(' ');
}
/**
* Generates a paragraph in the angelic language
*/
function generateParagraph(sentenceCount = 5, options = {}) {
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
const sentences = [];
// First sentence always includes the intro
sentences.push(generatePhrase(getRandomInt(3, 8), { ...options, includeIntro: true }));
// Remaining sentences
for (let i = 1; i < sentenceCount; i++) {
const wordCount = getRandomInt(3, 8);
const phrase = generatePhrase(wordCount, { ...options, includeIntro: false });
sentences.push(capitalizeFirstLetter(phrase));
}
return sentences.join('. ') + '.';
}
/**
* Generates a text with varying intensity
*/
function generateText(options = {}) {
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
const intensity = mergedOptions.intensity;
let paragraphCount;
switch (intensity) {
case 'low':
paragraphCount = 1;
break;
case 'high':
paragraphCount = 5;
break;
case 'medium':
default:
paragraphCount = 3;
}
const paragraphs = [];
for (let i = 0; i < paragraphCount; i++) {
paragraphs.push(generateParagraph(getRandomInt(3, 6), options));
}
return paragraphs.join('\n\n');
}
/**
* Generates Lorem Ipsum style text using the angelic language
* @param paragraphs Number of paragraphs to generate (default: 3)
* @param sentencesPerParagraph Number of sentences per paragraph (default: 5)
* @param wordsPerSentence Number of words per sentence (default: 8)
* @param options Additional options for text generation
*/
function ofTheKing(paragraphs = 3, sentencesPerParagraph = 5, wordsPerSentence = 8, options = {}) {
const text = [];
for (let i = 0; i < paragraphs; i++) {
const paragraph = [];
// First sentence of each paragraph includes the intro
paragraph.push(generatePhrase(wordsPerSentence, { ...options, includeIntro: true }));
// Remaining sentences
for (let j = 1; j < sentencesPerParagraph; j++) {
const phrase = generatePhrase(wordsPerSentence, { ...options, includeIntro: false });
paragraph.push(capitalizeFirstLetter(phrase));
}
text.push(paragraph.join('. ') + '.');
}
return text.join('\n\n');
}