text: !function(window,undefined){function makeClass(){return function(e){return this instanceof arguments.callee?void("function"==typeof this.init&&this.init.apply(this,e&&e.callee?e:arguments)):new arguments.callee(arguments)}}function printProgress(e,t,i){process&&process.stdout&&(process.stdout.clearLine(),process.stdout.cursorTo(0),process.stdout.write(e+t+"%"+(i?"\n":"")))}function is(e,t){return get(e)===t}function ok(e,t){if(get(e)!=t)throw TypeError("Expected "+(t?t.toUpperCase():t+E)+", but received "+(e?get(e).toUpperCase():e+E));return!0}function isNum(e){return!isNaN(parseFloat(e))&&isFinite(e)}function okeys(e){var t=[];for(var i in e)t.push(i);return t}function err(){for(var e="[RiTa] "+arguments[0],t=1;t<arguments.length;t++)e+="\n"+arguments[t];throw Error(e)}function warn(){if(!RiTa.SILENT&&console&&arguments&&arguments.length){console.warn("[WARN] "+arguments[0]);for(var e=1;e<arguments.length;e++)console.warn(arguments[e])}}function log(){!RiTa.SILENT&&console&&console.log.apply(console,arguments)}function strOk(e){return typeof e===S&&e.length>0}function trim(e){return strOk(e)?e.replace(/^\s\s*/,"").replace(/\s\s*$/,""):e}function last(e){return e&&e.length?e.charAt(e.length-1):E}function extend(e,t){for(var i=0;i<t.length;i++)e.push(t[i])}function endsWith(e,t){return!!is(e,S)&&new RegExp(t+"$").test(e)}function startsWith(e,t){return!!is(e,S)&&new RegExp("^"+t).test(e)}function equalsIgnoreCase(e,t){return!(!is(e,S)||!is(t,S))&&e.toLowerCase()===t.toLowerCase()}function isNode(){return"undefined"!=typeof module&&module.exports}function shuffle(e){for(var t=e.slice(),i=t.length,n=i;n--;){var r=parseInt(Math.random()*i),s=t[n];t[n]=t[r],t[r]=s}return t}function inArray(e,t){return!!e&&e.indexOf(t)>-1}function escapeRegExp(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function get(e){if("undefined"!=typeof e)return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function tagForPENN(e){if(!e||!e.length)return EA;var t=is(e,S)?RiTa.tokenize(e):e;return PosTagger.tag(t)}function tagForWordNet(e){var t,i=tagForPENN(e);if(e&&i.length){for(var n=0;n<i.length;n++)t=i[n],i[n]="-",PosTagger.isNoun(t)?i[n]="n":PosTagger.isVerb(t)?i[n]="v":PosTagger.isAdverb(t)?i[n]="r":PosTagger.isAdj(t)&&(i[n]="a");return i}return EA}function initFeatureMap(e){e._features?["tokens","stresses","phonemes","syllables","pos"].forEach(function(t){delete e._features[t]}):e._features={},e._features.text=e.text()}function checkPluralNoLex(e){for(var t=[categoryUM_A,categoryON_A,categoryO_I,categoryUS_I,categoryIX_ICES],i=0;i<t.length;i++)if(t[i].indexOf(e)>-1)return!0;var n=categoryIRR.indexOf(e);return n%2===0}for(var E="",SP=" ",EA=[],N="number",S="string",O="object",A="array",B="boolean",R="regexp",F="function",BN="\n",FEATURES=["tokens","stresses","phonemes","syllables","pos","text"],RiTa={VERSION:"1.3.11",SPLIT_CONTRACTIONS:!1,JAVA:1,JS:2,NODE:3,DATA_LOADED:"DataLoaded",INTERNAL:"Internal",UNKNOWN:"Unknown",FIRST_PERSON:1,SECOND_PERSON:2,THIRD_PERSON:3,PAST_TENSE:4,PRESENT_TENSE:5,FUTURE_TENSE:6,SINGULAR:7,PLURAL:8,NORMAL:9,FEATURE_DELIM:":",STRESSED:"1",UNSTRESSED:"0",PHONEME_BOUNDARY:"-",WORD_BOUNDARY:" ",SYLLABLE_BOUNDARY:"/",SENTENCE_BOUNDARY:"|",VOWELS:"aeiou",ABBREVIATIONS:["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."],LEX_WARN:"A minimal Lexicon is currently in use. For word features outside the lexicon, use a larger version of RiTa.",LTS_WARN:"No LTS-rules found: features/tagging may be inaccurate!",INFINITIVE:1,GERUND:2,IMPERATIVE:3,BARE_INFINITIVE:4,SUBJUNCTIVE:5,SILENT:!1,LANCASTER:"Lancaster",PORTER:"Porter",PLING:"Pling",NON_BREAKING_SPACE:"<sp/>",PARAGRAPH_BREAK:"<p/>",LINE_BREAK:"<br/>",STOP_WORDS:[".",",","the","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","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"],stemmers:{},random:function(){var e=Math.random();return arguments.length?1===arguments.length?e*arguments[0]:e*(arguments[1]-arguments[0])+arguments[0]:e},randomItem:function(e){return e[Math.floor(Math.random()*e.length)]},distance:function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)},getPosTags:function(e,t){return t?tagForWordNet(e):tagForPENN(e)},getPosTagsInline:function(e,t){if(!e||!e.length)return E;t=t||"/",e=is(e,S)?RiTa.tokenize(e):e;for(var i=E,n=RiTa.getPosTags(e),r=0;r<e.length;r++)i+=e[r],RiTa.isPunctuation(e[r])||(i+=t+n[r]),i+=SP;return i.trim()},getPresentParticiple:function(e){return Conjugator().getPresentParticiple(e)},getPastParticiple:function(e){return Conjugator().getPastParticiple(e)},concordance:function(e,t){return Concorder(e,t).concordance()},kwic:function(e,t,i){return wordCount=i&&i.wordCount||4,Concorder(e,i).kwic(t,wordCount)},conjugate:function(e,t){return Conjugator().conjugate(e,t)},upperCaseFirst:function(e){return e.charAt(0).toUpperCase()+e.substring(1)},pluralize:function(e){if(!strOk(e))return E;var t,i,n=PLURAL_RULES;if(inArray(MODALS,e.toLowerCase()))return e;for(t=0;t<n.length;t++)if(i=n[t],i.applies(e.toLowerCase()))return i.fire(e);return DEFAULT_PLURAL_RULE.fire(e)},singularize:function(e){if(!strOk(e))return E;var t,i,n=SINGULAR_RULES;if(inArray(MODALS,e.toLowerCase()))return e;for(t=n.length;t--;)if(i=n[t],i.applies(e.toLowerCase()))return i.fire(e);return this.stem(e,"Pling")},trim:function(e){return trim(e)},tokenize:function(e,t){return is(e,S)?t?e.split(t):(e=trim(e),e=e.replace(/([\\?!\"\u201C\\.,;:@#$%&])/g," $1 "),e=e.replace(/\\.\\.\\./g," ... "),e=e.replace(/\\s+/g,SP),e=e.replace(/,([^0-9])/g," , $1"),e=e.replace(/([^.])([.])([\])}>\"'’]*)\\s*$/g,"$1 $2$3 "),e=e.replace(/([\[\](){}<>])/g," $1 "),e=e.replace(/--/g," -- "),e=e.replace(/$/g,SP),e=e.replace(/^/g,SP),e=e.replace(/([^'])' | '/g,"$1 ' "),e=e.replace(/ \u2018/g," ‘ "),e=e.replace(/'([SMD]) /g," '$1 "),RiTa.SPLIT_CONTRACTIONS&&(e=e.replace(/([Cc])an['’]t/g,"$1an not"),e=e.replace(/([Dd])idn['’]t/g,"$1id not"),e=e.replace(/([CcWw])ouldn['’]t/g,"$1ould not"),e=e.replace(/([Ss])houldn['’]t/g,"$1hould not"),e=e.replace(/ ([Ii])t['’]s/g," $1t is"),e=e.replace(/n['’]t /g," not "),e=e.replace(/['’]ve /g," have "),e=e.replace(/['’]re /g," are ")),e=e.replace(/ ([A-Z]) \\./g," $1. "),e=e.replace(/\\s+/g,SP),e=e.replace(/^\\s+/g,E),trim(e).split(/\s+/)):[]},untokenize:function(e,t){t=t||SP;for(var i,n,r,s,a,o,u,l=/^[,\.\;\:\?\!\)""“”\u2019‘`']+$/,c=0,h=/^[\(""“”\u2019‘`']+$/,p=/^[\u2019‘`']+$/,d=/^[\u2019']+$/,g=!1,f=e.length&&h.test(e[0]),R=e[0]||E,m=!1,b=1;b<e.length;b++)e[b]&&(a=","===e[b],i=l.test(e[b]),r=h.test(e[b]),u=","===e[b-1],n=l.test(e[b-1]),s=h.test(e[b-1]),lastEndWithS="s"===e[b-1].charAt(e[b-1].length-1),o=b==e.length-1,c&&console.log('before "'+e[b]+'"',b,"inquote? "+f,"thisPunct?",i,"thisQuote",r),r?f?(g=!0,f=!1):d.test(e[b])&&lastEndWithS||(c&&console.log("set withinQuote=1"),f=!0,g=!1,R+=t):g&&!i?(R+=t,c&&console.log("hit1",e[b]),g=!1):s&&a?m=!0:m&&u?(R+=t,c&&console.log("hit2",e[b]),m=!1):(!i&&!s||!o&&i&&n)&&(R+=t),R+=e[b],i&&!n&&!f&&p.test(e[b])&&(c&&console.log("hitnew",e[b]),R+=t));return R.trim()},splitSentences:function(e,t){function i(e){for(var t=0;t<e.length;t++)e[t]=e[t].replace(a,".");return e}function n(e){for(var t=0;t<r.length;t++)for(var i=r[t],n=e.indexOf(i);n>-1;)e=e.replace(i,i.replace(".",s)),n=e.indexOf(i);return e}var r=this.ABBREVIATIONS,s="___",a=new RegExp(s,"g"),o=n(e).match(/(\S.+?[.!?])(?=\s+|$)/g);return e.length&&o&&o.length?i(o):[e]},isAbbreviation:function(e,t){var i=function(e){return e&&e.length?e.substring(0,1).toUpperCase()+e.substring(1):e};return t=t||!1,e=t?e:i(e),inArray(this.ABBREVIATIONS,e)},loadString:function(e,t,i){var n=function(e,t,i){var n="",r=i||BN,s=/.+?:\/\/.+/.test(e),a=this;if(s){var o=function(i){i.on("data",function(e){n+=e}),i.on("error",function(e){throw e}),i.on("end",function(){n=n.toString("utf-8").replace(/[\r\n]+/g,r).trim(),a.fireDataLoaded(e,t,n)})},u=require("http").request(e,o);u.on("socket",function(e){e.setTimeout(5e3),e.on("timeout",function(){throw u.abort(),Error("[RiTa] loadString timed-out and aborted request")})}),u.end()}else{var l=require("fs");l.readFile(e,function(i,n){if(i||!n)throw err("[Node] Error reading file: "+e+BN+i),i;n=n.toString("utf-8").replace(/[\r\n]+/g,r).trim(),a.fireDataLoaded(e,t,n)})}};if(ok(e,S),isNode())return n.apply(this,arguments);var r=this,s="",a=new XMLHttpRequest;return a.addEventListener("error",function(){console.error("[RiTa] loadStrings() unable to load "+e)}),a.open("GET",e,!0),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status){var i=[],n=a.responseText.match(/[^\r\n]+/g);for(var s in n)i[s]=n[s];i=i.join(BN),r.fireDataLoaded(e,t,i)}else console.error("[RiTa] loadString() unable to load: "+e)},a.send(null),s},loadStrings:function(e,t,i){var n=function(e,t){function i(i){i=i.toString("utf-8").trim();var n=i.split(/(\r\n|\n)/gm);s.fireDataLoaded(e,t,n)}var n="",r=/.+?:\/\/.+/.test(e),s=this;if(r){var a=function(e){e.on("data",function(e){n+=e}),e.on("error",function(e){throw e}),e.on("end",function(){i(n)})},o=require("http").request(e,a);o.on("socket",function(e){e.setTimeout(5e3),e.on("timeout",function(){throw o.abort(),Error("[RiTa] loadString timed-out and aborted request")})}),o.end()}else{var u=require("fs");u.readFile(e,function(t,n){if(t||!n)throw err("[Node] Error reading file: "+e+BN+t),t;i(n)})}};if(ok(e,S),isNode())return n.apply(this,arguments);var r=this,s="",a=new XMLHttpRequest;return a.addEventListener("error",function(){console.error("[RiTa] loadStrings() unable to load "+e)}),a.open("GET",e,!0),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status){var i=a.responseText.match(/[^\r\n]+/g),n=[];for(var s in i)n[s]=i[s];r.fireDataLoaded(e,t,n)}else console.error("[RiTa] loadString() unable to load: "+e)},a.send(null),s},fireDataLoaded:function(e,t,i){return t?t(i,e):RiTaEvent({name:"RiTaLoader",urls:is(e,S)?[e]:e},DATA_LOADED,i)._fire()},isQuestion:function(e){for(var t=RiTa.tokenize(e),i=0;i<QUESTION_STARTS.length;i++)if(equalsIgnoreCase(t[0],QUESTION_STARTS[i]))return!0;return!1},isSentenceEnd:function(e,t){if(!is(e,S)||!is(t,S))return!1;var i=e.charAt(0),n=e.length;if(RiTa.isAbbreviation(e))return!1;if(n>1&&i.indexOf("`'\"([{<")!=-1&&RiTa.isAbbreviation(e.substring(1)))return!1;if(n>2&&("'"==e.charAt(0)&&"'"==e.charAt(1)||"`"==e.charAt(0)&&"`"==e.charAt(1))&&RiTa.isAbbreviation(e.substring(2)))return!1;var r=t.length,s=e.charAt(n-1),a=n>1?e.charAt(n-2):SP,o=n>2?e.charAt(n-3):SP,u=t.charAt(0),l=r>1?t.charAt(1):SP,c=r>2?t.charAt(2):SP;return(u==u.toUpperCase()||l==l.toUpperCase()&&u.indexOf("`'\"([{<")!=-1||c==c.toUpperCase()&&("`"==u&&"`"==l||"'"==u&&"'"==l)||"_"==t||"<"==u)&&("?"==s||"!"==s||a.indexOf("?!.")!=-1&&s.indexOf("\"'}>)")!=-1||o.indexOf("?!.")!=-1&&"'"==a&&"'"==s||"."==s&&((2!=n||a!=a.toUpperCase())&&(4!=n||"."!=o||a!=a.toUpperCase()||e.charAt(0)!=e.charAt(0).toUpperCase())))},isW_Question:function(e){for(var t=RiTa.tokenize(e),i=0;i<W_QUESTION_STARTS.length;i++)if(equalsIgnoreCase(t[0],W_QUESTION_STARTS[i]))return!0;return!1},unescapeHTML:function(e){if(!e||!e.length)return e;var t=e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"');return String.fromCharCodePoint=function(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];arguments[t]<65536?e.push(arguments[t]):arguments[t]<1114112&&(i-=65536,e.push((i>>10&1023)+55296),e.push((1023&i)+56320))}return String.fromCharCode.apply(String,e)},t=t.replace(/&#(\d+);/g,function(e,t){return String.fromCharCodePoint(parseInt(t,10))}).replace(/&#x([0-9a-f]+);/gi,function(e,t){return String.fromCharCodePoint(parseInt(t,16))})},randomOrdering:function(e){var t=[];if(e){for(var i=0;i<e;i++)t.push(i);for(var n,r,s=t.length;s;n=parseInt(Math.random()*s),r=t[--s],t[s]=t[n],t[n]=r);}return t},trimPunctuation:function(e){if(!is(e,S))return e;var t="[�`~\"/\\'_\\-[\\]{}()*+!?%&.,\\\\^$|#@<>|+=;:‘’“”]",i=new RegExp("^"+t+"+|"+t+"+$","g");return e===E?E:e.replace(i,E)},stripPunctuation:function(e){return e===E?E:e.replace(PUNCTUATION_CLASS,E)},isPunctuation:function(e){return!(!e||!e.length)&&ONLY_PUNCT.test(e)},hasPunctuation:function(e){return!(!e||!e.length)&&ONLY_PUNCT.test(e)},env:function(){return isNode()?RiTa.NODE:RiTa.JS},chomp:function(e){return e.replace(/\s+$|^\s+/g,E)},getPhonemes:function(e){return RiString(e).analyze().get(RiTa.PHONEMES)},getStresses:function(e){return RiString(e).analyze().get(RiTa.STRESSES)},getSyllables:function(e){return RiString(e).analyze().get(RiTa.SYLLABLES)},getWordCount:function(e){return RiTa.tokenize(e).length},stem:function(e,t){if(t=t||"Porter","Lancaster"!=t&&"Porter"!=t&&"Pling"!=t&&err("Bad stemmer type: "+t),e.indexOf(SP)<0)return RiTa.stemmers[t](e);e=e.replace(/[^\w]/g,SP).replace(/\s+/g,SP);for(var i=[],n=e.split(SP),r=0;r<n.length;r++)i.push(RiTa.stemmers[t](n[r]));return i.join(SP)},minEditDistance:function(e,t,i){var n=i?MinEditDist.computeAdjusted:MinEditDist.computeRaw;return n.call(MinEditDist,e,t)}},i=0;i<FEATURES.length;i++)RiTa[FEATURES[i].toUpperCase()]=FEATURES[i];var RiLexicon=makeClass();RiLexicon.SILENCE_LTS=!1,RiLexicon.prototype={init:function(){"undefined"==typeof _dict?(this.data={},this.keys=[]):this.reload()},clear:function(){this.data={},this.keys=[]},reload:function(){"undefined"!=typeof _dict&&(this.data=_dict(),this.keys=okeys(this.data))},addWord:function(e,t,i){return this.data[e.toLowerCase()]=[t.toLowerCase(),i.toLowerCase()],this.keys=okeys(this.data),this},similarByLetter:function(e,t,i){var n=Number.MAX_VALUE,r=2,s=[];if(!e||!e.length)return EA;2==arguments.length&&is(t,B)&&(i=t,t=1),e=e.toLowerCase(),t=t||1,i=i||!1;for(var a,o=e+"s",u=e+"es",l=e.length,c=0;c<this.size();c++){var h=this.keys[c];h.length<r||i&&h.length!=l||h!==e&&h!==o&&h!==u&&(a=MinEditDist.computeRaw(h,e),a>=t&&a<n?(n=a,s=[h]):a===n&&s.push(h))}return s},similarBySound:function(e,t,i){t=t||1;var n,r,s,a=Number.MAX_VALUE,o=[],u=i||2,l=RiTa.getPhonemes(e),c=l?l.split("-"):[],h=e+"s",p=e+"es";if(!c[0]||!e||!e.length)return EA;for(var d=0;d<this.size();d++)n=this.keys[d],n.length<u||n!==e&&n!==h&&n!==p&&(l=this.data[n][0],r=l.replace(/1/g,E).replace(/ /g,"-").split("-"),s=MinEditDist.computeRaw(r,c),s>=t&&s<a?(a=s,o=[n]):s===a&&o.push(n));return o},similarBySoundAndLetter:function(e){function t(){var e,t,i,n=[],r={},s=0,a=arguments.length-1,o=arguments[0].length;for(e=0;e<=a;e++)t=arguments[e].length,t<o&&(s=e,o=t);for(e=0;e<=a;e++){t=e===s?0:e||s,i=arguments[t].length;for(var u=0;u<i;u++){var l=arguments[t][u];r[l]===e-1?e===a?(n.push(l),r[l]=0):r[l]=e:0===e&&(r[l]=0)}}return n}var i,n=[],r=this.similarByLetter(e);return r.length<1?n:(i=this.similarBySound(e),i.length<1?n:t(i,r))},substrings:function(e,t){t=t||0===t||4;for(var i=[],n=0;n<this.size();n++)this.keys[n]===e||this.keys[n].length<t||e.indexOf(this.keys[n])>=0&&i.push(this.keys[n]);return i},superstrings:function(e){for(var t=[],i=0;i<this.size();i++)this.keys[i]!==e&&this.keys[i].indexOf(e)>=0&&t.push(this.keys[i]);return t},words:function(){var e,t=arguments,i=!1,n=[];switch(t.length){case 2:is(t[0],B)?(i=t[0],e=is(t[1],R)?t[1]:new RegExp(t[1])):(i=t[1],e=is(t[0],R)?t[0]:new RegExp(t[0]));break;case 1:if(is(t[0],B))return t[0]?shuffle(this.keys):this.keys;e=is(t[0],R)?t[0]:new RegExp(t[0]);break;case 0:return this.keys}for(var r=0;r<this.size();r++)e.test(this.keys[r])&&n.push(this.keys[r]);return i?shuffle(n):n},_isVowel:function(e){return strOk(e)&&RiTa.VOWELS.indexOf(e)>-1},_isConsonant:function(e){return typeof e===S&&1===e.length&&RiTa.VOWELS.indexOf(e)<0&&/^[a-z\u00C0-\u00ff]+$/.test(e)},_isPlural:function(e){if(NULL_PLURALS.applies(e))return!0;var t=RiTa.stem(e,"Pling");if(t===e)return!1;var i=RiTa.singularize(e),n=this.data[i];if(n&&2===n.length){for(var r=n[1].split(SP),s=0;s<r.length;s++)if("nn"===r[s])return!0}else if((e.endsWith("ses")||e.endsWith("zes"))&&(i=e.substring(0,e.length-1),n=this.data[i],n&&2===n.length))for(var r=n[1].split(SP),s=0;s<r.length;s++)if("nn"===r[s])return!0;return!1},containsWord:function(e){return!(!this.data||!strOk(e))&&(e=e.toLowerCase(),this.data[e]||this._isPlural(e))},isRhyme:function(e,t,i){var n=this._getRawPhones(e,i),r=this._getRawPhones(t,i);if(!strOk(e)||!strOk(t)||equalsIgnoreCase(e,t)||r===n)return!1;var s=this._lastStressedVowelPhonemeToEnd(e,i),a=this._lastStressedVowelPhonemeToEnd(t,i);return strOk(s)&&strOk(a)&&s===a},rhymes:function(e){for(var t,i=this._lastStressedPhoneToEnd(e),n=[],r=0;r<this.size();r++)this.keys[r]!==e&&(t=this.data[this.keys[r]][0],endsWith(t,i)&&n.push(this.keys[r]));return n.length>0?n:EA},alliterations:function(e,t,i){if(e.indexOf(" ")>-1)return[];if(this._isVowel(e.charAt(0)))return[];t=t||4;for(var n,r=[],s=this._firstPhoneme(this._firstStressedSyllable(e,i)),a=0;a<this.size();a++){if(n=this._firstPhoneme(this._firstStressedSyllable(this.keys[a],i)),n._isVowel)return[];n&&s===n&&this.keys[a].length>=t&&r.push(this.keys[a])}return shuffle(r)},isAlliteration:function(e,t,i){if(!strOk(e)||!strOk(t)||e.indexOf(" ")>-1||t.indexOf(" ")>-1)return!1;var n=this._firstPhoneme(this._firstStressedSyllable(e,i)),r=this._firstPhoneme(this._firstStressedSyllable(t,i));return!this._isVowel(n.charAt(0))&&!this._isVowel(r.charAt(0))&&(strOk(n)&&strOk(r)&&n===r)},_firstSyllable:function(e,t){var i=this._getRawPhones(e,t);if(!strOk(i))return E;"URL"===e&&console.log(i);var n=i.split(" ");return n[0]},_firstStressedSyllable:function(e,t){var i,n,r=this._getRawPhones(e,t),s=-1;if(!strOk(r))return E;if(s=r.indexOf(RiTa.STRESSED),s<0)return E;for(i=r.charAt(--s);" "!=i;){if(--s<0){s=0;break}i=r.charAt(s)}return n=0===s?r:trim(r.substring(s)),s=n.indexOf(" "),s<0?n:n.substring(0,s)},isVerb:function(e){return this._checkType(e,PosTagger.VERBS)},isNoun:function(e){var t=this._checkType(e,PosTagger.NOUNS);if(!t){var i=RiTa.singularize(e);i!==e&&(t=this._checkType(i,PosTagger.NOUNS))}return t},isAdverb:function(e){return this._checkType(e,PosTagger.ADV)},isAdjective:function(e){return this._checkType(e,PosTagger.ADJ)},size:function(){var e=this.keys.length;return RiTa.LEX_WARN&&0===e&&(warn(RiTa.LEX_WARN),RiTa.LEX_WARN=0),e},_checkType:function(e,t){if(e&&e.indexOf(SP)!=-1)throw Error("[RiTa] _checkType() expects a single word, found: "+e);var i=this._getPosArr(e);RiTa.LEX_WARN&&i.length<1&&this.size()<=1e3&&(warn(RiTa.LEX_WARN),RiTa.LEX_WARN=0);for(var n=0;n<i.length;n++)if(t.indexOf(i[n])>-1)return!0;return!1},_getSyllables:function(e){if(!strOk(e))return E;for(var t=RiTa.tokenize(e),i=[],n=0;n<t.length;n++)i[n]=this._getRawPhones(t[n]).replace(/\s/g,"/");return RiTa.untokenize(i).replace(/1/g,E).trim()},_getPhonemes:function(e){if(!strOk(e))return E;for(var t=RiTa.tokenize(e),i=[],n=0;n<t.length;n++)if(!RiTa.isPunctuation(t[n])){if(i[n]=this._getRawPhones(t[n]),!i[n].length)return E;i[n]=i[n].replace(/ /g,"-")}return RiTa.untokenize(i).replace(/1/g,E).trim()},_getStresses:function(e){var t,i,n=[],r=[],s=is(e,A)?e:RiTa.tokenize(e);if(!strOk(e))return E;for(t=0;t<s.length;t++)RiTa.isPunctuation(s[t])||(r[t]=this._getRawPhones(s[t]));for(t=0;t<r.length;t++)if(r[t]){i=r[t].split(SP);for(var a=0;a<i.length;a++){var o=i[a].indexOf(RiTa.STRESSED)>-1?RiTa.STRESSED:RiTa.UNSTRESSED;a>0&&(o="/"+o),n.push(o)}}return n.join(SP).replace(/ \//g,"/")},lexicalData:function(e){return 1===arguments.length?(this.data=e,this):this.data},_lookupRaw:function(e){if(e=e&&e.toLowerCase(),this.data&&this.data[e])return this.data[e]},_getRawPhones:function(e,t){var i,n,r=this._lookupRaw(e);return t=t||!1,(r===undefined||t&&!RiTa.SILENT&&!RiLexicon.SILENCE_LTS)&&(n=this._letterToSound(),i=n&&n.getPhones(e),i&&i.length)?RiString._syllabify(i):r&&2===r.length?r[0]:E},_getPosData:function(e){var t=this._lookupRaw(e);return t&&2===t.length?t[1]:E},_getPosArr:function(e){var t=this._getPosData(e);return strOk(t)?t.split(SP):EA},_getBestPos:function(e){var t=this._getPosArr(e);return t.length>0?t[0]:[]},_firstPhoneme:function(e){if(!strOk(e))return E;var t=e.split(RiTa.PHONEME_BOUNDARY);return t?t[0]:E},_firstConsonant:function(e){if(!strOk(e))return E;var t=e.split(RiTa.PHONEME_BOUNDARY);if(t)for(var i=0;i<t.length;i++)if(this._isConsonant(t[i].charAt(0)))return t[i];return E},_lastStressedVowelPhonemeToEnd:function(e,t){if(!strOk(e))return E;var i=this._lastStressedPhoneToEnd(e,t);if(!strOk(i))return E;var n=i.split(" "),r=n[n.length-1];r=r.replace("[^a-z-1 ]","");for(var s=-1,a=0;a<r.length;a++){var o=r.charAt(a);if(this._isVowel(o)){s=a;break}}return e+" "+i+" last:"+r+" idx="+s+" result:"+r.substring(s),r.substring(s)},_lastStressedPhoneToEnd:function(e,t){if(!strOk(e))return E;var i,n,r,s=this._getRawPhones(e,t);if(!strOk(s))return E;if(i=s.lastIndexOf(RiTa.STRESSED),i<0)return E;for(n=s.charAt(--i);"-"!=n&&" "!=n;){if(--i<0)return s;n=s.charAt(i)}return r=s.substring(i+1)},randomWord:function(){var e,t,i,n,r=!1,s=Math.floor(Math.random()*this.size()),a=arguments,o=this.keys,u=function(e,t){return!!(e.endsWith("ness")||e.endsWith("ism")||t.indexOf("vbg")>0)};switch("string"==typeof a[0]&&(a[0]=trim(a[0]).toLowerCase(),r="nns"===a[0],"v"===a[0]&&(a[0]="vb"),"r"===a[0]&&(a[0]="rb"),"a"===a[0]&&(a[0]="jj"),"n"!==a[0]&&"nns"!==a[0]||(a[0]="nn")),a.length){case 2:for(e=0;e<o.length;e++)if(t=(s+e)%o.length,i=this.data[o[t]],n=i[0].split(SP).length,n===a[1]&&a[0]===i[1].split(SP)[0]){if(!r)return o[t];if(!u(o[t],i[1]))return RiTa.pluralize(o[t])}case 1:if(is(a[0],S)){for(e=0;e<o.length;e++)if(t=(s+e)%o.length,i=this.data[o[t]],a[0]===i[1].split(SP)[0]){if(!r)return o[t];if(!u(o[t],i[1]))return RiTa.pluralize(o[t])}}else for(e=0;e<o.length;e++)if(t=(s+e)%o.length,i=this.data[o[t]],i[0].split(SP).length===a[0])return o[t];return E;case 0:return o[s]}return E},_letterToSound:function(){return this.lts||"undefined"!=typeof LetterToSound&&(this.lts=new LetterToSound),this.lts}};var RiMarkov=makeClass();RiMarkov.MAX_GENERATION_ATTEMPTS=5e3;var SSRE=/"?[A-Z][a-z"',;`-]*/,SSDLM="D=l1m_";RiMarkov.prototype={init:function(e,t,i){var n=this._initArgs.apply(this,arguments);ok(n[0],N),this.N=n[0],this.rawText="",this.pathTrace=[],this.sentenceStarts=[],this.minSentenceLength=6,this.maxSentenceLength=35,this.root=new TextNode(null,"ROOT"),this.isSentenceAware=!(n.length>1&&!n[1]),this.allowDuplicates=!(n.length>2&&!n[2]),this.printIgnoredText=!1},_initArgs:function(){var e=arguments,t=get(e[0]);return!e.length||t!==O&&"global"!==t&&"window"!==t?e:this._initArgs.apply(this,Array.prototype.slice.call(e,1))},getProbability:function(e){this.root||err("Model not initd: null root!");var t=is(e,S)?this.root.lookup(e):this._findNode(e);return t?t.probability():0},getProbabilities:function(e){is(e,S)&&(e=[e]),e.length>this.N&&(e=e.slice(Math.max(0,e.length-(this.N-1)),e.length));var t={},i=this._findNode(e);if(!i)return{};for(var n=i.childNodes(),r=0;r<n.length;r++){var s=n[r];s&&(t[s.token]=s.probability())}return t},getCompletions:function(e,t){var i,n,r,s,a=[];if(t){if(e.length+t.length>this.N&&err("Sum of pre.length && post.length must be < N, was "+(e.length+t.length)),i=this._findNode(e),!i)return null;s=i.childNodes();for(var o=0;o<s.length;o++){n=s[o],r=e.slice(0),r.push(n.token);for(var u=0;u<t.length;u++)r.push(t[u]);this._findNode(r)&&a.push(n.token)}return a}var l=this.getProbabilities(e);return okeys(l).sort(function(e,t){return l[t]-l[e]})},generateUntil:function(e,t,i){t=t||1,i=i||Number.MAX_VALUE;var n,r,s=0,a=999;e:for(;++s<a;)for(r=this.generateTokens(t);r.length<i;){if(n=this._nextNodeForArr(r),!n||!n.token)continue e;if(r.push(n.token),n.token.search(e)>-1)return r}return s>=a&&err(BN+"RiMarkov failed to complete after "+s+" attempts.You may need to add more text to your model..."+BN),r},generateTokens:function(e){var t,i=0,n=500,r=[],s=[];e:for(;++i<n;)if(t=this.root.selectChild(null,!0),t&&t.token){for(r.push(t);r.length<e;){if(t=this._nextNodeForArr(r),!t||!t.token){r=[];continue e}r.push(t)}break}r.length<e&&this._onGenerationIncomplete(i,r.length);for(var a=0;a<r.length;a++)s.push(r[a].token);return s},sentenceAware:function(){if(arguments.length>0)throw Error("sentenceAware() takes no arguments, instead use the constructor RiMarkov(n, recognizeSentences);");return this.isSentenceAware},print:function(){return console&&console.log(this.root.asTree(!1)),this},ready:function(e){return this.size()>0},loadFrom:function(e,t,i,n){var r=this;is(e,S)||ok(e,A),is(t,F)?(n=t,t=undefined):is(i,F)&&(n=i,i=undefined),RiTa.loadStrings(e,function(e){e=e.join(BN),r.loadText(e,t,i),n&&is(n,F)&&n(e)})},loadText:function(e,t,i,n){ok(e,S),this.rawText+=e,t=Math.round(t||1);var r=this.isSentenceAware?this._loadSentences(e,t,n):this.loadTokens(RiTa.tokenize(e,i),t);return r},loadTokens:function(e,t){t=Math.round(t||1),this.root.count+=e.length;for(var i,n=0;n<e.length;n++){i=[];for(var r=0;r<this.N;r++)n+r<e.length?i[r]=e[n+r]?e[n+r]:null:i[r]=null;for(var s=0;s<t;s++)for(var a=this.root,o=0;o<i.length;o++)a.token&&(a=a.addChild(i[o],1))}return this},generateSentence:function(){return this.generateSentences(1)[0]},generateSentences:function(e){this.isSentenceAware||err("generateSentences() can only be called when the model is in 'sentence-aware' mode, otherwise use generateTokens()");for(var t=this._getSentenceStart(),i=t.token+SP,n=[],r=0,s=0,a=1;n.length<e;)if(a>=this.maxSentenceLength&&(t=this._getSentenceStart(),i=t.token+SP,a=1),t.isLeaf())t=this._tracePathFromRoot(t);else if(t=this._nextNodeForNode(t),t.isSentenceStart){if(a>=this.minSentenceLength){var o=RiTa.untokenize(i.trim().split(/\s+/));o=o.replace(/(.)\( /,"$1 ("),this._validateSentence(o)&&(n.indexOf(o)<0&&n.push(o),s+=r,r=0)}t=this._getSentenceStart(),i=t.token+SP,a=1}else if(a++,i+=t.token+SP,++r>=RiMarkov.MAX_GENERATION_ATTEMPTS){this._onGenerationIncomplete(s+=r,n.length);break}return n},_validateSentence:function(e){var t=RiTa.tokenize(e),i=t[0],n=t[t.length-1];if(!i.match(/[A-Z]\S*/))return this.printIgnoredText&&log("Skipping: bad first char in '"+e+"'"),!1;if(!n.match(/[!?.]/))return this.printIgnoredText&&log("Bad last token: '"+n+"' in: "+e),!1;if(!this.allowDuplicates&&(this.isSentenceAware||err("Invalid state: allowDuplicates must be true when not generating sentences"),this.rawText.indexOf(e)>-1))return++this.skippedDups>=RiMarkov.MAX_GENERATION_ATTEMPTS&&(this.allowDuplicates=!0,this.skippedDups=0),this.printIgnoredText&&console.log("Ignoring duplicate: "+e),!1;var r=e.split(/\s+/);return!RiTa.isAbbreviation(r[r.length-1])},_tracePathFromRoot:function(e){e.pathFromRoot(this.pathTrace),this.pathTrace.pop();for(var t=this.root;this.pathTrace.length;){var i=this.pathTrace.pop();t=t.lookup(i)}return t},_nextNodeForArr:function(e){for(var t=Math.max(0,e.length-(this.N-1)),i=this.root.lookup(e[t++]),n=t;n<e.length;n++)i&&(i=i.lookup(e[n]));return i?i.selectChild(null,!0):null},_nextNodeForNode:function(e){for(var t,i=0,n=0,r=e.childNodes(),s=1e3;;){n=0,t=Math.random();for(var a=0,o=r.length;a<o;a++)if(n+=r[a].probability(),(!e.isRoot()||!this.isSentenceAware||r[a].isSentenceStart)&&t<n)return r[a];i++,warn("Prob. miss (#'+attempts+') in RiMarkov.nextNode(). Make sure there are a sufficient\n       # of sentences in the model that are longer than 'minSentenceLength'"),i==s&&err("PROB. MISS"+e+" total="+n+" selector="+t)}},_clean:function(e){return RiTa.trim(e.replace(/\s+/,SP))},_onGenerationIncomplete:function(e,t){warn(BN+"RiMarkov failed to complete after "+e+" tries and "+t+" successful generations. You may need to add more text to the model..."+BN)},_loadSentences:function(e,t,i){var n,r,s,a,o=[],u=RiTa.splitSentences(e),l=Math.round(t||1);for(n=0;n<u.length;n++)if(a=RiTa.tokenize(this._clean(u[n])),this._validSentenceStart(a[0]))for(o.push(SSDLM+a[0]),r=1;r<a.length;r++)o.push(a[r]);else this.printIgnoredText&&warn("Skipping (bad sentence start): "+a);for(n=0;n<o.length;n++){for(s=[],r=0;r<this.N;r++)n+r<o.length&&(s[r]=o[n+r]);for(r=0;r<l;r++)this._addSentenceSequence(s);!i||n%1e4||printProgress("Building model: ",parseInt(n/o.length*1e3)/10)}return i&&printProgress("Building model: ",100,0),this.root.count+=o.length,this},size:function(){return this.root.count},_validSentenceStart:function(e){return!this.isSentenceAware||e&&e.match(SSRE)},_addSentenceSequence:function(e){for(var t=this.root,i=0;i<e.length;i++)if(e[i]&&t.token){var n=e[i];if(startsWith(n,SSDLM)){n=n.substring(SSDLM.length);var r=t;t=t.addChild(n,1),t.isSentenceStart=!0,r.isRoot()&&this.sentenceStarts.push(t.token)}else t=t.addChild(n,1)}},_getSentenceStart:function(){return this.isSentenceAware||err("getSentenceStart() can only be called when the model is in 'sentence-aware' mode..."),this.sentenceStarts&&this.sentenceStarts.length||err("No sentence starts found! genSen="+this.isSentenceAware),this.root.lookup(RiTa.randomItem(this.sentenceStarts))},_findNode:function(e){if(!e||!is(e,A)||!e.length)return null;var t=this.N,i=(Math.min(e.length,t-1),Math.max(0,e.length-(t-1))),n=this.root.lookup(e[i++]);if(!n)return null;var r=0,s=[];s[r++]=n;for(var a=i;a<e.length;a++){if(n=n.lookup(e[a]),!n)return null;s[r++]=n}return s?s[s.length-1]:null}};var RiWordNet=function(){throw Error("RiWordNet is not yet implemented in JavaScript!")},RiString=makeClass();RiString._phones={consonants:["b","ch","d","dh","f","g","hh","jh","k","l","m","n","ng","p","r","s","sh","t","th","v","w","y","z","zh"],vowels:["aa","ae","ah","ao","aw","ax","ay","eh","er","ey","ih","iy","ow","oy","uh","uw"],onsets:["p","t","k","b","d","g","f","v","th","dh","s","z","sh","ch","jh","m","n","r","l","hh","w","y","p r","t r","k r","b r","d r","g r","f r","th r","sh r","p l","k l","b l","g l","f l","s l","t w","k w","d w","s w","s p","s t","s k","s f","s m","s n","g w","sh w","s p r","s p l","s t r","s k r","s k w","s k l","th w","zh","p y","k y","b y","f y","hh y","v y","th y","m y","s p y","s k y","g y","hh w",""],digits:["z-ih-r-ow","w-ah-n","t-uw","th-r-iy","f-ao-r","f-ay-v","s-ih-k-s","s-eh1-v-ax-n","ey-t","n-ih-n"]},RiString._syllabify=function(e){for(var t,i,n=function(e){var t,i,n=[];for(t=0;t<e.length;t++){var r=e[t],s=r[0][0],a=r[1],o=r[2],u=r[3];s!==undefined&&o.length&&(o[0]+=E+s);var l=[];for(i=0;i<a.length;i++)l.push(a[i]);for(i=0;i<o.length;i++)l.push(o[i]);for(i=0;i<u.length;i++)l.push(u[i]);n.push(l.join("-"))}return n.join(SP)},r=[],s=[],a="string"==typeof e?e.split("-"):e,o=0;o<a.length;o++){var u=a[o].trim(),l=i;if(u.length)if(isNum(last(u))&&(l=parseInt(last(u)),u=u.substring(0,u.length-1)),t&&log(o+")"+u+" stress="+l+" inter="+r.join(":")),inArray(RiString._phones.vowels,u)){for(var c=i,h=i,p=0;p<r.length+1;p++){c=r.slice(0,p),h=r.slice(p,r.length),t&&log("  "+p+") onset="+h.join(":")+"  coda="+c.join(":")+"  inter="+r.join(":"));var d=inArray(RiString._phones.onsets,h.join(" "));if(d||0===s.length||0===h.length){t&&log("  break "+u);break}}s.length>0&&(extend(s[s.length-1][3],c),t&&log("  tack: "+c+" -> len="+s[s.length-1][3].length+" ["+s[s.length-1][3]+"]"));var g=[[l],h,[u],[]];s.push(g),r=[]}else{if(!inArray(RiString._phones.consonants,u)&&" "!=u)throw Error("Invalid phoneme: "+u);
  r.push(u)}}return r.length>0&&(0===s.length?s.push([[i],r,[],[]]):extend(s[s.length-1][3],r)),n(s)},RiString.prototype={init:function(e){is(e,N)&&(e=String.fromCharCode(e)),e=e||"",this.x=0,this.y=0,this.z=0,this._text=e,this._features=undefined},copy:function(){var e=RiString(this._text),t=this.features();if(t){e._features={};for(var i in t)e._features[i]=t[i]}return e},features:function(){return this._features||this.analyze(),this._features},analyze:function(){var e,t,i,n,r,s=E,a=E,o=E,u="/",l="-",c=RiTa.tokenize(this._text),h=RiTa.lexicon;this._features||initFeatureMap(this),this._features.tokens=c.join(SP),this._features.pos=RiTa.getPosTags(this._text).join(SP);for(var p=0,d=c.length;p<d;p++){if(r=!1,t=h._getRawPhones(c[p]),t||(i=h._letterToSound(),n=i&&i.getPhones(c[p]),n&&n.length>0?(c[p].match(/[a-zA-Z]+/)&&log("[RiTa] Used LTS-rules for '"+c[p]+"'"),t=RiString._syllabify(n)):(t=c[p],r=!0)),s+=t.replace(/[0-2]/g,E).replace(/ /g,l)+SP,a+=t.replace(/ /g,u).replace(/1/g,E)+SP,r)o+=c[p];else{e=t.split(SP);for(var g=0;g<e.length;g++)e[g].length&&(o+=e[g].indexOf(RiTa.STRESSED)>-1?RiTa.STRESSED:RiTa.UNSTRESSED,g<e.length-1&&(o+=u))}endsWith(o,SP)||(o+=SP)}return o=o.trim(),s=s.trim().replace(/\\s+/,SP),a=a.trim().replace(/\\s+/,SP),this._features.stresses=o,this._features.phonemes=s,this._features.syllables=a,this},get:function(e){this._features||this.analyze();var t=this._features[e];return!t&&FEATURES.indexOf(e)>-1&&!this._features.hasOwnProperty(e)&&(this.analyze(),t=this._features[e]),t},set:function(e,t){return this._features||(this._features={}),this._features[e]=t,this},endsWith:function(e){return endsWith(this._text,e)},equals:function(e){return is(e.text,F)&&e.text()===this._text},equalsIgnoreCase:function(e){return typeof e===S?e.toLowerCase()===this._text.toLowerCase():e.text().toLowerCase()===this._text.toLowerCase()},text:function(e){return arguments.length>0?(this._text=e,initFeatureMap(this),this):this._text},pos:function(){for(var e=RiTa.tokenize(this._text),t=PosTagger.tag(e),i=0,n=t.length;i<n;i++)strOk(t[i])||err("RiString: can't parse pos for:"+e[i]);return t},posAt:function(e){var t=this.pos();return t&&t.length?t[Math.min(e<0?t.length+e:e,t.length-1)]:E},wordAt:function(e){var t=this.words();return e<0||e>=t.length?E:t[e]},wordCount:function(){return this._text.length?this.words().length:0},words:function(){return RiTa.tokenize(this._text)},indexOf:function(e,t){return this._text.indexOf(e,t)},lastIndexOf:function(e,t){return this._text.lastIndexOf(e,t)},length:function(){return this._text.length},match:function(e){return this._text.match(e)||[]},slice:function(e,t){return this._text.slice(e,t)||E},insertChar:function(e,t){var i=this.text();if(e>i.length||e<-i.length)return warn("RiString.insertChar: bad index="+e),this;e=e<0?e+=i.length:e;var n=i.substring(0,e),r=i.substring(e);return t&&(n+=t),this.text(n+r)},removeChar:function(e){var t=this.text();return e>t.length||e<-t.length?(warn("RiString.removeChar: bad index="+e),this):(e=e<0?e+=t.length:e,this.text(this._text.substring(0,e).concat(this._text.substring(e+1))),this)},replaceChar:function(e,t){var i=this.text();if(e>i.length||e<-i.length)return warn("RiString.replaceChar: bad index="+e),this;e=e<0?e+=i.length:e,i=this.text();var n=i.substring(0,e),r=i.substring(e+1);return t&&(n+=t),this.text(n+r)},replaceFirst:function(e,t){if(e&&!is(e,S)&&e.global){var i="";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.sticky&&(i+="y"),e=new RegExp(e.source,i)}return this._text=this._text.replace(e,t),this},replaceAll:function(e,t){var i="g";return e&&(t||""===t)&&(!is(e,S)&&e.source?(e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.sticky&&(i+="y"),e=e.source):e=escapeRegExp(e),this._text=this._text.replace(new RegExp(e,i),t)),this},removeWord:function(e){return this.replaceWord(e,E)},insertWord:function(e,t){var i=this.words();return e<0&&(e+=i.length),t&&t.length>=0&&e>=0&&e<i.length&&(i[e]=t+SP+i[e],this.text(RiTa.untokenize(i))),this},toCharArray:function(){return this._text.split(RiTa.E)},replaceWord:function(e,t){var i=this.words();return e<0&&(e+=i.length),(t||t===E)&&e>=0&&e<i.length&&(i[e]=t,this.text(RiTa.untokenize(i))),this},split:function(e,t){for(var i=this._text.split(e,t),n=[],r=0;r<i.length;r++)i[r]&&n.push(new RiString(i[r]));return n},startsWith:function(e){return 0===this.indexOf(e)},substr:function(e,t){return this._text.substr(e,t)},substring:function(e,t){return this._text.substring(e,t)},toLowerCase:function(){return this.text(this._text.toLowerCase())},toString:function(){return"["+this._text+"]"},toUpperCase:function(){return this.text(this._text.toUpperCase())},trim:function(){return this.text(trim(this._text))},charAt:function(e){return this._text.charAt(e)},concat:function(e){return this._text.concat(e.text())}};var RiGrammar=makeClass(),OR_PATT=/\s*\|\s*/,STRIP_TICKS=/`([^`]*)`/g,PROB_PATT=/(.*[^\s])\s*\[([0-9.]+)\](.*)/;RiGrammar.START_RULE="<start>",RiGrammar.EXEC_PATT=/(.*?)(`[^`]+?\(.*?\);?`)(.*)/,RiGrammar.prototype={init:function(e){this._rules={},this.execDisabled=!1,e&&(is(e,S)||is(e,O)&&typeof e.loadStrings!==F)&&this.load(e)},ready:function(e){return okeys(this._rules).length>0},loadFrom:function(e,t){RiTa.loadStrings(e,function(e){e=e.join(BN),this.load(e),is(t,F)&&t(e)}.bind(this))},load:function(e){if(this.reset(),is(e,S)){if("undefined"!=typeof YAML)try{e=YAML.parse(e)}catch(t){warn("YAML parsing failed, trying JSON")}if(!is(e,O))try{e=JSON.parse(e)}catch(t){var i=t}}if(!i&&is(e,O)){for(var n in e)this.addRule(n,e[n]);return this}if("undefined"!=typeof YAML)err("Grammar appears to be invalid JSON/YAML, please check it! (http://jsonlint.com/ or http://yamllint.com/)",e);else{var r=RiTa.env()===RiTa.NODE,s=r?"require":"include",a=r?"YAML = require('yamljs')":'<scrript src="yaml.min.js"></scrript>';errrrr("Grammar appears to be invalid JSON, please check it at http://jsonlint.com/. If you are using YAML, be sure to "+s+" yamljs (https://github.com/jeremyfa/yaml.js), e.g. "+a,e)}},addRule:function(e,t,i){var n=!1;i=i||1,n&&log('addRule: "'+e+'" : "'+t+'"       ['+get(t)+"]");var r=t;is(t,A)||(r=t.split(OR_PATT));for(var s=0;s<r.length;s++){var a=r[s],o=i,u=PROB_PATT.exec(a);if(u){if(n)for(log("Found weight for "+a),s=0;s<u.length;s++)log("  "+s+") '"+u[s]+"'");a=u[1]+u[3],o=u[2],n&&log("weight="+o+" rule='"+a+"'")}if(this.hasRule(e)){n&&log("rule exists");var l=this._rules[e];l[a]=o}else{var c={};c[a]=o,this._rules[e]=c,n&&log("added rule: "+e)}}return this},removeRule:function(e){return delete this._rules[e],this},reset:function(){return this._rules={},this},doRule:function(e){var t=function(e){var t,i,n=!1,r=Math.random(),s=0;n&&log("getStochasticRule("+e+")");for(t in e)s+=parseFloat(e[t]);n&&log("total="+s+"p="+r);for(t in e){n&&log("  name="+t);var a=e[t]/s;if(n&&log("amt="+a),r<a){i=t,n&&log("hit!="+t);break}r-=a}return i},i=0,n=E,r=this._rules[e];if(!r)return null;for(n in r)i++;return i?1==i?n:t(r):null},getGrammar:function(){var e=E;for(var t in this._rules){e+=t+BN;var i=this._rules[t];for(var n in i)e+="  '"+n+"' ["+i[n]+"]"+BN}return RiTa.chomp(e)},print:function(){if(console){var e="\n------------------------------";console.log(e+BN+this.getGrammar()+e)}return this},hasRule:function(e){return"undefined"!=typeof this._rules[e]},expandWith:function(e,t){var i,n=function(e){var t=RiGrammar();for(var i in e._rules)t._rules[i]=e._rules[i];return t},r=n(this),s=!1;for(i in r._rules)if(i===t){var a={};a[e]=1,r._rules[i]=a,s=!0}s||err("Rule '"+t+"' not found in grammar");var o,u=1e3;for(o=0;o<u;o++){var l=r.expand();if(l.indexOf(e)>-1)return l}err("RiGrammar failed to complete after "+o+" tries"+BN)},expand:function(e){return this.expandFrom(RiGrammar.START_RULE,e)},expandFrom:function(rule,context){var expandRule=function(e,t){var i,n,r,s,a,o=0;o&&log("expandRule("+t+")");for(var u in e._rules)if(i=e._rules[u],o&&log("  name="+u+"  entry="+JSON.stringify(i)+"  prod="+t+(n?"  idx="+n:"")),n=t.indexOf(u),n>=0)return o&&log("matched: "+u),r=t.substring(0,n)||E,s=e.doRule(u)||E,a=t.substring(n+u.length)||E,o&&log("  pre="+r+"  expanded="+s+"  post="+a+"  result="+r+s+a),r+s+a;return null},Scope=function(context){"use strict";if(this.names=[],this.eval=function(s){return eval(s)},this.put=function(e,t){var i="(function() {\n";i+="var "+e+" = "+t+";\n",i+="return function(str) {return eval(str)};\n})()",this.eval=this.eval(i),this.names.push(e)},context){var scope=this;"function"==typeof context?scope.put(context.name,context):"object"==typeof context&&okeys(context).forEach(function(e){"function"==typeof context[e]&&scope.put(e,context[e])})}},handleExec=function(input,context){if(!input||!input.length)return null;var res,exec=input.replace(STRIP_TICKS,"$1");try{return res=eval(exec),res?res+E:null}catch(e){if(context)try{return res=new Scope(context).eval(exec),res?res+"":null}catch(e){}}return input},countTicks=function(e){for(var t=0,i=0;i<e.length;i++)"`"==e.charAt(i)&&t++;return t};okeys(this._rules).length||err("(RiGrammar) No grammar rules found!"),this.hasRule(rule)||err("Rule not found: "+rule+BN+"Rules:"+BN+JSON.stringify(this._rules));for(var parts,theCall,callResult,tries=0,maxIterations=1e3;++tries<maxIterations;){var next=expandRule(this,rule);if(next&&next.length)rule=next;else{if(this.execDisabled)break;if(parts=RiGrammar.EXEC_PATT.exec(rule),!parts||!parts.length)break;if(parts.length>2){if(theCall=parts[2],2!=countTicks(theCall))return warn("Unable to parse recursive exec: "+theCall+"..."),null;if(callResult=handleExec(theCall,context),!callResult)break;rule=parts[1]+callResult,parts.length>3&&(rule+=parts[3])}}}return tries>=maxIterations&&log("[WARN] max number of iterations reached: "+maxIterations),RiTa.unescapeHTML(rule)}};var callbacksDisabled=!1,RiTaEvent=makeClass();RiTaEvent.ID=0,RiTaEvent.prototype={init:function(e,t,i){is(e,O)||ok(e,S),this._id=++RiTaEvent.ID,this._data=i,this._source=e,this._type=t||RiTa.UNKNOWN},toString:function(){var e="RiTaEvent[#"+this._id+" type=("+this._type+") source="+this._source.toString();return e+=this._data?" data-length="+this._data.toString().length:e+=" data=null",e+"]"},isType:function(e){return this._type===e},_fire:function(e){if(e=e||window.onRiTaEvent,e&&is(e,F))try{return e(this),this}catch(t){callbacksDisabled=!0;var i="RiTaEvent: error calling '"+e+"': "+t;throw is(e,S)&&(i+=" Callback must be a function in JS!"),warn(i),t}}};var StringTokenizer=makeClass();StringTokenizer.prototype={init:function(e,t){this.idx=0,this.text=e,this.delim=t||" ",this.tokens=e.split(t)},nextToken:function(){return this.idx<this.tokens.length?this.tokens[this.idx++]:null}};var TextNode=makeClass();TextNode.prototype={init:function(e,t){this.count=0,this.children={},this.parent=e,this.token=t},pathFromRoot:function(e){for(var t=this;;){if(t.isRoot())break;e.push(t.token),t=t.parent}},selectChild:function(e,t){var i=t||!0;return this.children?this._select(this.childNodes(e),i):null},_select:function(e,t){if(!e)throw TypeError("bad arg to '_select()'");return t=t||!1,t?this._probabalisticSelect(e):e[Math.floor(Math.random()*e.length)]},_probabalisticSelect:function(e){if(!e)throw TypeError("bad arg to '_probabalisticSelect()'");if(!e.length)return null;if(1==e.length)return e[0];for(var t=0,i=Math.random(),n=0;n<e.length;n++)if(t+=e[n].probability(),i<t)return e[n];err("Invalid State in RiTa.probabalisticSelect()")},addChild:function(e,t){t=t||1;var i=this.children[e];return i?i.count++:(i=new TextNode(this,e),i.count=t,this.children[e]=i),i},asTree:function(e){var t=this.token+" ";return this.isRoot()||(t+="("+this.count+")->"),t+="{",this.isLeaf()?t+"}":this.childrenToString(this,t,1,e)},isRoot:function(){return!this.parent},isLeaf:function(){return 0===this.childCount()},probability:function(){return this.count/this.siblingCount()},childNodes:function(e){if(!this.children)return EA;e=is(e,S)?new RegExp(e):e;var t=[];for(var i in this.children){var n=this.children[i];(!e||n&&n.token&&n.token.search(e)>-1)&&t.push(n)}return t},siblingCount:function(){return this.parent||err("Illegal siblingCount on ROOT!"),this.parent.childCount()},childCount:function(){if(!this.children)return 0;var e=0;for(var t in this.children)t&&this.children[t]&&(e+=this.children[t].count);return e},lookup:function(e){return e?(e=typeof e!=S&&e.token?e.token:e,e?this.children[e]:null):null},childrenToString:function(e,t,i,n){var r,s,a,o=e,u=[],l=null,c=BN;n=n||!1;for(a in e.children)u.push(e.children[a]);if(!u.length)return t;for(n&&u.sort(),s=0;s<i;s++)c+="  ";for(r=0;r<u.length&&(l=u[r],l);r++){var h=l.token;h&&(h==BN&&(h="\\n"),"\r"==h&&(h="\\r"),"\t"==h&&(h="\\t"),"\r\n"==h&&(h="\\r\\n")),t+=c+"'"+h+"'",l.count||err("ILLEGAL FREQ: "+l.count+" -> "+o.token+","+l.token),l.isRoot()||(t+=" ["+l.count+",p="+l.probability().toFixed(3)+"]->{"),l.children?t=this.childrenToString(l,t,i+1,n):t+="}"}for(c=BN,s=0;s<i-1;s++)c+="  ";return t+c+"}"},toString:function(){return"[ "+this.token+" ("+this.count+"/"+this.probability().toFixed(3)+"%)]"}};var Conjugator=makeClass();Conjugator.prototype={init:function(){this.perfect=this.progressive=this.passive=this.interrogative=!1,this.tense=RiTa.PRESENT_TENSE,this.person=RiTa.FIRST_PERSON,this.number=RiTa.SINGULAR,this.form=RiTa.NORMAL},conjugate:function(e,t){var i,n,r,s,a,o=[];if(!e||!e.length)return E;if(!t)return e;if(i=e.toLowerCase(),"am"!==i&&"are"!==i&&"is"!==i&&"was"!==i&&"were"!==i||(i="be"),s=i,t.number&&(this.number=t.number),t.person&&(this.person=t.person),t.tense&&(this.tense=t.tense),t.form&&(this.form=t.form),t.passive&&(this.passive=t.passive),t.progressive&&(this.progressive=t.progressive),t.interrogative&&(this.interrogative=t.interrogative),t.perfect&&(this.perfect=t.perfect),this.form==RiTa.INFINITIVE&&(r="to"),this.tense==RiTa.FUTURE_TENSE&&(r="will"),this.passive&&(o.push(this.getPastParticiple(s)),s="be"),this.progressive&&(o.push(this.getPresentParticiple(s)),s="be"),this.perfect&&(o.push(this.getPastParticiple(s)),s="have"),r&&(o.push(s),s=null),s)if(this.form===RiTa.GERUND){var u=this.getPresentParticiple(s);o.push(u)}else this.interrogative&&"be"!=s&&o.length<1?o.push(s):(a=this.getVerbForm(s,this.tense,this.person,this.number),o.push(a));r&&o.push(r),n=E;for(var l=0;l<o.length;l++)n=o[l]+" "+n;return endsWith(n,"peted")&&err("Unexpected output: "+this.toString()),trim(n)},checkRules:function(e,t){var i,n=(e.name,e.rules),r=e.defaultRule;if(n||err("no rule: "+e.name+" of "+t),inArray(MODALS,t))return t;for(var s=0;s<n.length;s++)if(n[s].applies(t)){var a=n[s].fire(t);return a}return e.doubling&&inArray(VERB_CONS_DOUBLING,t)&&(t=this.doubleFinalConsonant(t)),i=r.fire(t)},doubleFinalConsonant:function(e){return e+e.charAt(e.length-1)},getPast:function(e,t,i){if("be"==e.toLowerCase())switch(i){case RiTa.SINGULAR:switch(t){case RiTa.FIRST_PERSON:break;case RiTa.THIRD_PERSON:return"was";case RiTa.SECOND_PERSON:return"were"}break;case RiTa.PLURAL:return"were"}return this.checkRules(PAST_TENSE_RULESET,e)},getPresent:function(e,t,i){if(t=t||this.person,i=i||this.number,t==RiTa.THIRD_PERSON&&i==RiTa.SINGULAR)return this.checkRules(PRESENT_TENSE_RULESET,e);if("be"==e){if(i!=RiTa.SINGULAR)return"are";switch(t){case RiTa.FIRST_PERSON:return"am";case RiTa.SECOND_PERSON:return"are";case RiTa.THIRD_PERSON:return"is"}}return e},getPresentParticiple:function(e){return strOk(e)?this.checkRules(PRESENT_PARTICIPLE_RULESET,e):E},getPastParticiple:function(e){return strOk(e)?this.checkRules(PAST_PARTICIPLE_RULESET,e):E},getVerbForm:function(e,t,i,n){switch(t){case RiTa.PRESENT_TENSE:return this.getPresent(e,i,n);case RiTa.PAST_TENSE:return this.getPast(e,i,n)}return e},toString:function(){return"  ---------------------"+BN+"  Passive = "+this.passive+BN+"  Perfect = "+this.perfect+BN+"  Progressive = "+this.progressive+BN+"  ---------------------"+BN+"  Number = "+this.number+BN+"  Person = "+this.person+BN+"  Tense = "+this.tense+BN+"  ---------------------"+BN}};var PosTagger={NOUNS:["nn","nns","nnp","nnps"],VERBS:["vb","vbd","vbg","vbn","vbp","vbz"],ADJ:["jj","jjr","jjs"],ADV:["rb","rbr","rbs","rp"],DBUG:0,isVerb:function(e){return inArray(this.VERBS,e)},isNoun:function(e){return inArray(this.NOUNS,e)},isAdverb:function(e){return inArray(this.ADV,e)},isAdj:function(e){return inArray(this.ADJ,e)},hasTag:function(e,t){ok(e,A);var i=e.join();return i.indexOf(t)>-1},tag:function(e){var t=[],i=[],n=RiTa.lexicon;e=is(e,A)?e:[e];for(var r=0,s=e.length;r<s;r++)if(e[r].length<1)t.push(E);else if(1!=e[r].length){var a=n&&n._getPosArr(e[r]);if(a.length)t.push(a[0]),i[r]=a;else{i[r]=[];var o="nn";if(endsWith(e[r],"s")&&(o="nns"),RiTa.SILENT||(RiTa.LEX_WARN&&n.size()<=1e3&&(warn(RiTa.LEX_WARN),RiTa.LEX_WARN=!1),RiTa.LTS_WARN&&"undefined"==typeof LetterToSound&&(warn(RiTa.LTS_WARN),RiTa.LTS_WARN=!1)),endsWith(e[r],"s")){var u,l=e[r].substring(0,e[r].length-1);if(endsWith(e[r],"es")&&(u=e[r].substring(0,e[r].length-2)),this._lexHas("n",l)||u&&this._lexHas("n",u))i.push("nns");else{var c=RiTa.singularize(e[r]);this._lexHas("n",c)&&i.push("nns")}}else{var c=RiTa.singularize(e[r]);this._lexHas("n",c)?(i.push("nns"),o="nns"):checkPluralNoLex(e[r])&&(o="nns")}t.push(o)}}else t.push(this._handleSingleLetter(e[r]));return this._applyContext(e,t,i)},_handleSingleLetter:function(e){var t=e;return"a"===e||"A"===e?t="dt":"I"===e?t="prp":e>="0"&&e<="9"&&(t="cd"),t},_ct:function(e,t,i){this.DBUG&&console.log("\n  Custom("+e+") tagged '"+t+"' -> '"+i+"'\n\n")},_applyContext:function(e,t,i){this.DBUG&&console.log("ac("+e+","+t+","+i+")");for(var n=startsWith,r=endsWith,s=0,a=e.length;s<a;s++){var o=e[s],u=t[s];s>0&&"dt"==t[s-1]&&(n(u,"vb")?(u="nn",o.match(/^.*[^s]s$/)&&(NULL_PLURALS.applies(o)||(u="nns")),this._ct("1a",o,u)):n(u,"rb")&&(u=u.length>2?"jj"+u.charAt(2):"jj",this._ct("1b",o,u))),n(u,"n")&&!i[s]&&isNum(o)&&(u="cd"),s>0&&n(u,"n")&&r(o,"ed")&&!r(o,"eed")&&t[s-1].match(/^(nn|prp)$/)&&(u="vbn"),r(o,"ly")&&(u="rb"),n(u,"nn")&&r(o,"al")&&"mammal"!=o&&(u="jj"),s>0&&n(u,"nn")&&n(t[s-1],"md")&&(u="vb"),n(u,"nn")&&r(o,"ing")&&this.hasTag(i[s],"vb")&&(u="vbg",this._ct(8,o,u)),s>0&&"nns"==u&&this.hasTag(i[s],"vbz")&&t[s-1].match(/^(nn|prp|nnp)$/)&&(u="vbz",this._ct(9,o,u)),n(u,"nn")&&o.charAt(0)===o.charAt(0).toUpperCase()&&(0!=s||1===e.length||0==s&&!this._lexHas("nn",RiTa.singularize(o).toLowerCase()))&&(u=r(u,"s")?"nnps":"nnp",this._ct(10,o,u)),s<t.length-1&&"nns"==u&&n(t[s+1],"rb")&&this.hasTag(i[s],"vbz")&&(u="vbz",this._ct(11,o,u)),"nns"===u&&(s>0&&["nn","prp","cc","nnp"].indexOf(t[s-1])>-1?this._lexHas("vb",RiTa.singularize(o))&&(u="vbz",this._ct(12,o,u)):1!==e.length||i[s].length||!this._lexHas("nn",RiTa.singularize(o))&&this._lexHas("vb",RiTa.singularize(o))&&(u="vbz",this._ct(12,o,u))),("vb"===u||"nn"===u&&this.hasTag(i[s],"vb"))&&s>0&&t[s-1].match(/^(nns|nnps|prp)$/)&&(u="vbp",this._ct(13,o,u)),t[s]=u}return t},_lexHas:function(e,t){for(var t=is(t,A)||[t],i=0;i<t.length;i++)if(RiTa.lexicon.containsWord(t[i])){if(null==e)return!0;for(var n=RiTa.lexicon._getPosArr(t[i]),r=0;r<n.length;r++)if("n"===e&&PosTagger.isNoun(n[r])||"v"===e&&PosTagger.isVerb(n[r])||"r"===e&&PosTagger.isAdverb(n[r])||"a"===e&&PosTagger.isAdj(n[r])||e===n[r])return!0}}};RiTa.stemmers.Porter=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},i="[^aeiou]",n="[aeiouy]",r=i+"[^aeiouy]*",s=n+"[aeiou]*",a="^("+r+")?"+s+r,o="^("+r+")?"+s+r+"("+s+")?$",u="^("+r+")?"+s+r+s+r,l="^("+r+")?"+n;return function(i){var s,c,h,p,d,g,f,R;return i.length<3?i:(p=i.substr(0,1),"y"==p&&(i=p+i.substr(1)),d=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,d.test(i)?i=i.replace(d,"$1$2"):g.test(i)&&(i=i.replace(g,"$1$2")),d=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,d.test(i)?(s=d.exec(i),d=new RegExp(a),d.test(s[1])&&(d=/.$/,i=i.replace(d,E))):g.test(i)&&(s=g.exec(i),c=s[1],g=new RegExp(l),g.test(c)&&(i=c,g=/(at|bl|iz)$/,f=new RegExp("([^aeiouylsz])\\1$"),R=new RegExp("^"+r+n+"[^aeiouwxy]$"),g.test(i)?i+="e":f.test(i)?(d=/.$/,i=i.replace(d,E)):R.test(i)&&(i+="e"))),d=/^(.+?)y$/,d.test(i)&&(s=d.exec(i),c=s[1],d=new RegExp(l),d.test(c)&&(i=c+"i")),d=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,d.test(i)&&(s=d.exec(i),c=s[1],h=s[2],d=new RegExp(a),d.test(c)&&(i=c+e[h])),d=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,d.test(i)&&(s=d.exec(i),c=s[1],h=s[2],d=new RegExp(a),d.test(c)&&(i=c+t[h])),d=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,g=/^(.+?)(s|t)(ion)$/,d.test(i)?(s=d.exec(i),c=s[1],d=new RegExp(u),d.test(c)&&(i=c)):g.test(i)&&(s=g.exec(i),c=s[1]+s[2],g=new RegExp(u),g.test(c)&&(i=c)),d=/^(.+?)e$/,d.test(i)&&(s=d.exec(i),c=s[1],d=new RegExp(u),g=new RegExp(o),f=new RegExp("^"+r+n+"[^aeiouwxy]$"),(d.test(c)||g.test(c)&&!f.test(c))&&(i=c)),d=/ll$/,g=new RegExp(u),d.test(i)&&g.test(i)&&(d=/.$/,i=i.replace(d,E)),"y"==p&&(i=p.toLowerCase()+i.substr(1)),i)}}(),RiTa.stemmers.Lancaster=function(){function e(e){return e.match(/^[aeiou]/)?e.length>1:e.length>2&&e.match(/[aeiouy]/)}function t(n,r){var s=n.substr(-1),a=i[s];if(a)for(var o=0;o<a.length;o++)if((r||!a[o].intact)&&n.substr(0-a[o].pattern.length)==a[o].pattern){var u=n.substr(0,n.length-a[o].size);if(a[o].appendage&&(u+=a[o].appendage),e(u))return n=u,a[o].continuation?t(u,!1):u}return n}var i={a:[{continuation:!1,intact:!0,pattern:"ia",size:"2"},{continuation:!1,intact:!0,pattern:"a",size:"1"}],b:[{continuation:!1,intact:!1,pattern:"bb",size:"1"}],c:[{appendage:"s",continuation:!1,intact:!1,pattern:"ytic",size:"3"},{continuation:!0,intact:!1,pattern:"ic",size:"2"},{appendage:"t",continuation:!0,intact:!1,pattern:"nc",size:"1"}],d:[{continuation:!1,intact:!1,pattern:"dd",size:"1"},{appendage:"y",continuation:!0,intact:!1,pattern:"ied",size:"3"},{appendage:"s",continuation:!1,intact:!1,pattern:"ceed",size:"2"},{continuation:!1,intact:!1,pattern:"eed",size:"1"},{continuation:!0,intact:!1,pattern:"ed",size:"2"},{continuation:!0,intact:!1,pattern:"hood",size:"4"}],e:[{continuation:!0,intact:!1,pattern:"e",size:"1"}],f:[{appendage:"v",continuation:!1,intact:!1,pattern:"lief",size:"1"},{continuation:!0,intact:!1,pattern:"if",size:"2"}],g:[{continuation:!0,intact:!1,pattern:"ing",size:"3"},{appendage:"y",continuation:!1,intact:!1,pattern:"iag",size:"3"},{continuation:!0,intact:!1,pattern:"ag",size:"2"},{continuation:!1,intact:!1,pattern:"gg",size:"1"}],h:[{continuation:!1,intact:!0,pattern:"th",size:"2"},{appendage:"c",continuation:!1,intact:!1,pattern:"guish",size:"5"},{continuation:!0,intact:!1,pattern:"ish",size:"3"}],i:[{continuation:!1,intact:!0,pattern:"i",size:"1"},{appendage:"y",continuation:!0,intact:!1,pattern:"i",size:"1"}],j:[{appendage:"d",continuation:!1,intact:!1,pattern:"ij",size:"1"},{appendage:"s",continuation:!1,intact:!1,pattern:"fuj",size:"1"},{appendage:"d",continuation:!1,intact:!1,pattern:"uj",size:"1"},{appendage:"d",continuation:!1,intact:!1,pattern:"oj",size:"1"},{appendage:"r",continuation:!1,intact:!1,pattern:"hej",size:"1"},{appendage:"t",continuation:!1,intact:!1,pattern:"verj",size:"1"},{appendage:"t",continuation:!1,intact:!1,pattern:"misj",size:"2"},{appendage:"d",continuation:!1,intact:!1,pattern:"nj",size:"1"},{appendage:"s",continuation:!1,intact:!1,pattern:"j",size:"1"}],l:[{continuation:!1,intact:!1,pattern:"ifiabl",size:"6"},{appendage:"y",continuation:!1,intact:!1,pattern:"iabl",size:"4"},{continuation:!0,intact:!1,pattern:"abl",size:"3"},{continuation:!1,intact:!1,pattern:"ibl",size:"3"},{appendage:"l",continuation:!0,intact:!1,pattern:"bil",size:"2"},{continuation:!1,intact:!1,pattern:"cl",size:"1"},{appendage:"y",continuation:!1,intact:!1,pattern:"iful",size:"4"},{continuation:!0,intact:!1,pattern:"ful",size:"3"},{continuation:!1,intact:!1,pattern:"ul",size:"2"},{continuation:!0,intact:!1,pattern:"ial",size:"3"},{continuation:!0,intact:!1,pattern:"ual",size:"3"},{continuation:!0,intact:!1,pattern:"al",size:"2"},{continuation:!1,intact:!1,pattern:"ll",size:"1"}],m:[{continuation:!1,intact:!1,pattern:"ium",size:"3"},{continuation:!1,intact:!0,pattern:"um",size:"2"},{continuation:!0,intact:!1,pattern:"ism",size:"3"},{continuation:!1,intact:!1,pattern:"mm",size:"1"}],n:[{appendage:"j",continuation:!0,intact:!1,pattern:"sion",size:"4"},{appendage:"c",continuation:!1,intact:!1,pattern:"xion",size:"4"},{continuation:!0,intact:!1,pattern:"ion",size:"3"},{continuation:!0,intact:!1,pattern:"ian",size:"3"},{continuation:!0,intact:!1,pattern:"an",size:"2"},{continuation:!1,intact:!1,pattern:"een",size:"0"},{continuation:!0,intact:!1,pattern:"en",size:"2"},{continuation:!1,intact:!1,pattern:"nn",size:"1"}],p:[{continuation:!0,intact:!1,pattern:"ship",size:"4"},{continuation:!1,intact:!1,pattern:"pp",size:"1"}],r:[{continuation:!0,intact:!1,pattern:"er",size:"2"},{continuation:!1,intact:!1,pattern:"ear",size:"0"},{continuation:!1,intact:!1,pattern:"ar",size:"2"},{continuation:!0,intact:!1,pattern:"or",size:"2"},{continuation:!0,intact:!1,pattern:"ur",size:"2"},{continuation:!1,intact:!1,pattern:"rr",size:"1"},{continuation:!0,intact:!1,pattern:"tr",size:"1"},{appendage:"y",continuation:!0,intact:!1,pattern:"ier",size:"3"}],s:[{appendage:"y",continuation:!0,intact:!1,pattern:"ies",size:"3"},{continuation:!1,intact:!1,pattern:"sis",size:"2"},{continuation:!0,intact:!1,pattern:"is",size:"2"},{continuation:!0,intact:!1,pattern:"ness",size:"4"},{continuation:!1,intact:!1,pattern:"ss",size:"0"},{continuation:!0,intact:!1,pattern:"ous",size:"3"},{continuation:!1,intact:!0,pattern:"us",size:"2"},{continuation:!0,intact:!0,pattern:"s",size:"1"},{continuation:!1,intact:!1,pattern:"s",size:"0"}],t:[{appendage:"y",continuation:!1,intact:!1,pattern:"plicat",size:"4"},{continuation:!0,intact:!1,pattern:"at",size:"2"},{continuation:!0,intact:!1,pattern:"ment",size:"4"},{continuation:!0,intact:!1,pattern:"ent",size:"3"},{continuation:!0,intact:!1,pattern:"ant",size:"3"},{appendage:"b",continuation:!1,intact:!1,pattern:"ript",size:"2"},{appendage:"b",continuation:!1,intact:!1,pattern:"orpt",size:"2"},{continuation:!1,intact:!1,pattern:"duct",size:"1"},{continuation:!1,intact:!1,pattern:"sumpt",size:"2"},{appendage:"i",continuation:!1,intact:!1,pattern:"cept",size:"2"},{appendage:"v",continuation:!1,intact:!1,pattern:"olut",size:"2"},{continuation:!1,intact:!1,pattern:"sist",size:"0"},{continuation:!0,intact:!1,pattern:"ist",size:"3"},{continuation:!1,intact:!1,pattern:"tt",size:"1"}],u:[{continuation:!1,intact:!1,pattern:"iqu",size:"3"},{continuation:!1,intact:!1,pattern:"ogu",size:"1"}],v:[{appendage:"j",continuation:!0,intact:!1,pattern:"siv",size:"3"},{continuation:!1,intact:!1,pattern:"eiv",size:"0"},{continuation:!0,intact:!1,pattern:"iv",size:"2"}],y:[{continuation:!0,intact:!1,pattern:"bly",size:"1"},{appendage:"y",continuation:!0,intact:!1,pattern:"ily",size:"3"},{continuation:!1,intact:!1,pattern:"ply",size:"0"},{continuation:!0,intact:!1,pattern:"ly",size:"2"},{continuation:!1,intact:!1,pattern:"ogy",size:"1"},{continuation:!1,intact:!1,pattern:"phy",size:"1"},{continuation:!1,intact:!1,pattern:"omy",size:"1"},{continuation:!1,intact:!1,pattern:"opy",size:"1"},{continuation:!0,intact:!1,pattern:"ity",size:"3"},{continuation:!0,intact:!1,pattern:"ety",size:"3"},{continuation:!1,intact:!1,pattern:"lty",size:"2"},{continuation:!1,intact:!1,pattern:"istry",size:"5"},{continuation:!0,intact:!1,pattern:"ary",size:"3"},{continuation:!0,intact:!1,pattern:"ory",size:"3"},{continuation:!1,intact:!1,pattern:"ify",size:"3"},{appendage:"t",continuation:!0,intact:!1,pattern:"ncy",size:"2"},{continuation:!0,intact:!1,pattern:"acy",size:"3"}],z:[{continuation:!0,intact:!1,pattern:"iz",size:"2"},{appendage:"s",continuation:!1,intact:!1,pattern:"yz",size:"1"}]};return function(e){return t(e.toLowerCase(),!0)}}();var categorySP=["acoustics","aesthetics","aquatics","basics","ceramics","classics","cosmetics","dialectics","deer","dynamics","ethics","harmonics","heroics","mechanics","metrics","optics","people","physics","polemics","pyrotechnics","quadratics","quarters","statistics","tactics","tropics"],categorySE_SES=["abuses","apocalypses","blouses","bruises","chaises","cheeses","chemises","clauses","corpses","courses","crazes","creases","cruises","curses","databases","dazes","defenses","demises","discourses","diseases","doses","eclipses","enterprises","expenses","friezes","fuses","glimpses","guises","hearses","horses","houses","impasses","impulses","kamikazes","mazes","mousses","noises","nooses","noses","nurses","obverses","offenses","overdoses","phrases","posses","premises","pretenses","proteases","pulses","purposes","purses","racehorses","recluses","recourses","relapses","responses","roses","ruses","spouses","stripteases","subleases","sunrises","tortoises","trapezes","treatises","universes","vases","verses","vises","wheelbases"],category00=["alias","asbestos","atlas","barracks","bathos","bias","breeches","britches","canvas","chaos","clippers","contretemps","corps","cosmos","crossroads","diabetes","ethos","gallows","gas","graffiti","headquarters","herpes","high-jinks","innings","jackanapes","lens","means","measles","mews","mumps","news","pathos","pincers","pliers","proceedings","rabies","rhinoceros","sassafras","scissors","series","shears","species","tuna"],categoryUM_A=["addenda","agenda","aquaria","bacteria","candelabra","compendia","consortia","crania","curricula","data","desiderata","dicta","emporia","enconia","errata","extrema","gymnasia","honoraria","interregna","lustra","maxima","media","memoranda","millenia","minima","momenta","optima","ova","phyla","quanta","rostra","spectra","specula","stadia","strata","symposia","trapezia","ultimata","vacua","vela"],categoryON_A=["aphelia","asyndeta","automata","criteria","hyperbata","noumena","organa","perihelia","phenomena","prolegomena","referenda"],categoryO_I=["alti","bassi","canti","contralti","crescendi","libretti","soli","soprani","tempi","virtuosi"],categoryUS_I=["alumni","bacilli","cacti","foci","fungi","genii","hippopotami","incubi","nimbi","nuclei","nucleoli","octopi","radii","stimuli","styli","succubi","syllabi","termini","tori","umbilici","uteri"],categoryIX_ICES=["appendices","cervices"],categoryIS_ES=["analyses","axes","bases","crises","diagnoses","ellipses","emphases","neuroses","oases","paralyses","prognoses","synopses"],categoryOE_OES=["aloes","backhoes","beroes","canoes","chigoes","cohoes","does","felloes","floes","foes","gumshoes","hammertoes","hoes","hoopoes","horseshoes","leucothoes","mahoes","mistletoes","oboes","overshoes","pahoehoes","pekoes","roes","shoes","sloes","snowshoes","throes","tic-tac-toes","tick-tack-toes","ticktacktoes","tiptoes","tit-tat-toes","toes","toetoes","tuckahoes","woes"],categoryEX_ICES=["apices","codices","cortices","indices","latices","murices","pontifices","silices","simplices","vertices","vortices"],categoryU_US=["menus","gurus","apercus","barbus","cornus","ecrus","emus","fondus","gnus","iglus","mus","nandus","napus","poilus","quipus","snafus","tabus","tamandus","tatus","timucus","tiramisus","tofus","tutus"],categorySSE_SSES=["bouillabaisses","coulisses","crevasses","crosses","cuisses","demitasses","ecrevisses","fesses","finesses","fosses","impasses","lacrosses","largesses","masses","noblesses","palliasses","pelisses","politesses","posses","tasses","wrasses"],categoryCHE_CHES=["adrenarches","attaches","avalanches","barouches","brioches","caches","caleches","caroches","cartouches","cliches","cloches","creches","demarches","douches","gouaches","guilloches","headaches","heartaches","huaraches","menarches","microfiches","moustaches","mustaches","niches","panaches","panoches","pastiches","penuches","pinches","postiches","psyches","quiches","schottisches","seiches","soutaches","synecdoches","thelarches","troches"],categoryICS=["aerobatics","aerobics","aerodynamics","aeromechanics","aeronautics","alphanumerics","animatronics","apologetics","architectonics","astrodynamics","astronautics","astrophysics","athletics","atmospherics","autogenics","avionics","ballistics","bibliotics","bioethics","biometrics","bionics","bionomics","biophysics","biosystematics","cacogenics","calisthenics","callisthenics","catoptrics","civics","cladistics","cryogenics","cryonics","cryptanalytics","cybernetics","cytoarchitectonics","cytogenetics","diagnostics","dietetics","dramatics","dysgenics","econometrics","economics","electromagnetics","electronics","electrostatics","endodontics","enterics","ergonomics","eugenics","eurhythmics","eurythmics","exodontics","fibreoptics","futuristics","genetics","genomics","geographics","geophysics","geopolitics","geriatrics","glyptics","graphics","gymnastics","hermeneutics","histrionics","homiletics","hydraulics","hydrodynamics","hydrokinetics","hydroponics","hydrostatics","hygienics","informatics","kinematics","kinesthetics","kinetics","lexicostatistics","linguistics","lithoglyptics","liturgics","logistics","macrobiotics","macroeconomics","magnetics","magnetohydrodynamics","mathematics","metamathematics","metaphysics","microeconomics","microelectronics","mnemonics","morphophonemics","neuroethics","neurolinguistics","nucleonics","numismatics","obstetrics","onomastics","orthodontics","orthopaedics","orthopedics","orthoptics","paediatrics","patristics","patristics","pedagogics","pediatrics","periodontics","pharmaceutics","pharmacogenetics","pharmacokinetics","phonemics","phonetics","phonics","photomechanics","physiatrics","pneumatics","poetics","politics","pragmatics","prosthetics","prosthodontics","proteomics","proxemics","psycholinguistics","psychometrics","psychonomics","psychophysics","psychotherapeutics","robotics","semantics","semiotics","semitropics","sociolinguistics","stemmatics","strategics","subtropics","systematics","tectonics","telerobotics","therapeutics","thermionics","thermodynamics","thermostatics"],categoryIE_IES=["aeries","anomies","aunties","baddies","beanies","birdies","bogies","bonhomies","boogies","bookies","booties","bourgeoisies","brasseries","brassies","brownies","caddies","calories","camaraderies","charcuteries","collies","commies","cookies","coolies","coonties","cooties","coteries","cowpies","cowries","cozies","crappies","crossties","curies","darkies","dearies","dickies","dies","dixies","doggies","dogies","eyries","faeries","falsies","floozies","folies","foodies","freebies","gendarmeries","genies","gillies","goalies","goonies","grannies","groupies","hankies","hippies","hoagies","honkies","indies","junkies","kelpies","kilocalories","laddies","lassies","lies","lingeries","magpies","magpies","mashies","mealies","meanies","menageries","mollies","moxies","neckties","newbies","nighties","nookies","oldies","panties","patisseries","pies","pinkies","pixies","porkpies","potpies","prairies","preemies","pyxies","quickies","reveries","rookies","rotisseries","scrapies","sharpies","smoothies","softies","stoolies","stymies","swaggies","sweeties","talkies","techies","ties","tooshies","toughies","townies","veggies","walkie-talkies","wedgies","weenies","yuppies","zombies"],categoryIRR=["blondes","blonde","teeth","tooth","beefs","beef","brethren","brother","busses","bus","cattle","cow","children","child","corpora","corpus","genera","genus","genies","genie","genii","genie","lice","louse","mice","mouse","mongooses","mongoose","monies","money","octopodes","octopus","oxen","ox","people","person","soliloquies","soliloquy","taxis","taxi","throes","throes","trilbys","trilby","innings","inning","alibis","alibi","skis","ski"];
  RiTa.stemmers.Pling=function(){function e(e,t){return e.substring(0,e.length-t.length)}function t(e){return e.indexOf("h")>0||e.indexOf("j")>0||e.indexOf("k")>0||e.indexOf("w")>0||e.indexOf("y")>0||e.indexOf("z")>0||e.indexOf("ou")>0||e.indexOf("sh")>0||e.indexOf("ch")>0||e._endsWith("aus")}function i(e){return e.indexOf("ph")>0||e.indexOf("y")>0&&e._endsWith("nges")}function n(n){if(categoryIRR._arrayContains(n)){var r,s=categoryIRR.indexOf(n);return s%2==0&&(r=categoryIRR[s+1]),r}return categoryON_A._arrayContains(n)?e(n,"a")+"on":categoryUM_A._arrayContains(n)?e(n,"a")+"um":categoryIX_ICES._arrayContains(n)?e(n,"ices")+"ix":categoryO_I._arrayContains(n)?e(n,"i")+"o":categorySE_SES._arrayContains(n)?e(n,"s"):categoryIS_ES._arrayContains(n)||n._endsWith("theses")?e(n,"es")+"is":categoryUS_I._arrayContains(n)?e(n,"i")+"us":n._endsWith("uses")&&(categoryUS_I._arrayContains(e(n,"uses")+"i")||"genuses"===n||"corpuses"===n)?e(n,"es"):categoryEX_ICES._arrayContains(n)?e(n,"ices")+"ex":n._endsWith("ois")||n._endsWith("itis")||category00._arrayContains(n)||categoryICS._arrayContains(n)?n:n._endsWith("ina")?e(n,"en"):n._endsWith("ae")&&"pleae"!==n?e(n,"e"):n._endsWith("ata")?e(n,"ta"):n._endsWith("trices")?e(n,"trices")+"trix":!n._endsWith("us")||n._endsWith("eaus")||n._endsWith("ieus")||t(n)||categoryU_US._arrayContains(n)?n._endsWith("teeth")?e(n,"teeth")+"tooth":n._endsWith("geese")?e(n,"geese")+"goose":n._endsWith("feet")?e(n,"feet")+"foot":n._endsWith("zoa")?e(n,"zoa")+"zoon":n._endsWith("men")?e(n,"men")+"man":n._endsWith("inis")?e(n,"inis")+"ini":n._endsWith("children")?e(n,"ren"):n._endsWith("eaux")?e(n,"x"):n._endsWith("ieux")?e(n,"x"):n._endsWith("nges")&&i(n)?e(n,"nges")+"nx":n._endsWith("shes")||n._endsWith("ches")&&!categoryCHE_CHES._arrayContains(n)?e(n,"es"):!n._endsWith("sses")||categorySSE_SSES._arrayContains(n)||n._endsWith("mousses")?n._endsWith("xes")&&"axes"!==n?e(n,"es"):n._endsWith("nives")||n._endsWith("lives")&&!n._endsWith("olives")||n._endsWith("wives")?e(n,"ves")+"fe":n._endsWith("alves")&&!n._endsWith("valves")||n._endsWith("olves")&&!n._endsWith("solves")||n._endsWith("eaves")&&!n._endsWith("heaves")&&!n._endsWith("weaves")||n._endsWith("arves")||n._endsWith("shelves")||n._endsWith("selves")?e(n,"ves")+"f":n._endsWith("ies")&&!categoryIE_IES._arrayContains(n)?e(n,"ies")+"y":n._endsWith("oes")&&!categoryOE_OES._arrayContains(n)?e(n,"es"):n._endsWith("ses")||n._endsWith("zes")?e(n,"es"):!n._endsWith("s")||n._endsWith("ss")||n._endsWith("is")?n:e(n,"s"):e(n,"es"):n}return function(e){return n(e.toLowerCase())}}(),Array.prototype._arrayContains=function(e){return this.indexOf(e)>-1},String.prototype._endsWith=function(e){return this.indexOf(e,this.length-e.length)!==-1};var MinEditDist={_min3:function(e,t,i){var n=e;return t<n&&(n=t),i<n&&(n=i),n},_computeRawArray:function(e,t){var i,n,r,s,a,o,u,l=[];if(!e.length)return t.length;if(!t.length)return e.length;for(s=0,o=e.length;s<=o;s++)l[s]=[],l[s][0]=s;for(a=0,u=t.length;a<=u;a++)l[0][a]=a;for(s=1,o=e.length;s<=o;s++)for(i=e[s-1],a=1,u=t.length;a<=u;a++)n=t[a-1],r=i===n?0:1,l[s][a]=this._min3(l[s-1][a]+1,l[s][a-1]+1,l[s-1][a-1]+r);return l[e.length][t.length]},computeRaw:function(e,t){if(is(e,A))return this._computeRawArray(e,t);if(!e.length&&!t.length)return 0;var i,n,r,s,a,o=[],u=e.length,l=t.length;if(!u)return l;if(!l)return u;for(i=0;i<=u;i++)o[i]=[],o[i][0]=i;for(n=0;n<=l;n++)o[0][n]=n;for(i=1;i<=u;i++)for(s=e.charAt(i-1),n=1;n<=l;n++)a=t.charAt(n-1),r=s==a?0:1,o[i][n]=this._min3(o[i-1][n]+1,o[i][n-1]+1,o[i-1][n-1]+r);return o[u][l]},computeAdjusted:function(e,t){var i=get(e),n=get(e);if(i===n){if(n===S)return e.length||t.length?this.computeRaw(e,t)/Math.max(e.length,t.length):0;if(n===A)return e.length||t.length?this._computeRawArray(e,t)/Math.max(e.length,t.length):0}err("Unexpected args: "+e+"/"+t)}},Concorder=makeClass();Concorder.prototype={init:function(e,t){this.model=null,this.wordsToIgnore=[],this.ignoreCase=!1,this.ignoreStopWords=!1,this.ignorePunctuation=!1,t&&(t.ignoreCase&&(this.ignoreCase=!0),t.ignoreStopWords&&(this.ignoreStopWords=!0),t.ignorePunctuation&&(this.ignorePunctuation=!0),t.wordsToIgnore&&(this.wordsToIgnore=t.wordsToIgnore)),this.ignoreStopWords&&(this.wordsToIgnore=this.wordsToIgnore.concat(RiTa.STOP_WORDS)),this.words=is(e,A)?e:RiTa.tokenize(e)},count:function(e){var t=this.lookup(e);return null===t?0:t.count},concordance:function(){this.model||this.build();var e={};for(var t in this.model)e[t]=this.model[t].indexes.length;return e},kwic:function(e,t){var i=this.lookup(e),n=[];if(i)for(var r=i.indexes,s=0;s<r.length;s++){var a=this.words.slice(Math.max(0,r[s]-t),Math.min(this.words.length,r[s]+t+1));(s<1||r[s]-r[s-1]>t)&&n.push(RiTa.untokenize(a))}return n},build:function(){if(!this.words)throw Error("No text in model");this.model={};for(var e=(+new Date,0);e<this.words.length;e++){var t=this.words[e];if(!this.ignorable(t)){var i=this.lookup(t);i&&"object"==typeof i||(i={word:t,key:this.compareKey(t),indexes:[]},this.model[i.key]=i),i.indexes.push(e)}}},ignorable:function(e){if(this.ignorePunctuation&&RiTa.isPunctuation(e))return!0;for(var t=0;t<this.wordsToIgnore.length;t++){var i=this.wordsToIgnore[t];if(this.ignoreCase&&e.toUpperCase()===i.toUpperCase()||e===i)return!0}return!1},compareKey:function(e){return this.ignoreCase?e.toLowerCase():e},lookup:function(e){var t=this.compareKey(e);return this.model||this.build(),this.model[t]}};var RE=makeClass();RE.prototype={init:function(e,t,i){this.regex=new RegExp(e),this.offset=t,this.suffix=i||""},applies:function(e){return this.regex.test(trim(e))},fire:function(e){return this.truncate(trim(e))+this.suffix},analyze:function(e){return!(this.suffix==E||!endsWith(e,this.suffix))},truncate:function(e){return 0===this.offset?e:e.substr(0,e.length-this.offset)}};var QUESTION_STARTS=["Was","What","When","Where","Which","Why","Who","Will","Would","How","If","Who","Is","Could","Might","Does","Are","Have"],W_QUESTION_STARTS=["Was","What","When","Where","Which","Why","Who","Will","Would"],PUNCTUATION_CLASS=/[�`~\"\/'_\-[\]{}()*+!?%&.,\\^$|#@<>|+=;:\u2018\u2019\u201C\u201D]/g,ONLY_PUNCT=/^[^0-9A-Za-z\s]*$/,DEFAULT_PLURAL_RULE=RE("^((\\w+)(-\\w+)*)(\\s((\\w+)(-\\w+)*))*$",0,"s"),ALL_PUNCT=/^[-[\]{}()*+!?%&.,\\^$|#@<>|+=;:]+$/g,NULL_PLURALS=RE("^(bantu|bengalese|bengali|beninese|boche|bonsai|booze|cellulose|digitalis|mess|moose|burmese|chinese|colossus|congolese|discus|emphasis|expertise|finess|fructose|gabonese|gauze|glucose|grease|guyanese|haze|incense|japanese|javanese|journalese|lebanese|malaise|manganese|mayonnaise|maltese|menopause|merchandise|nitrocellulose|olympics|overuse|paradise|poise|polymerase|portuguese|prose|recompense|remorse|repose|senegalese|siamese|singhalese|innings|sleaze|sinhalese|sioux|sudanese|suspense|swiss|taiwanese|togolese|vietnamese|unease|aircraft|anise|antifreeze|applause|archdiocese|anopheles|apparatus|asparagus|barracks|bellows|bison|bluefish|bob|bourgeois|bream|brill|butterfingers|cargo|carp|catfish|chassis|clothes|chub|cod|codfish|coley|contretemps|corps|crawfish|crayfish|crossroads|cuttlefish|dace|deer|dice|dogfish|doings|dory|downstairs|eldest|earnings|economics|electronics|finnan|firstborn|fish|flatfish|flounder|fowl|fry|fries|works|globefish|goldfish|golf|grand|grief|gudgeon|gulden|haddock|hake|halibut|headquarters|herring|hertz|horsepower|goods|hovercraft|hundredweight|ironworks|jackanapes|kilohertz|kurus|kwacha|ling|lungfish|mackerel|means|megahertz|moorfowl|moorgame|mullet|nepalese|offspring|pampas|parr|pants|patois|pekinese|penn'orth|perch|pickerel|pike|pince-nez|plaice|precis|quid|rand|rendezvous|revers|roach|roux|salmon|samurai|series|seychelles|seychellois|shad|sheep|shellfish|smelt|spacecraft|species|starfish|stockfish|sunfish|superficies|sweepstakes|swordfish|tench|tennis|[a-z]+osis|[a-z]+itis|[a-z]+ness|tobacco|tope|triceps|trout|tuna|tunafish|tunny|turbot|trousers|undersigned|veg|waterfowl|waterworks|waxworks|whiting|wildfowl|woodworm|yen|aries|pisces|forceps|lieder|jeans|physics|mathematics|news|odds|politics|remains|acoustics|aesthetics|aquatics|basics|ceramics|classics|cosmetics|dialectics|dynamics|ethics|harmonics|heroics|mechanics|metrics|optics|physics|polemics|pyrotechnics|surroundings|thanks|statistics|goods|aids|wildlife)$",0),SINGULAR_RULES=[NULL_PLURALS,RE("whizzes",3),RE("^(buses|octopuses)$",2),RE("(houses|horses|cases)$",1),RE("^(toes|wheezes|oozes)$",1),RE("(men|women)$",2,"an"),RE("^[lm]ice$",3,"ouse"),RE("^children",3),RE("^(appendices|indices|matrices)",3,"x"),RE("^(data)$",1,"um"),RE("people",4,"rson"),RE("^meninges|phalanges$",3,"x"),RE("schemata$",2,"s"),RE("^corpora$",3,"us"),RE("^(curi|formul|vertebr|larv|uln|alumn|signor|alg|minuti)ae$",1),RE("^apices|cortices$",4,"ex"),RE("femora",3,"ur"),RE("^(medi|millenni|consorti|sept|memorabili)a$",1,"um"),RE("concerti",1,"o")],C="[bcdfghjklmnpqrstvwxyz]",VL="[lraeiou]",PLURAL_RULES=[RE("prognosis",2,"es"),NULL_PLURALS,RE("^(piano|photo|solo|ego|tobacco|cargo|golf|grief)$",0,"s"),RE("^(wildlife)$",0,"s"),RE("^concerto$",1,"i"),RE(C+"o$",0,"es"),RE(C+"y$",1,"ies"),RE("^ox$",0,"en"),RE("^(stimul|alumn|termin)us$",2,"i"),RE("^corpus$",2,"ora"),RE("(xis|sis)$",2,"es"),RE("whiz$",0,"zes"),RE("([zsx]|ch|sh)$",0,"es"),RE(VL+"fe$",2,"ves"),RE(VL+"f$",1,"ves"),RE("(eu|eau)$",0,"x"),RE("(man|woman)$",2,"en"),RE("money$",2,"ies"),RE("person$",4,"ople"),RE("motif$",0,"s"),RE("^meninx|phalanx$",1,"ges"),RE("schema$",0,"ta"),RE("^bus$",0,"ses"),RE("child$",0,"ren"),RE("^(curi|formul|vertebr|larv|uln|alumn|signor|alg|minuti)a$",0,"e"),RE("^(maharaj|raj|myn|mull)a$",0,"hs"),RE("^aide-de-camp$",8,"s-de-camp"),RE("^apex|cortex$",2,"ices"),RE("^weltanschauung$",0,"en"),RE("^lied$",0,"er"),RE("^tooth$",4,"eeth"),RE("^[lm]ouse$",4,"ice"),RE("^foot$",3,"eet"),RE("femur",2,"ora"),RE("goose",4,"eese"),RE("(human|german|roman)$",0,"s"),RE("^(monarch|loch|stomach)$",0,"s"),RE("^(taxi|chief|proof|ref|relief|roof|belief)$",0,"s"),RE("^(co|no)$",0,"'s"),RE("^blond$",0,"es"),RE("^(medi|millenni|consorti|sept|memorabili)um$",2,"a"),RE("^(memorandum|bacterium|curriculum|minimum|maximum|referendum|spectrum|phenomenon|criterion)$",2,"a"),RE("^(appendix|index|matrix)",2,"ices")],ANY_STEM="^((\\w+)(-\\w+)*)(\\s((\\w+)(-\\w+)*))*$",CONS="[bcdfghjklmnpqrstvwxyz]",VERBAL_PREFIX="((be|with|pre|un|over|re|mis|under|out|up|fore|for|counter|co|sub)(-?))",AUXILIARIES=["do","have","be"],MODALS=["shall","would","may","might","ought","should"],SYMBOLS=["!","?","$","%","*","+","-","="],ING_FORM_RULES=[RE(CONS+"ie$",2,"ying",1),RE("[^ie]e$",1,"ing",1),RE("^bog-down$",5,"ging-down",0),RE("^chivy$",1,"vying",0),RE("^trek$",1,"cking",0),RE("^bring$",0,"ing",0),RE("^be$",0,"ing",0),RE("^age$",1,"ing",0),RE("(ibe)$",1,"ing",0)],PAST_PARTICIPLE_RULES=[RE(CONS+"y$",1,"ied",1),RE("^"+VERBAL_PREFIX+"?(bring)$",3,"ought",0),RE("^"+VERBAL_PREFIX+"?(take|rise|strew|blow|draw|drive|know|give|arise|gnaw|grave|grow|hew|know|mow|see|sew|throw|prove|saw|quartersaw|partake|sake|shake|shew|show|shrive|sightsee|strew|strive)$",0,"n",0),RE("^"+VERBAL_PREFIX+"?[gd]o$",0,"ne",1),RE("^(beat|eat|be|fall)$",0,"en",0),RE("^(have)$",2,"d",0),RE("^"+VERBAL_PREFIX+"?bid$",0,"den",0),RE("^"+VERBAL_PREFIX+"?[lps]ay$",1,"id",1),RE("^behave$",0,"d",0),RE("^"+VERBAL_PREFIX+"?have$",2,"d",1),RE("(sink|slink|drink|shrink|stink)$",3,"unk",0),RE("(([sfc][twlp]?r?|w?r)ing|hang)$",3,"ung",0),RE("^"+VERBAL_PREFIX+"?(shear|swear|bear|wear|tear)$",3,"orn",0),RE("^"+VERBAL_PREFIX+"?(bend|spend|send|lend)$",1,"t",0),RE("^"+VERBAL_PREFIX+"?(weep|sleep|sweep|creep|keep$)$",2,"pt",0),RE("^"+VERBAL_PREFIX+"?(sell|tell)$",3,"old",0),RE("^(outfight|beseech)$",4,"ought",0),RE("^bethink$",3,"ought",0),RE("^buy$",2,"ought",0),RE("^aby$",1,"ought",0),RE("^tarmac",0,"ked",0),RE("^abide$",3,"ode",0),RE("^"+VERBAL_PREFIX+"?(speak|(a?)wake|break)$",3,"oken",0),RE("^backbite$",1,"ten",0),RE("^backslide$",1,"den",0),RE("^become$",3,"ame",0),RE("^begird$",3,"irt",0),RE("^outlie$",2,"ay",0),RE("^rebind$",3,"ound",0),RE("^relay$",2,"aid",0),RE("^shit$",3,"hat",0),RE("^bereave$",4,"eft",0),RE("^foreswear$",3,"ore",0),RE("^overfly$",1,"own",0),RE("^beget$",2,"otten",0),RE("^begin$",3,"gun",0),RE("^bestride$",1,"den",0),RE("^bite$",1,"ten",0),RE("^bleed$",4,"led",0),RE("^bog-down$",5,"ged-down",0),RE("^bind$",3,"ound",0),RE("^(.*)feed$",4,"fed",0),RE("^breed$",4,"red",0),RE("^brei",0,"d",0),RE("^bring$",3,"ought",0),RE("^build$",1,"t",0),RE("^come",0),RE("^catch$",3,"ught",0),RE("^chivy$",1,"vied",0),RE("^choose$",3,"sen",0),RE("^cleave$",4,"oven",0),RE("^crossbreed$",4,"red",0),RE("^deal",0,"t",0),RE("^dow$",1,"ught",0),RE("^dream",0,"t",0),RE("^dig$",3,"dug",0),RE("^dwell$",2,"lt",0),RE("^enwind$",3,"ound",0),RE("^feel$",3,"elt",0),RE("^flee$",2,"ed",0),RE("^floodlight$",5,"lit",0),RE("^fly$",1,"own",0),RE("^forbear$",3,"orne",0),RE("^forerun$",3,"ran",0),RE("^forget$",2,"otten",0),RE("^fight$",4,"ought",0),RE("^find$",3,"ound",0),RE("^freeze$",4,"ozen",0),RE("^gainsay$",2,"aid",0),RE("^gin$",3,"gan",0),RE("^gen-up$",3,"ned-up",0),RE("^ghostwrite$",1,"ten",0),RE("^get$",2,"otten",0),RE("^grind$",3,"ound",0),RE("^hacksaw",0,"n",0),RE("^hear",0,"d",0),RE("^hold$",3,"eld",0),RE("^hide$",1,"den",0),RE("^honey$",2,"ied",0),RE("^inbreed$",4,"red",0),RE("^indwell$",3,"elt",0),RE("^interbreed$",4,"red",0),RE("^interweave$",4,"oven",0),RE("^inweave$",4,"oven",0),RE("^ken$",2,"ent",0),RE("^kneel$",3,"elt",0),RE("^lie$",2,"ain",0),RE("^leap$",0,"t",0),RE("^learn$",0,"t",0),RE("^lead$",4,"led",0),RE("^leave$",4,"eft",0),RE("^light$",5,"lit",0),RE("^lose$",3,"ost",0),RE("^make$",3,"ade",0),RE("^mean",0,"t",0),RE("^meet$",4,"met",0),RE("^misbecome$",3,"ame",0),RE("^misdeal$",2,"alt",0),RE("^mishear$",1,"d",0),RE("^mislead$",4,"led",0),RE("^misunderstand$",3,"ood",0),RE("^outbreed$",4,"red",0),RE("^outrun$",3,"ran",0),RE("^outride$",1,"den",0),RE("^outshine$",3,"one",0),RE("^outshoot$",4,"hot",0),RE("^outstand$",3,"ood",0),RE("^outthink$",3,"ought",0),RE("^outgo$",2,"went",0),RE("^overbear$",3,"orne",0),RE("^overbuild$",3,"ilt",0),RE("^overcome$",3,"ame",0),RE("^overfly$",2,"lew",0),RE("^overhear$",2,"ard",0),RE("^overlie$",2,"ain",0),RE("^overrun$",3,"ran",0),RE("^override$",1,"den",0),RE("^overshoot$",4,"hot",0),RE("^overwind$",3,"ound",0),RE("^overwrite$",1,"ten",0),RE("^plead$",2,"d",0),RE("^rebuild$",3,"ilt",0),RE("^red$",3,"red",0),RE("^redo$",1,"one",0),RE("^remake$",3,"ade",0),RE("^resit$",3,"sat",0),RE("^rethink$",3,"ought",0),RE("^rewind$",3,"ound",0),RE("^rewrite$",1,"ten",0),RE("^ride$",1,"den",0),RE("^reeve$",4,"ove",0),RE("^sit$",3,"sat",0),RE("^shoe$",3,"hod",0),RE("^shine$",3,"one",0),RE("^shoot$",4,"hot",0),RE("^ski$",1,"i'd",0),RE("^slide$",1,"den",0),RE("^smite$",1,"ten",0),RE("^seek$",3,"ought",0),RE("^spit$",3,"pat",0),RE("^speed$",4,"ped",0),RE("^spellbind$",3,"ound",0),RE("^spoil$",2,"ilt",0),RE("^spotlight$",5,"lit",0),RE("^spin$",3,"pun",0),RE("^steal$",3,"olen",0),RE("^stand$",3,"ood",0),RE("^stave$",3,"ove",0),RE("^stride$",1,"den",0),RE("^strike$",3,"uck",0),RE("^stick$",3,"uck",0),RE("^swell$",3,"ollen",0),RE("^swim$",3,"wum",0),RE("^teach$",4,"aught",0),RE("^think$",3,"ought",0),RE("^tread$",3,"odden",0),RE("^typewrite$",1,"ten",0),RE("^unbind$",3,"ound",0),RE("^underbuy$",2,"ought",0),RE("^undergird$",3,"irt",0),RE("^undergo$",1,"one",0),RE("^underlie$",2,"ain",0),RE("^undershoot$",4,"hot",0),RE("^understand$",3,"ood",0),RE("^unfreeze$",4,"ozen",0),RE("^unlearn",0,"t",0),RE("^unmake$",3,"ade",0),RE("^unreeve$",4,"ove",0),RE("^unstick$",3,"uck",0),RE("^unteach$",4,"aught",0),RE("^unthink$",3,"ought",0),RE("^untread$",3,"odden",0),RE("^unwind$",3,"ound",0),RE("^upbuild$",1,"t",0),RE("^uphold$",3,"eld",0),RE("^upheave$",4,"ove",0),RE("^waylay$",2,"ain",0),RE("^whipsaw$",2,"awn",0),RE("^withhold$",3,"eld",0),RE("^withstand$",3,"ood",0),RE("^win$",3,"won",0),RE("^wind$",3,"ound",0),RE("^weave$",4,"oven",0),RE("^write$",1,"ten",0),RE("^trek$",1,"cked",0),RE("^ko$",1,"o'd",0),RE("^win$",2,"on",0),RE("e$",0,"d",1),RE("^"+VERBAL_PREFIX+"?(cast|thrust|typeset|cut|bid|upset|wet|bet|cut|hit|hurt|inset|let|cost|burst|beat|beset|set|upset|hit|offset|put|quit|wed|typeset|wed|spread|split|slit|read|run|rerun|shut|shed)$",0)],PAST_TENSE_RULES=[RE("^(reduce)$",0,"d",0),RE("e$",0,"d",1),RE("^"+VERBAL_PREFIX+"?[pls]ay$",1,"id",1),RE(CONS+"y$",1,"ied",1),RE("^(fling|cling|hang)$",3,"ung",0),RE("(([sfc][twlp]?r?|w?r)ing)$",3,"ang",1),RE("^"+VERBAL_PREFIX+"?(bend|spend|send|lend|spend)$",1,"t",0),RE("^"+VERBAL_PREFIX+"?lie$",2,"ay",0),RE("^"+VERBAL_PREFIX+"?(weep|sleep|sweep|creep|keep)$",2,"pt",0),RE("^"+VERBAL_PREFIX+"?(sell|tell)$",3,"old",0),RE("^"+VERBAL_PREFIX+"?do$",1,"id",0),RE("^"+VERBAL_PREFIX+"?dig$",2,"ug",0),RE("^behave$",0,"d",0),RE("^(have)$",2,"d",0),RE("(sink|drink)$",3,"ank",0),RE("^swing$",3,"ung",0),RE("^be$",2,"was",0),RE("^outfight$",4,"ought",0),RE("^tarmac",0,"ked",0),RE("^abide$",3,"ode",0),RE("^aby$",1,"ought",0),RE("^become$",3,"ame",0),RE("^begird$",3,"irt",0),RE("^outlie$",2,"ay",0),RE("^rebind$",3,"ound",0),RE("^shit$",3,"hat",0),RE("^bereave$",4,"eft",0),RE("^foreswear$",3,"ore",0),RE("^bename$",3,"empt",0),RE("^beseech$",4,"ought",0),RE("^bethink$",3,"ought",0),RE("^bleed$",4,"led",0),RE("^bog-down$",5,"ged-down",0),RE("^buy$",2,"ought",0),RE("^bind$",3,"ound",0),RE("^(.*)feed$",4,"fed",0),RE("^breed$",4,"red",0),RE("^brei$",2,"eid",0),RE("^bring$",3,"ought",0),RE("^build$",3,"ilt",0),RE("^come$",3,"ame",0),RE("^catch$",3,"ught",0),RE("^clothe$",5,"lad",0),RE("^crossbreed$",4,"red",0),RE("^deal$",2,"alt",0),RE("^dow$",1,"ught",0),RE("^dream$",2,"amt",0),RE("^dwell$",3,"elt",0),RE("^enwind$",3,"ound",0),RE("^feel$",3,"elt",0),RE("^flee$",3,"led",0),RE("^floodlight$",5,"lit",0),RE("^arise$",3,"ose",0),RE("^eat$",3,"ate",0),RE("^backbite$",4,"bit",0),RE("^backslide$",4,"lid",0),RE("^befall$",3,"ell",0),RE("^begin$",3,"gan",0),RE("^beget$",3,"got",0),RE("^behold$",3,"eld",0),RE("^bespeak$",3,"oke",0),RE("^bestride$",3,"ode",0),RE("^betake$",3,"ook",0),RE("^bite$",4,"bit",0),RE("^blow$",3,"lew",0),RE("^bear$",3,"ore",0),RE("^break$",3,"oke",0),RE("^choose$",4,"ose",0),RE("^cleave$",4,"ove",0),RE("^countersink$",3,"ank",0),RE("^drink$",3,"ank",0),RE("^draw$",3,"rew",0),RE("^drive$",3,"ove",0),RE("^fall$",3,"ell",0),RE("^fly$",2,"lew",0),RE("^flyblow$",3,"lew",0),RE("^forbid$",2,"ade",0),RE("^forbear$",3,"ore",0),RE("^foreknow$",3,"new",0),RE("^foresee$",3,"saw",0),RE("^forespeak$",3,"oke",0),RE("^forego$",2,"went",0),RE("^forgive$",3,"ave",0),RE("^forget$",3,"got",0),RE("^forsake$",3,"ook",0),RE("^forspeak$",3,"oke",0),RE("^forswear$",3,"ore",0),RE("^forgo$",2,"went",0),RE("^fight$",4,"ought",0),RE("^find$",3,"ound",0),RE("^freeze$",4,"oze",0),RE("^give$",3,"ave",0),RE("^geld$",3,"elt",0),RE("^gen-up$",3,"ned-up",0),RE("^ghostwrite$",3,"ote",0),RE("^get$",3,"got",0),RE("^grow$",3,"rew",0),RE("^grind$",3,"ound",0),RE("^hear$",2,"ard",0),RE("^hold$",3,"eld",0),RE("^hide$",4,"hid",0),RE("^honey$",2,"ied",0),RE("^inbreed$",4,"red",0),RE("^indwell$",3,"elt",0),RE("^interbreed$",4,"red",0),RE("^interweave$",4,"ove",0),RE("^inweave$",4,"ove",0),RE("^ken$",2,"ent",0),RE("^kneel$",3,"elt",0),RE("^^know$$",3,"new",0),RE("^leap$",2,"apt",0),RE("^learn$",2,"rnt",0),RE("^lead$",4,"led",0),RE("^leave$",4,"eft",0),RE("^light$",5,"lit",0),RE("^lose$",3,"ost",0),RE("^make$",3,"ade",0),RE("^mean$",2,"ant",0),RE("^meet$",4,"met",0),RE("^misbecome$",3,"ame",0),RE("^misdeal$",2,"alt",0),RE("^misgive$",3,"ave",0),RE("^mishear$",2,"ard",0),RE("^mislead$",4,"led",0),RE("^mistake$",3,"ook",0),RE("^misunderstand$",3,"ood",0),RE("^outbreed$",4,"red",0),RE("^outgrow$",3,"rew",0),RE("^outride$",3,"ode",0),RE("^outshine$",3,"one",0),RE("^outshoot$",4,"hot",0),RE("^outstand$",3,"ood",0),RE("^outthink$",3,"ought",0),RE("^outgo$",2,"went",0),RE("^outwear$",3,"ore",0),RE("^overblow$",3,"lew",0),RE("^overbear$",3,"ore",0),RE("^overbuild$",3,"ilt",0),RE("^overcome$",3,"ame",0),RE("^overdraw$",3,"rew",0),RE("^overdrive$",3,"ove",0),RE("^overfly$",2,"lew",0),RE("^overgrow$",3,"rew",0),RE("^overhear$",2,"ard",0),RE("^overpass$",3,"ast",0),RE("^override$",3,"ode",0),RE("^oversee$",3,"saw",0),RE("^overshoot$",4,"hot",0),RE("^overthrow$",3,"rew",0),RE("^overtake$",3,"ook",0),RE("^overwind$",3,"ound",0),RE("^overwrite$",3,"ote",0),RE("^partake$",3,"ook",0),RE("^"+VERBAL_PREFIX+"?run$",2,"an",0),RE("^ring$",3,"ang",0),RE("^rebuild$",3,"ilt",0),RE("^red",0),RE("^reave$",4,"eft",0),RE("^remake$",3,"ade",0),RE("^resit$",3,"sat",0),RE("^rethink$",3,"ought",0),RE("^retake$",3,"ook",0),RE("^rewind$",3,"ound",0),RE("^rewrite$",3,"ote",0),RE("^ride$",3,"ode",0),RE("^rise$",3,"ose",0),RE("^reeve$",4,"ove",0),RE("^sing$",3,"ang",0),RE("^sink$",3,"ank",0),RE("^sit$",3,"sat",0),RE("^see$",3,"saw",0),RE("^shoe$",3,"hod",0),RE("^shine$",3,"one",0),RE("^shake$",3,"ook",0),RE("^shoot$",4,"hot",0),RE("^shrink$",3,"ank",0),RE("^shrive$",3,"ove",0),RE("^sightsee$",3,"saw",0),RE("^ski$",1,"i'd",0),RE("^skydive$",3,"ove",0),RE("^slay$",3,"lew",0),RE("^slide$",4,"lid",0),RE("^slink$",3,"unk",0),RE("^smite$",4,"mit",0),RE("^seek$",3,"ought",0),RE("^spit$",3,"pat",0),RE("^speed$",4,"ped",0),RE("^spellbind$",3,"ound",0),RE("^spoil$",2,"ilt",0),RE("^speak$",3,"oke",0),RE("^spotlight$",5,"lit",0),RE("^spring$",3,"ang",0),RE("^spin$",3,"pun",0),RE("^stink$",3,"ank",0),RE("^steal$",3,"ole",0),RE("^stand$",3,"ood",0),RE("^stave$",3,"ove",0),RE("^stride$",3,"ode",0),RE("^strive$",3,"ove",0),RE("^strike$",3,"uck",0),RE("^stick$",3,"uck",0),RE("^swim$",3,"wam",0),RE("^swear$",3,"ore",0),RE("^teach$",4,"aught",0),RE("^think$",3,"ought",0),RE("^throw$",3,"rew",0),RE("^take$",3,"ook",0),RE("^tear$",3,"ore",0),RE("^transship$",4,"hip",0),RE("^tread$",4,"rod",0),RE("^typewrite$",3,"ote",0),RE("^unbind$",3,"ound",0),RE("^unclothe$",5,"lad",0),RE("^underbuy$",2,"ought",0),RE("^undergird$",3,"irt",0),RE("^undershoot$",4,"hot",0),RE("^understand$",3,"ood",0),RE("^undertake$",3,"ook",0),RE("^undergo$",2,"went",0),RE("^underwrite$",3,"ote",0),RE("^unfreeze$",4,"oze",0),RE("^unlearn$",2,"rnt",0),RE("^unmake$",3,"ade",0),RE("^unreeve$",4,"ove",0),RE("^unspeak$",3,"oke",0),RE("^unstick$",3,"uck",0),RE("^unswear$",3,"ore",0),RE("^unteach$",4,"aught",0),RE("^unthink$",3,"ought",0),RE("^untread$",4,"rod",0),RE("^unwind$",3,"ound",0),RE("^upbuild$",3,"ilt",0),RE("^uphold$",3,"eld",0),RE("^upheave$",4,"ove",0),RE("^uprise$",3,"ose",0),RE("^upspring$",3,"ang",0),RE("^go$",2,"went",0),RE("^wiredraw$",3,"rew",0),RE("^withdraw$",3,"rew",0),RE("^withhold$",3,"eld",0),RE("^withstand$",3,"ood",0),RE("^wake$",3,"oke",0),RE("^win$",3,"won",0),RE("^wear$",3,"ore",0),RE("^wind$",3,"ound",0),RE("^weave$",4,"ove",0),RE("^write$",3,"ote",0),RE("^trek$",1,"cked",0),RE("^ko$",1,"o'd",0),RE("^bid",2,"ade",0),RE("^win$",2,"on",0),RE("^swim",2,"am",0),RE("^"+VERBAL_PREFIX+"?(cast|thrust|typeset|cut|bid|upset|wet|bet|cut|hit|hurt|inset|let|cost|burst|beat|beset|set|upset|offset|put|quit|wed|typeset|wed|spread|split|slit|read|run|shut|shed|lay)$",0)],PRESENT_TENSE_RULES=[RE("^aby$",0,"es",0),RE("^bog-down$",5,"s-down",0),RE("^chivy$",1,"vies",0),RE("^gen-up$",3,"s-up",0),RE("^prologue$",3,"gs",0),RE("^picknic$",0,"ks",0),RE("^ko$",0,"'s",0),RE("[osz]$",0,"es",1),RE("^have$",2,"s",0),RE(CONS+"y$",1,"ies",1),RE("^be$",2,"is"),RE("([zsx]|ch|sh)$",0,"es",1)],VERB_CONS_DOUBLING=["abat","abet","abhor","abut","accur","acquit","adlib","admit","aerobat","aerosol","agendaset","allot","alot","anagram","annul","appal","apparel","armbar","aver","babysit","airdrop","appal","blackleg","bobsled","bur","chum","confab","counterplot","curet","dib","backdrop","backfil","backflip","backlog","backpedal","backslap","backstab","bag","balfun","ballot","ban","bar","barbel","bareleg","barrel","bat","bayonet","becom","bed","bedevil","bedwet","beenhop","befit","befog","beg","beget","begin","bejewel","bemedal","benefit","benum","beset","besot","bestir","bet","betassel","bevel","bewig","bib","bid","billet","bin","bip","bit","bitmap","blab","blag","blam","blan","blat","bles","blim","blip","blob","bloodlet","blot","blub","blur","bob","bodypop","bog","booby-trap","boobytrap","booksel","bootleg","bop","bot","bowel","bracket","brag","brig","brim","bud","buffet","bug","bullshit","bum","bun","bus","but","cab","cabal","cam","can","cancel","cap","caracol","caravan","carburet","carnap","carol","carpetbag","castanet","cat","catcal","catnap","cavil","chan","chanel","channel","chap","char","chargecap","chat","chin","chip","chir","chirrup","chisel","chop","chug","chur","clam","clap","clearcut","clip","clodhop","clog","clop","closet","clot","club","co-occur","co-program","co-refer","co-run","co-star","cob","cobweb","cod","coif","com","combat","comit","commit","compel","con","concur","confer","confiscat","control","cop","coquet","coral","corbel","corral","cosset","cotransmit","councel","council","counsel","court-martial","crab","cram","crap","crib","crop","crossleg","cub","cudgel","cum","cun","cup","cut","dab","dag","dam","dan","dap","daysit","de-control","de-gazet","de-hul","de-instal","de-mob","de-program","de-rig","de-skil","deadpan","debag","debar","log","decommit","decontrol","defer","defog","deg","degas","deinstal","demit","demob","demur","den","denet","depig","depip","depit","der","deskil","deter","devil","diagram","dial","dig","dim","din","dip","disbar","disbud","discomfit","disembed","disembowel","dishevel","disinter","dispel","disprefer","distil","dog","dognap","don","doorstep","dot","dowel","drag","drat","driftnet","distil","egotrip","enrol","enthral","extol","fulfil","gaffe","golliwog","idyl","inspan","drip","drivel","drop","drub","drug","drum","dub","duel","dun","dybbuk","earwig","eavesdrop","ecolabel","eitherspigot","electroblot","embed","emit","empanel","enamel","endlabel","endtrim","enrol","enthral","entrammel","entrap","enwrap","equal","equip","estop","exaggerat","excel","expel","extol","fag","fan","farewel","fat","featherbed","feget","fet","fib","fig","fin","fingerspel","fingertip","fit","flab","flag","flap","flip","flit","flog","flop","fob","focus","fog","footbal","footslog","fop","forbid","forget","format","fortunetel","fot","foxtrot","frag","freefal","fret","frig","frip","frog","frug","fuel","fufil","fulfil","fullyfit","fun","funnel","fur","furpul","gab","gad","gag","gam","gambol","gap","garot","garrot","gas","gat","gel","gen","get","giftwrap","gig","gimbal","gin","glam","glenden","glendin","globetrot","glug","glut","gob","goldpan","goostep","gossip","grab","gravel","grid","grin","grip","grit","groundhop","grovel","grub","gum","gun","gunrun","gut","gyp","haircut","ham","han","handbag","handicap","handknit","handset","hap","hareleg","hat","headbut","hedgehop","hem","hen","hiccup","highwal","hip","hit","hobnob","hog","hop","horsewhip","hostel","hot","hotdog","hovel","hug","hum","humbug","hup","hushkit","hut","illfit","imbed","immunblot","immunoblot","impannel","impel","imperil","incur","infer","infil","inflam","initial","input","inset","instil","inter","interbed","intercrop","intercut","interfer","instal","instil","intermit","japan","jug","kris","manumit","mishit","mousse","mud","interwar","jab","jag","jam","jar","jawdrop","jet","jetlag","jewel","jib","jig","jitterbug","job","jog","jog-trot","jot","jut","ken","kennel","kid","kidnap","kip","kissogram","kit","knap","kneecap","knit","knob","knot","kor","label","lag","lam","lap","lavel","leafcut","leapfrog","leg","lem","lep","let","level","libel","lid","lig","lip","lob","log","lok","lollop","longleg","lop","lowbal","lug","mackerel","mahom","man","map","mar","marshal","marvel","mat","matchwin","metal","micro-program","microplan","microprogram","milksop","mis-cal","mis-club","mis-spel","miscal","mishit","mislabel","mit","mob","mod","model","mohmam","monogram","mop","mothbal","mug","multilevel","mum","nab","nag","nan","nap","net","nightclub","nightsit","nip","nod","nonplus","norkop","nostril","not","nut","nutmeg","occur","ocur","offput","offset","omit","ommit","onlap","out-general","out-gun","out-jab","out-plan","out-pol","out-pul","out-put","out-run","out-sel","outbid","outcrop","outfit","outgas","outgun","outhit","outjab","outpol","output","outrun","outship","outshop","outsin","outstrip","outswel","outspan","overcrop","pettifog","photostat","pouf","preset","prim","pug","ret","rosin","outwit","over-commit","over-control","over-fil","over-fit","over-lap","over-model","over-pedal","over-pet","over-run","over-sel","over-step","over-tip","over-top","overbid","overcal","overcommit","overcontrol","overcrap","overdub","overfil","overhat","overhit","overlap","overman","overplot","overrun","overshop","overstep","overtip","overtop","overwet","overwil","pad","paintbal","pan","panel","paperclip","par","parallel","parcel","partiescal","pat","patrol","pedal","peewit","peg","pen","pencil","pep","permit","pet","petal","photoset","phototypeset","phut","picket","pig","pilot","pin","pinbal","pip","pipefit","pipet","pit","plan","plit","plod","plop","plot","plug","plumet","plummet","pod","policyset","polyfil","ponytrek","pop","pot","pram","prebag","predistil","predril","prefer","prefil","preinstal","prep","preplan","preprogram","prizewin","prod","profer","prog","program","prop","propel","pub","pummel","pun","pup","pushfit","put","quarel","quarrel","quickskim","quickstep","quickwit","quip","quit","quivertip","quiz","rabbit","rabit","radiolabel","rag","ram","ramrod","rap","rat","ratecap","ravel","re-admit","re-cal","re-cap","re-channel","re-dig","re-dril","re-emit","re-fil","re-fit","re-flag","re-format","re-fret","re-hab","re-instal","re-inter","re-lap","re-let","re-map","re-metal","re-model","re-pastel","re-plan","re-plot","re-plug","re-pot","re-program","re-refer","re-rig","re-rol","re-run","re-sel","re-set","re-skin","re-stal","re-submit","re-tel","re-top","re-transmit","re-trim","re-wrap","readmit","reallot","rebel","rebid","rebin","rebut","recap","rechannel","recommit","recrop","recur","recut","red","redril","refer","refit","reformat","refret","refuel","reget","regret","reinter","rejig","rekit","reknot","relabel","relet","rem","remap","remetal","remit","remodel","reoccur","rep","repel","repin","replan","replot","repol","repot","reprogram","rerun","reset","resignal","resit","reskil","resubmit","retransfer","retransmit","retro-fit","retrofit","rev","revel","revet","rewrap","rib","richochet","ricochet","rid","rig","rim","ringlet","rip","rit","rival","rivet","roadrun","rob","rocket","rod","roset","rot","rowel","rub","run","runnel","rut","sab","sad","sag","sandbag","sap","scab","scalpel","scam","scan","scar","scat","schlep","scrag","scram","shall","sled","smut","stet","sulfuret","trepan","unrip","unstop","whir","whop","wig","scrap","scrat","scrub","scrum","scud","scum","scur","semi-control","semi-skil","semi-skim","semiskil","sentinel","set","shag","sham","shed","shim","shin","ship","shir","shit","shlap","shop","shopfit","shortfal","shot","shovel","shred","shrinkwrap","shrivel","shrug","shun","shut","side-step","sideslip","sidestep","signal","sin","sinbin","sip","sit","skid","skim","skin","skip","skir","skrag","slab","slag","slam","slap","slim","slip","slit","slob","slog","slop","slot","slowclap","slug","slum","slur","smit","snag","snap","snip","snivel","snog","snorkel","snowcem","snub","snug","sob","sod","softpedal","son","sop","spam","span","spar","spat","spiderweb","spin","spiral","spit","splat","split","spot","sprag","spraygun","sprig","springtip","spud","spur","squat","squirrel","stab","stag","star","stem","sten","stencil","step","stir","stop","storytel","strap","strim","strip","strop","strug","strum","strut","stub","stud","stun","sub","subcrop","sublet","submit","subset","suedetrim","sum","summit","sun","suntan","sup","super-chil","superad","swab","swag","swan","swap","swat","swig","swim","swivel","swot","tab","tag","tan","tansfer","tap","tar","tassel","tat","tefer","teleshop","tendril","terschel","th'strip","thermal","thermostat","thin","throb","thrum","thud","thug","tightlip","tin","tinsel","tip","tittup","toecap","tog","tom","tomorrow","top","tot","total","towel","traget","trainspot","tram","trammel","transfer","tranship","transit","transmit","transship","trap","travel","trek","trendset","trim","trip","tripod","trod","trog","trot","trousseaushop","trowel","trup","tub","tug","tunnel","tup","tut","twat","twig","twin","twit","typeset","tyset","un-man","unban","unbar","unbob","uncap","unclip","uncompel","undam","under-bil","under-cut","under-fit","under-pin","under-skil","underbid","undercut","underlet","underman","underpin","unfit","unfulfil","unknot","unlip","unlywil","unman","unpad","unpeg","unpin","unplug","unravel","unrol","unscrol","unsnap","unstal","unstep","unstir","untap","unwrap","unzip","up","upset","upskil","upwel","ven","verbal","vet","victual","vignet","wad","wag","wainscot","wan","war","water-log","waterfal","waterfil","waterlog","weasel","web","wed","wet","wham","whet","whip","whir","whiteskin","whiz","whup","wildcat","win","windmil","wit","woodchop","woodcut","wor","worship","wrap","wiretap","yen","yak","yap","yarnspin","yip","yodel","zag","zap","zig","zig-zag","zigzag","zip","ztrip","hand-bag","hocus","hocus-pocus"],PAST_PARTICIPLE_RULESET={
  name:"PAST_PARTICIPLE",defaultRule:RE(ANY_STEM,0,"ed",2),rules:PAST_PARTICIPLE_RULES,doubling:!0},PRESENT_PARTICIPLE_RULESET={name:"ING_FORM",defaultRule:RE(ANY_STEM,0,"ing",2),rules:ING_FORM_RULES,doubling:!0},PAST_TENSE_RULESET={name:"PAST_TENSE",defaultRule:RE(ANY_STEM,0,"ed",2),rules:PAST_TENSE_RULES,doubling:!0},PRESENT_TENSE_RULESET={name:"PRESENT_TENSE",defaultRule:RE(ANY_STEM,0,"s",2),rules:PRESENT_TENSE_RULES,doubling:!1};RiTa.SILENT||isNode()||!console||console.log("[INFO] RiTaJS.version ["+RiTa.VERSION+"]"),RiTa.lexicon=RiLexicon();for(var funs=okeys(RiTa.lexicon),i=0;i<funs.length;i++)if(!startsWith(funs[i],"_")){var f=RiTa.lexicon[funs[i]];is(f,F)&&(RiTa[funs[i]]=f.bind(RiTa.lexicon))}if(window){window.RiTa=RiTa,window.RiString=RiString,window.RiGrammar=RiGrammar,window.RiMarkov=RiMarkov,window.RiWordNet=RiWordNet,window.RiLexicon=RiLexicon,window.RiTaEvent=RiTaEvent;var rlfuns=okeys()}else if("undefined"!=typeof module){module.exports.RiTa=RiTa,module.exports.RiString=RiString,module.exports.RiGrammar=RiGrammar,module.exports.RiMarkov=RiMarkov,module.exports.RiWordNet=RiWordNet,module.exports.RiLexicon=RiLexicon,module.exports.RiTaEvent=RiTaEvent;for(var funs=okeys(RiTa),i=0;i<funs.length;i++)startsWith(funs[i],"_")||(module.exports[funs[i]]=RiTa[funs[i]])}}("undefined"!=typeof window?window:null);
  