rita 3.0.17 → 3.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rita.min.js CHANGED
@@ -143,10 +143,10 @@ Input: '${re._escapeText(a)}'`),n.trace&&a!==i&&console.log(`Parsed: '${re._esc
143
143
  Tokens: [ `+a+" ] Context:",this.visitor.lookupsToString())}preParse(n,a){if(typeof n!="string")return"";let r=this.Symbols,t=n;this.v2Compatible||(t=t.replace(this.regex.ParenthesizedWeights,"^$1^"));let i=t.replace(this.regex.NonGateAtSigns,"$1&#64;");i!==t&&(t=i);let h=t.match(this.regex.MarkdownLinks,"");h&&h.forEach(u=>t=t.replace(u,l3(u))),t=t.replace(this.regex.MultiLineComments,""),t=t.replace(this.regex.SingleLineComments,""),t=t.replace(this.regex.Continue,""),t=u3(t);let s="",o=t.split(this.regex.LineBreaks);for(let u=0;u<o.length;u++)if(this.regex.RawAssign.test(o[u])){let d=o[u].indexOf("=");if(d<0)throw Error("invalid state: no assigment: "+o[u]);let p=o[u].substring(0,d),c=o[u].substring(d+1),y=Ih(c,r.OPEN_CHOICE),j=Ih(c,r.CLOSE_CHOICE);for(;y>j;){let v=o[++u];c+=`
144
144
  `+v,y+=Ih(v,r.OPEN_CHOICE),j+=Ih(v,r.CLOSE_CHOICE)}s+=r.OPEN_SILENT+(p+"="+c)+r.CLOSE_SILENT}else s+=o[u],u<o.length-1&&(s+=`
145
145
  `);return s}postParse(n,a){if(typeof n!="string")return"";let t=h3(n).replace(this.regex.Whitespace," ").replace(this.regex.EndingBreak,"");return[...t.matchAll(this.Symbols.PENDING_GATE_RE)].forEach(h=>{if(!h||!h[0]||!h[1])throw Error("bad gate: "+h);let s=this.visitor.pendingGates[h[1]],{deferredContext:o,operands:u}=s;if(!u.length)throw Error("no operands");let d=this.visitor.choice(o,{forceReject:!0});t=t.replace(h[0],d),a.trace&&console.log(" "+h[0]+"-> "+d)}),a.trace&&console.log(`
146
- Final: '${t}'`),a.preserveLookups||(this.visitor.statics=void 0,this.visitor.dynamics=void 0),t}parseJSOL(n){let a=h=>{let s=h;if(typeof h=="string"&&h.startsWith(Rr)&&h.endsWith(Rr)){let o=h.split(Rr);if(o.length!==4)throw Error("invalid regex in unescape");s=new RegExp(o[1],o[2])}return s},r=d3(n).replace(this.regex.JSOLIdent,'"$1":').replace(/'/g,'"'),t=JSON.parse(r),i=a;return Object.keys(t).forEach(h=>t[h]=i(t[h])),t}isParseable(n){let a=!0;return/(string|number)/.test(typeof n)&&(a=this.regex.Special.test(n.toString())),a}static addTransform(n,a){return re.transforms[n]=a}static getTransforms(){return Object.keys(re.transforms)}static removeTransform(n){delete re.transforms[n]}static articlize(n){if(!n||!n.length)return"";let a=n.split(/\s+/)[0];if(!this.RiTa?.phones)return!re.RiTaWarnings.phones&&!re.RiTaWarnings.silent&&(console.warn("[WARN] Install RiTa for proper phonemes"),re.RiTaWarnings.phones=!0),(/^[aeiou].*/i.test(a)?"an ":"a ")+n;let r=this.RiTa.phones(a,{silent:!0});return(r&&r.length&&s3.test(r[0])?"an ":"a ")+n}static capitalize(n){return n?n[0].toUpperCase()+n.substring(1):""}static uppercase(n){return n?n.toUpperCase():""}static quotify(n){return"&#8220;"+(n||"")+"&#8221;"}static pluralize(n){return this.RiTa?.pluralize?this.RiTa.pluralize(n):(!re.RiTaWarnings.plurals&&!re.RiTaWarnings.silent&&(re.RiTaWarnings.plurals=!0,console.warn("[WARN] Install RiTa for proper pluralization")),n.endsWith("s")?n:n+"s")}static identity(n){return n}static _escapeText(n,a){if(typeof n!="string")return n;let r=n.replace(/\r?\n/g,"\\n");return a||!r.length?"'"+r+"'":r}static _stringHash(n){let a,r=0;for(let i=0;i<n.length;i++)a=n.charCodeAt(i),r=(r<<5)-r+a,r|=0;let t=r.toString();return r<0?t.replace("-","0"):t}};bs($h,"VERSION","1.0.42");bs($h,"Query",Pp);bs($h,"RiTaWarnings",{plurals:!1,phones:!1,silent:!1});var X=$h;X.transforms={quotify:X.quotify,pluralize:X.pluralize,capitalize:X.capitalize,articlize:X.articlize,uppercase:X.uppercase,norepeat:X.identity,art:X.articlize,nr:X.identity,cap:X.capitalize,ucf:X.capitalize,uc:X.uppercase,qq:X.quotify,s:X.pluralize};function l3(e){let n=e;return Object.entries({"[":"&lsqb;","]":"&rsqb;","(":"&lpar;",")":"&rpar;","/":"&sol;"}).forEach(([r,t])=>n=n.replace(new RegExp(`\\${r}`,"g"),t)),n}function u3(e){return e=Xe(e,"\\(","&lpar;"),e=Xe(e,"\\)","&rpar;"),e=Xe(e,"\\[","&lsqb;"),e=Xe(e,"\\]","&rsqb;"),e=Xe(e,"\\{","&lcqb;"),e=Xe(e,"\\}","&rcqb;"),e=Xe(e,"\\@","&commat;"),e=Xe(e,"\\#","&num;"),e=Xe(e,"\\|"," &vert"),e=Xe(e,"\\="," &equals"),e}function d3(e){return e.replace(/\/([^/]+?)\/([igmsuy]*)/g,`"${Rr}$1${Rr}$2${Rr}"`)}function p3(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e,n,a){return e.replace(new RegExp(p3(n),"g"),()=>a)}function Ih(e,n){let a=0;for(let r=0;r<e.length;r++)e[r]===n&&a++;return a}var b3=class ps{constructor(n={},a={}){if(typeof n=="string"&&(n=Ip(n)),typeof n!="object")throw Error("RiGrammar: expecting object, found "+typeof n);this.scripting=new X,this.context=a,this.setRules(n)}static expand(n,a,r){return new ps(n,a).expand(r)}addTransform(){return X.addTransform(...arguments)}removeTransform(){return X.removeTransform(...arguments)}getTransforms(){return X.transforms}equals(n){return n.toJSON()===this.toJSON()}expand(n={}){if("context"in n)throw Error("pass context to RiScript.grammar() or new RiGrammar() instead");return n.visitor=n.visitor||new X.Visitor(this.scripting),n.visitor.context=this.context||{},n.input=this._toScript(n),this.scripting._evaluate(n)}addRule(n,a){return this._validateRule(n,a),this.rules[n]=a,this}setRules(n){if(typeof n>"u")throw Error("undefined rules");this.rules={};let a=typeof n=="string"?Ip(n):n;return Object.entries(a).forEach(r=>this.addRule(...r)),this}removeRule(n){n in this.rules&&delete this.rules[n]}toJSON(){return JSON.stringify(this.rules,...arguments)}toString(n={}){let a=n.replacer||0,r=n.space||2,t=n?.linebreak,i=this.toJSON(a,r);return t&&(i=i.replace(/\n/g,t)),i}static fromJSON(n,a){return new ps(JSON.parse(n),a)}_toScript(n){let a="",r=n.start||"start",{Symbols:t}=this.scripting;if(r.startsWith(t.DYNAMIC)&&(r=r.substring(t.DYNAMIC.length)),r.startsWith(t.STATIC)&&(r=r.substring(t.STATIC.length)),!(r in this.rules||t.STATIC+r in this.rules))throw Error('Rule: "'+r+'" not found in grammar');return Object.entries(this.rules).forEach(([i,h],s)=>{for(;i.startsWith(t.DYNAMIC);)i=i.substring(1);i.startsWith(t.STATIC)||(i=t.DYNAMIC+i),this.scripting.regex.ChoiceWrap.test(h)||(h=t.OPEN_CHOICE+h+t.CLOSE_CHOICE),a+=`${i}=${h}
146
+ Final: '${t}'`),a.preserveLookups||(this.visitor.statics=void 0,this.visitor.dynamics=void 0),t}parseJSOL(n){let a=h=>{let s=h;if(typeof h=="string"&&h.startsWith(Rr)&&h.endsWith(Rr)){let o=h.split(Rr);if(o.length!==4)throw Error("invalid regex in unescape");s=new RegExp(o[1],o[2])}return s},r=d3(n).replace(this.regex.JSOLIdent,'"$1":').replace(/'/g,'"'),t=JSON.parse(r),i=a;return Object.keys(t).forEach(h=>t[h]=i(t[h])),t}isParseable(n){let a=!0;return/(string|number)/.test(typeof n)&&(a=this.regex.Special.test(n.toString())),a}static addTransform(n,a){return re.transforms[n]=a}static getTransforms(){return Object.keys(re.transforms)}static removeTransform(n){delete re.transforms[n]}static articlize(n){if(!n||!n.length)return"";let a=n.split(/\s+/)[0];if(!this.RiTa?.phones)return!re.RiTaWarnings.phones&&!re.RiTaWarnings.silent&&(console.warn("[WARN] Install RiTa for proper phonemes"),re.RiTaWarnings.phones=!0),(/^[aeiou].*/i.test(a)?"an ":"a ")+n;let r=this.RiTa.phones(a,{silent:!0});return(r&&r.length&&s3.test(r[0])?"an ":"a ")+n}static capitalize(n){return n?n[0].toUpperCase()+n.substring(1):""}static uppercase(n){return n?n.toUpperCase():""}static quotify(n){return"&#8220;"+(n||"")+"&#8221;"}static pluralize(n){return this.RiTa?.pluralize?this.RiTa.pluralize(n):(!re.RiTaWarnings.plurals&&!re.RiTaWarnings.silent&&(re.RiTaWarnings.plurals=!0,console.warn("[WARN] Install RiTa for proper pluralization")),n.endsWith("s")?n:n+"s")}static identity(n){return n}static _escapeText(n,a){if(typeof n!="string")return n;let r=n.replace(/\r?\n/g,"\\n");return a||!r.length?"'"+r+"'":r}static _stringHash(n){let a,r=0;for(let i=0;i<n.length;i++)a=n.charCodeAt(i),r=(r<<5)-r+a,r|=0;let t=r.toString();return r<0?t.replace("-","0"):t}};bs($h,"VERSION","1.0.45");bs($h,"Query",Pp);bs($h,"RiTaWarnings",{plurals:!1,phones:!1,silent:!1});var X=$h;X.transforms={quotify:X.quotify,pluralize:X.pluralize,capitalize:X.capitalize,articlize:X.articlize,uppercase:X.uppercase,norepeat:X.identity,art:X.articlize,nr:X.identity,cap:X.capitalize,ucf:X.capitalize,uc:X.uppercase,qq:X.quotify,s:X.pluralize};function l3(e){let n=e;return Object.entries({"[":"&lsqb;","]":"&rsqb;","(":"&lpar;",")":"&rpar;","/":"&sol;"}).forEach(([r,t])=>n=n.replace(new RegExp(`\\${r}`,"g"),t)),n}function u3(e){return e=Xe(e,"\\(","&lpar;"),e=Xe(e,"\\)","&rpar;"),e=Xe(e,"\\[","&lsqb;"),e=Xe(e,"\\]","&rsqb;"),e=Xe(e,"\\{","&lcqb;"),e=Xe(e,"\\}","&rcqb;"),e=Xe(e,"\\@","&commat;"),e=Xe(e,"\\#","&num;"),e=Xe(e,"\\|"," &vert"),e=Xe(e,"\\="," &equals"),e}function d3(e){return e.replace(/\/([^/]+?)\/([igmsuy]*)/g,`"${Rr}$1${Rr}$2${Rr}"`)}function p3(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e,n,a){return e.replace(new RegExp(p3(n),"g"),()=>a)}function Ih(e,n){let a=0;for(let r=0;r<e.length;r++)e[r]===n&&a++;return a}var b3=class ps{constructor(n={},a={}){if(typeof n=="string"&&(n=Ip(n)),typeof n!="object")throw Error("RiGrammar: expecting object, found "+typeof n);this.scripting=new X,this.context=a,this.setRules(n)}static expand(n,a,r){return new ps(n,a).expand(r)}addTransform(){return X.addTransform(...arguments)}removeTransform(){return X.removeTransform(...arguments)}getTransforms(){return X.transforms}equals(n){return n.toJSON()===this.toJSON()}expand(n={}){if("context"in n)throw Error("pass context to RiScript.grammar() or new RiGrammar() instead");return n.visitor=n.visitor||new X.Visitor(this.scripting),n.visitor.context=this.context||{},n.input=this._toScript(n),this.scripting._evaluate(n)}addRule(n,a){return this._validateRule(n,a),this.rules[n]=a,this}setRules(n){if(typeof n>"u")throw Error("undefined rules");this.rules={};let a=typeof n=="string"?Ip(n):n;return Object.entries(a).forEach(r=>this.addRule(...r)),this}removeRule(n){n in this.rules&&delete this.rules[n]}toJSON(){return JSON.stringify(this.rules,...arguments)}toString(n={}){let a=n.replacer||0,r=n.space||2,t=n?.linebreak,i=this.toJSON(a,r);return t&&(i=i.replace(/\n/g,t)),i}static fromJSON(n,a){return new ps(JSON.parse(n),a)}_toScript(n){let a="",r=n.start||"start",{Symbols:t}=this.scripting;if(r.startsWith(t.DYNAMIC)&&(r=r.substring(t.DYNAMIC.length)),r.startsWith(t.STATIC)&&(r=r.substring(t.STATIC.length)),!(r in this.rules||t.STATIC+r in this.rules))throw Error('Rule: "'+r+'" not found in grammar');return Object.entries(this.rules).forEach(([i,h],s)=>{for(;i.startsWith(t.DYNAMIC);)i=i.substring(1);i.startsWith(t.STATIC)||(i=t.DYNAMIC+i),this.scripting.regex.ChoiceWrap.test(h)||(h=t.OPEN_CHOICE+h+t.CLOSE_CHOICE),a+=`${i}=${h}
147
147
  `}),n.trace&&console.log(`Grammar:
148
148
  `+a.replace(/^\$/gm," $")),a+=`${t.DYNAMIC}${r}`,a}_validateRule(n,a){if(typeof n!="string"||n.length===0)throw Error("expected [string] name");if(typeof a>"u")throw Error("undefined rule def: "+n);let{Symbols:r}=this.scripting;if(n.startsWith(r.DYNAMIC))throw n=n.substring(r.DYNAMIC.length),Error("Grammar rules are dynamic by default; if you need a static rule, use '"+r.STATIC+n+"', otherwise just use '"+n+"'.")}};function Ip(e){if(typeof e=="string")try{return JSON.parse(e)}catch{throw Error(`RiGrammar appears to be invalid JSON, please check it at http://jsonlint.com/
149
- `+e)}}X.Grammar=b3;X.Visitor=Lp;var{Grammar:Fp}=X,N=class e{static grammar(n,a){return new Fp(...arguments)}static addTransform(n,a){return X.addTransform(...arguments)}static removeTransform(n){return X.removeTransform(...arguments)}static getTransforms(){return X.getTransforms()}static articlize(n){return X.articlize(...arguments)}static evaluate(n,a,r){return X.evaluate(...arguments)}static markov(n,a){return new Xt(...arguments)}static kwic(n,a){return e.concorder.kwic(...arguments)}static concordance(n,a){return e.concorder.concordance(...arguments)}static randomOrdering(n){return e.randomizer.randomOrdering(...arguments)}static randomSeed(n){return e.randomizer.seed(n)}static isQuestion(n){return e.QUESTIONS.includes(e.tokenize(n)[0].toLowerCase())}static isVowel(n){return n&&n.length===1&&e.VOWELS.includes(n)}static isConsonant(n){return n&&n.length===1&&!e.VOWELS.includes(n)&&y3.test(n)}static capitalize(n){return n?n[0].toUpperCase()+n.substring(1):""}static randomWord(n){return e.lexicon.randomWord(...arguments)}static async rhymes(n,a){return await e.lexicon.rhymes(...arguments)}static isRhyme(n,a){return e.lexicon.isRhyme(...arguments)}static async alliterations(n,a){return await e.lexicon.alliterations(...arguments)}static hasWord(n){return e.lexicon.hasWord(...arguments)}static isAbbrev(n,{caseSensitive:a=!1}={}){if(typeof n=="string"){if(a)return e.ABRV.includes(n.trim());let r=n.trim().toLowerCase();return e.ABRV.some(t=>t.toLowerCase()===r)}}static isAlliteration(n,a){return e.lexicon.isAlliteration(...arguments)}static async spellsLike(n,a){return await e.lexicon.spellsLike(...arguments)}static async soundsLike(n,a){return await e.lexicon.soundsLike(...arguments)}static pos(n){return e.tagger.tag(...arguments)}static isNoun(n){return e.tagger.isNoun(n)}static isAdjective(n){return e.tagger.isAdjective(n)}static isAdverb(n){return e.tagger.isAdverb(n)}static isPunct(n){return n&&n.length&&c3.test(n)}static isVerb(n){return e.tagger.isVerb(n)}static posInline(n,a={}){return a.inline=!0,e.tagger.tag(n,a)}static singularize(n){return e.inflector.singularize(...arguments)}static pluralize(n){return e.inflector.pluralize(...arguments)}static async search(n,a){return await e.lexicon.search(...arguments)}static tokens(n,a){return e.tokenizer.tokens(...arguments)}static tokenize(n,a){return e.tokenizer.tokenize(...arguments)}static untokenize(n,a){return e.tokenizer.untokenize(...arguments)}static sentences(n){return e.tokenizer.sentences(...arguments)}static isStopWord(n){return e.STOP_WORDS.includes(n.toLowerCase())}static stem(n){return Nt.stem(...arguments)}static presentPart(n){return e.conjugator.presentPart(...arguments)}static pastPart(n){return e.conjugator.pastPart(...arguments)}static conjugate(n,a){return e.conjugator.conjugate(...arguments)}static stresses(n){return e.analyzer.analyze(...arguments).stresses}static syllables(n){return e.analyzer.analyze(...arguments).syllables}static phones(n){return e.analyzer.analyze(...arguments).phones}static analyze(n){return e.analyzer.analyze(...arguments)}static spellsLikeSync(n,a){return e.lexicon.spellsLikeSync(...arguments)}static sountsLikeSync(n,a){return e.lexicon.sountsLikeSync(...arguments)}static rhymesSync(n,a){return e.lexicon.rhymesSync(...arguments)}static searchSync(n,a){return e.lexicon.rhymesSync(...arguments)}static alliterationsSync(n,a){return e.lexicon.alliterationsSync(...arguments)}static randi(n){return Math.floor(e.randomizer.random(...arguments))}static random(n){return e.randomizer.random(...arguments)}};Xt.parent=N;Nt.parent=N;N.RiGrammar=Fp;N.RiMarkov=Xt;N.Stemmer=Nt;N.tagger=new _s(N);N.analyzer=new Ns(N);N.concorder=new Is(N);N.tokenizer=new As(N);N.inflector=new Rs(N);N.randomizer=new $s(N);N.lexicon=new Cs(N);N.conjugator=new Ts(N);N.SILENT=!1;N.SILENCE_LTS=!1;N.PHONES=["aa","ae","ah","ao","aw","ay","b","ch","d","dh","eh","er","ey","f","g","hh","ih","iy","jh","k","l","m","n","ng","ow","oy","p","r","s","sh","t","th","uh","uw","v","w","y","z","zh"];N.VERSION="3.0.17";N.HAS_LEXICON=typeof __NOLEX__>"u";N.FIRST=1;N.SECOND=2;N.THIRD=3;N.PAST=4;N.PRESENT=5;N.FUTURE=6;N.SINGULAR=7;N.PLURAL=8;N.NORMAL=9;N.STRESS="1";N.NOSTRESS="0";N.PHONE_BOUNDARY="-";N.WORD_BOUNDARY=" ";N.SYLLABLE_BOUNDARY="/";N.SENTENCE_BOUNDARY="|";N.VOWELS="aeiou";N.MODAL_EXCEPTIONS=["hardness","shortness"];N.ABRV=["Adm.","Capt.","Cmdr.","Col.","Dr.","Gen.","Gov.","Lt.","Maj.","Messrs.","Mr.","Mrs.","Ms.","Prof.","Rep.","Reps.","Rev.","Sen.","Sens.","Sgt.","Sr.","St.","A.k.a.","C.f.","I.e.","E.g.","Vs.","V.","Jan.","Feb.","Mar.","Apr.","Mar.","Jun.","Jul.","Aug.","Sept.","Oct.","Nov.","Dec."];N.QUESTIONS=["was","what","when","where","which","why","who","will","would","who","how","if","is","could","might","does","are","have"];N.STOP_WORDS=["and","a","of","in","i","you","is","to","that","it","for","on","have","with","this","be","not","are","as","was","but","or","from","my","at","if","they","your","all","he","by","one","me","what","so","can","will","do","an","about","we","just","would","there","no","like","out","his","has","up","more","who","when","don't","some","had","them","any","their","it's","only","which","i'm","been","other","were","how","then","now","her","than","she","well","also","us","very","because","am","here","could","even","him","into","our","much","too","did","should","over","want","these","may","where","most","many","those","does","why","please","off","going","its","i've","down","that's","can't","you're","didn't","another","around","must","few","doesn't","the","every","yes","each","maybe","i'll","away","doing","oh","else","isn't","he's","there's","hi","won't","ok","they're","yeah","mine","we're","what's","shall","she's","hello","okay","here's","less","didn't","said","over","this","that","just","then","under","some"];N.MASS_NOUNS=["abalone","asbestos","barracks","bathos","breeches","beef","britches","chaos","chinese","cognoscenti","clippers","corps","cosmos","crossroads","diabetes","ethos","gallows","graffiti","herpes","innings","lens","means","measles","mews","mumps","news","pasta","pathos","pincers","pliers","proceedings","rabies","rhinoceros","sassafras","scissors","series","shears","species","tuna","acoustics","aesthetics","aquatics","basics","ceramics","classics","cosmetics","dialectics","deer","dynamics","ethics","harmonics","heroics","mechanics","metrics","ooze","optics","physics","polemics","pyrotechnics","statistics","tactics","tropics","bengalese","bengali","bonsai","booze","cellulose","mess","moose","burmese","chinese","colossus","congolese","discus","electrolysis","emphasis","expertise","flu","fructose","gauze","glucose","grease","guyanese","haze","incense","japanese","lebanese","malaise","mayonnaise","maltese","music","money","menopause","merchandise","olympics","overuse","paradise","poise","potash","portuguese","prose","recompense","remorse","repose","senegalese","siamese","singhalese","sleaze","sioux","sudanese","suspense","swiss","taiwanese","vietnamese","unease","aircraft","anise","antifreeze","applause","archdiocese","apparatus","asparagus","bellows","bison","bluefish","bourgeois","bream","brill","butterfingers","cargo","carp","catfish","chassis","clone","clones","clothes","chub","cod","codfish","coley","contretemps","crawfish","crayfish","cuttlefish","dice","dogfish","doings","dory","downstairs","eldest","earnings","economics","electronics","firstborn","fish","flatfish","flounder","fowl","fry","fries","works","goldfish","golf","grand","grief","haddock","hake","halibut","headquarters","herring","hertz","honey","horsepower","goods","hovercraft","ironworks","kilohertz","ling","shrimp","swine","lungfish","mackerel","macaroni","megahertz","moorfowl","moorgame","mullet","nepalese","offspring","pants","patois","pekinese","perch","pickerel","pike","potpourri","precis","quid","rand","rendezvous","roach","salmon","samurai","seychelles","shad","sheep","shellfish","smelt","spaghetti","spacecraft","starfish","stockfish","sunfish","superficies","sweepstakes","smallpox","swordfish","tennis","tobacco","triceps","trout","tunafish","turbot","trousers","turf","dibs","undersigned","waterfowl","waterworks","waxworks","wildfowl","woodworm","yen","aries","pisces","forceps","jeans","mathematics","odds","politics","remains","aids","wildlife","shall","would","may","might","ought","should","acne","admiration","advice","air","anger","anticipation","assistance","awareness","bacon","baggage","blood","bravery","chess","clay","clothing","coal","compliance","comprehension","confusion","consciousness","cream","darkness","diligence","dust","education","empathy","enthusiasm","envy","equality","equipment","evidence","feedback","fitness","flattery","foliage","fun","furniture","garbage","gold","gossip","grammar","gratitude","gravel","guilt","happiness","hardware","hate","hay","health","heat","help","hesitation","homework","honesty","honor","honour","hospitality","hostility","humanity","humility","ice","immortality","independence","information","integrity","intimidation","jargon","jealousy","jewelry","justice","knowledge","literacy","logic","luck","lumber","luggage","mail","management","milk","morale","mud","nonsense","oppression","optimism","oxygen","participation","pay","peace","perseverance","pessimism","pneumonia","poetry","police","pride","privacy","propaganda","public","punctuation","recovery","rice","rust","satisfaction","schnapps","shame","slang","software","stamina","starvation","steam","steel","stuff","support","sweat","thunder","timber","toil","traffic","tongs","training","trash","valor","vehemence","violence","warmth","waste","weather","wheat","wisdom","work","accommodation","advertising","aid","art","bread","business","butter","calm","cash","cheese","childhood","clothing ","coffee","content","corruption","courage","currency","damage","danger","determination","electricity","employment","energy","entertainment","failure","fame","fire","flour","food","freedom","friendship","fuel","genetics","hair","harm","hospitality ","housework","humour","imagination","importance","innocence","intelligence","juice","kindness","labour","lack","laughter","leisure","literature","litter","love","magic","metal","motherhood","motivation","nature","nutrition","obesity","oil","old age","paper","patience","permission","pollution","poverty","power","production","progress","pronunciation","publicity","quality","quantity","racism","rain","relaxation","research","respect","room (space)","rubbish","safety","salt","sand","seafood","shopping","silence","smoke","snow","soup","speed","spelling","stress ","sugar","sunshine","tea","time","tolerance","trade","transportation","travel","trust","understanding","unemployment","usage","vision","water","wealth","weight","welfare","width","wood","yoga","youth","homecare","childcare","fanfare","healthcare","medicare"];N.INFINITIVE=1;N.GERUND=2;N.SPLIT_CONTRACTIONS=!1;var c3=/^[\p{P}|\+|-|<|>|\^|\$|\ufffd|`]*$/u,y3=/^[a-z\u00C0-\u00ff]+$/;N.RiScript=X;X.RiTa=N;return Kp(m3);})();
149
+ `+e)}}X.Grammar=b3;X.Visitor=Lp;var{Grammar:Fp}=X,N=class e{static grammar(n,a){return new Fp(...arguments)}static addTransform(n,a){return X.addTransform(...arguments)}static removeTransform(n){return X.removeTransform(...arguments)}static getTransforms(){return X.getTransforms()}static articlize(n){return X.articlize(...arguments)}static evaluate(n,a,r){return X.evaluate(...arguments)}static markov(n,a){return new Xt(...arguments)}static kwic(n,a){return e.concorder.kwic(...arguments)}static concordance(n,a){return e.concorder.concordance(...arguments)}static randomOrdering(n){return e.randomizer.randomOrdering(...arguments)}static randomSeed(n){return e.randomizer.seed(n)}static isQuestion(n){return e.QUESTIONS.includes(e.tokenize(n)[0].toLowerCase())}static isVowel(n){return n&&n.length===1&&e.VOWELS.includes(n)}static isConsonant(n){return n&&n.length===1&&!e.VOWELS.includes(n)&&y3.test(n)}static capitalize(n){return n?n[0].toUpperCase()+n.substring(1):""}static randomWord(n){return e.lexicon.randomWord(...arguments)}static async rhymes(n,a){return await e.lexicon.rhymes(...arguments)}static isRhyme(n,a){return e.lexicon.isRhyme(...arguments)}static async alliterations(n,a){return await e.lexicon.alliterations(...arguments)}static hasWord(n){return e.lexicon.hasWord(...arguments)}static isAbbrev(n,{caseSensitive:a=!1}={}){if(typeof n=="string"){if(a)return e.ABRV.includes(n.trim());let r=n.trim().toLowerCase();return e.ABRV.some(t=>t.toLowerCase()===r)}}static isAlliteration(n,a){return e.lexicon.isAlliteration(...arguments)}static async spellsLike(n,a){return await e.lexicon.spellsLike(...arguments)}static async soundsLike(n,a){return await e.lexicon.soundsLike(...arguments)}static pos(n){return e.tagger.tag(...arguments)}static isNoun(n){return e.tagger.isNoun(n)}static isAdjective(n){return e.tagger.isAdjective(n)}static isAdverb(n){return e.tagger.isAdverb(n)}static isPunct(n){return n&&n.length&&c3.test(n)}static isVerb(n){return e.tagger.isVerb(n)}static posInline(n,a={}){return a.inline=!0,e.tagger.tag(n,a)}static singularize(n){return e.inflector.singularize(...arguments)}static pluralize(n){return e.inflector.pluralize(...arguments)}static async search(n,a){return await e.lexicon.search(...arguments)}static tokens(n,a){return e.tokenizer.tokens(...arguments)}static tokenize(n,a){return e.tokenizer.tokenize(...arguments)}static untokenize(n,a){return e.tokenizer.untokenize(...arguments)}static sentences(n){return e.tokenizer.sentences(...arguments)}static isStopWord(n){return e.STOP_WORDS.includes(n.toLowerCase())}static stem(n){return Nt.stem(...arguments)}static presentPart(n){return e.conjugator.presentPart(...arguments)}static pastPart(n){return e.conjugator.pastPart(...arguments)}static conjugate(n,a){return e.conjugator.conjugate(...arguments)}static stresses(n){return e.analyzer.analyze(...arguments).stresses}static syllables(n){return e.analyzer.analyze(...arguments).syllables}static phones(n){return e.analyzer.analyze(...arguments).phones}static analyze(n){return e.analyzer.analyze(...arguments)}static spellsLikeSync(n,a){return e.lexicon.spellsLikeSync(...arguments)}static sountsLikeSync(n,a){return e.lexicon.sountsLikeSync(...arguments)}static rhymesSync(n,a){return e.lexicon.rhymesSync(...arguments)}static searchSync(n,a){return e.lexicon.rhymesSync(...arguments)}static alliterationsSync(n,a){return e.lexicon.alliterationsSync(...arguments)}static randi(n){return Math.floor(e.randomizer.random(...arguments))}static random(n){return e.randomizer.random(...arguments)}};Xt.parent=N;Nt.parent=N;N.RiGrammar=Fp;N.RiMarkov=Xt;N.Stemmer=Nt;N.tagger=new _s(N);N.analyzer=new Ns(N);N.concorder=new Is(N);N.tokenizer=new As(N);N.inflector=new Rs(N);N.randomizer=new $s(N);N.lexicon=new Cs(N);N.conjugator=new Ts(N);N.SILENT=!1;N.SILENCE_LTS=!1;N.PHONES=["aa","ae","ah","ao","aw","ay","b","ch","d","dh","eh","er","ey","f","g","hh","ih","iy","jh","k","l","m","n","ng","ow","oy","p","r","s","sh","t","th","uh","uw","v","w","y","z","zh"];N.VERSION="3.0.18";N.HAS_LEXICON=typeof __NOLEX__>"u";N.FIRST=1;N.SECOND=2;N.THIRD=3;N.PAST=4;N.PRESENT=5;N.FUTURE=6;N.SINGULAR=7;N.PLURAL=8;N.NORMAL=9;N.STRESS="1";N.NOSTRESS="0";N.PHONE_BOUNDARY="-";N.WORD_BOUNDARY=" ";N.SYLLABLE_BOUNDARY="/";N.SENTENCE_BOUNDARY="|";N.VOWELS="aeiou";N.MODAL_EXCEPTIONS=["hardness","shortness"];N.ABRV=["Adm.","Capt.","Cmdr.","Col.","Dr.","Gen.","Gov.","Lt.","Maj.","Messrs.","Mr.","Mrs.","Ms.","Prof.","Rep.","Reps.","Rev.","Sen.","Sens.","Sgt.","Sr.","St.","A.k.a.","C.f.","I.e.","E.g.","Vs.","V.","Jan.","Feb.","Mar.","Apr.","Mar.","Jun.","Jul.","Aug.","Sept.","Oct.","Nov.","Dec."];N.QUESTIONS=["was","what","when","where","which","why","who","will","would","who","how","if","is","could","might","does","are","have"];N.STOP_WORDS=["and","a","of","in","i","you","is","to","that","it","for","on","have","with","this","be","not","are","as","was","but","or","from","my","at","if","they","your","all","he","by","one","me","what","so","can","will","do","an","about","we","just","would","there","no","like","out","his","has","up","more","who","when","don't","some","had","them","any","their","it's","only","which","i'm","been","other","were","how","then","now","her","than","she","well","also","us","very","because","am","here","could","even","him","into","our","much","too","did","should","over","want","these","may","where","most","many","those","does","why","please","off","going","its","i've","down","that's","can't","you're","didn't","another","around","must","few","doesn't","the","every","yes","each","maybe","i'll","away","doing","oh","else","isn't","he's","there's","hi","won't","ok","they're","yeah","mine","we're","what's","shall","she's","hello","okay","here's","less","didn't","said","over","this","that","just","then","under","some"];N.MASS_NOUNS=["abalone","asbestos","barracks","bathos","breeches","beef","britches","chaos","chinese","cognoscenti","clippers","corps","cosmos","crossroads","diabetes","ethos","gallows","graffiti","herpes","innings","lens","means","measles","mews","mumps","news","pasta","pathos","pincers","pliers","proceedings","rabies","rhinoceros","sassafras","scissors","series","shears","species","tuna","acoustics","aesthetics","aquatics","basics","ceramics","classics","cosmetics","dialectics","deer","dynamics","ethics","harmonics","heroics","mechanics","metrics","ooze","optics","physics","polemics","pyrotechnics","statistics","tactics","tropics","bengalese","bengali","bonsai","booze","cellulose","mess","moose","burmese","chinese","colossus","congolese","discus","electrolysis","emphasis","expertise","flu","fructose","gauze","glucose","grease","guyanese","haze","incense","japanese","lebanese","malaise","mayonnaise","maltese","music","money","menopause","merchandise","olympics","overuse","paradise","poise","potash","portuguese","prose","recompense","remorse","repose","senegalese","siamese","singhalese","sleaze","sioux","sudanese","suspense","swiss","taiwanese","vietnamese","unease","aircraft","anise","antifreeze","applause","archdiocese","apparatus","asparagus","bellows","bison","bluefish","bourgeois","bream","brill","butterfingers","cargo","carp","catfish","chassis","clone","clones","clothes","chub","cod","codfish","coley","contretemps","crawfish","crayfish","cuttlefish","dice","dogfish","doings","dory","downstairs","eldest","earnings","economics","electronics","firstborn","fish","flatfish","flounder","fowl","fry","fries","works","goldfish","golf","grand","grief","haddock","hake","halibut","headquarters","herring","hertz","honey","horsepower","goods","hovercraft","ironworks","kilohertz","ling","shrimp","swine","lungfish","mackerel","macaroni","megahertz","moorfowl","moorgame","mullet","nepalese","offspring","pants","patois","pekinese","perch","pickerel","pike","potpourri","precis","quid","rand","rendezvous","roach","salmon","samurai","seychelles","shad","sheep","shellfish","smelt","spaghetti","spacecraft","starfish","stockfish","sunfish","superficies","sweepstakes","smallpox","swordfish","tennis","tobacco","triceps","trout","tunafish","turbot","trousers","turf","dibs","undersigned","waterfowl","waterworks","waxworks","wildfowl","woodworm","yen","aries","pisces","forceps","jeans","mathematics","odds","politics","remains","aids","wildlife","shall","would","may","might","ought","should","acne","admiration","advice","air","anger","anticipation","assistance","awareness","bacon","baggage","blood","bravery","chess","clay","clothing","coal","compliance","comprehension","confusion","consciousness","cream","darkness","diligence","dust","education","empathy","enthusiasm","envy","equality","equipment","evidence","feedback","fitness","flattery","foliage","fun","furniture","garbage","gold","gossip","grammar","gratitude","gravel","guilt","happiness","hardware","hate","hay","health","heat","help","hesitation","homework","honesty","honor","honour","hospitality","hostility","humanity","humility","ice","immortality","independence","information","integrity","intimidation","jargon","jealousy","jewelry","justice","knowledge","literacy","logic","luck","lumber","luggage","mail","management","milk","morale","mud","nonsense","oppression","optimism","oxygen","participation","pay","peace","perseverance","pessimism","pneumonia","poetry","police","pride","privacy","propaganda","public","punctuation","recovery","rice","rust","satisfaction","schnapps","shame","slang","software","stamina","starvation","steam","steel","stuff","support","sweat","thunder","timber","toil","traffic","tongs","training","trash","valor","vehemence","violence","warmth","waste","weather","wheat","wisdom","work","accommodation","advertising","aid","art","bread","business","butter","calm","cash","cheese","childhood","clothing ","coffee","content","corruption","courage","currency","damage","danger","determination","electricity","employment","energy","entertainment","failure","fame","fire","flour","food","freedom","friendship","fuel","genetics","hair","harm","hospitality ","housework","humour","imagination","importance","innocence","intelligence","juice","kindness","labour","lack","laughter","leisure","literature","litter","love","magic","metal","motherhood","motivation","nature","nutrition","obesity","oil","old age","paper","patience","permission","pollution","poverty","power","production","progress","pronunciation","publicity","quality","quantity","racism","rain","relaxation","research","respect","room (space)","rubbish","safety","salt","sand","seafood","shopping","silence","smoke","snow","soup","speed","spelling","stress ","sugar","sunshine","tea","time","tolerance","trade","transportation","travel","trust","understanding","unemployment","usage","vision","water","wealth","weight","welfare","width","wood","yoga","youth","homecare","childcare","fanfare","healthcare","medicare"];N.INFINITIVE=1;N.GERUND=2;N.SPLIT_CONTRACTIONS=!1;var c3=/^[\p{P}|\+|-|<|>|\^|\$|\ufffd|`]*$/u,y3=/^[a-z\u00C0-\u00ff]+$/;N.RiScript=X;X.RiTa=N;return Kp(m3);})();
150
150
  /*! Bundled license information:
151
151
 
152
152
  he/he.js: