Index: graphspell-js/dawg.js ================================================================== --- graphspell-js/dawg.js +++ graphspell-js/dawg.js @@ -26,11 +26,11 @@ A word is a list of numbers [ c1, c2, c3 . . . cN, iAffix, iTags] Each arc is an index in this.lArcVal, where are stored characters, suffix/affix codes for stemming and tags. Important: As usual, the last node (after ‘iTags’) is tagged final, AND the node after ‘cN’ is ALSO tagged final. */ - constructor (lEntrySrc, sLangName, cStemming, xProgressBarNode=null) { + constructor (lEntrySrc, sLang, cStemming, xProgressBarNode=null) { console.log("===== Direct Acyclic Word Graph - Minimal Acyclic Finite State Automaton ====="); let funcStemmingGen = null; switch (cStemming.toUpperCase()) { case "A": funcStemmingGen = str_transform.defineAffixCode; break; @@ -102,11 +102,12 @@ for (let sAff of dAff.keys()) { lKeyVal.push([dAff.get(sAff)+nChar, dAffOccur.get(sAff)]); } for (let sTag of dTag.keys()) { lKeyVal.push([dTag.get(sTag)+nChar+nAff, dTagOccur.get(sTag)]); } let dValOccur = new Map(lKeyVal); lKeyVal.length = 0; // clear the array - this.sLang = sLangName; + this.sHeader = "/pyfsa/"; + this.sLang = sLang; this.nEntry = lWord.length; this.aPreviousEntry = []; oNodeCounter.reset(); this.oRoot = new DawgNode(); this.lUncheckedNodes = []; // list of nodes that have not been checked for duplication. @@ -366,12 +367,12 @@ sByDic += oNode.convToBytes1(this.nBytesArc, this.nBytesNodeAddress); } } let oJSON = { "sName": this.sName, - "nVersion": this.nMethod, - "sHeader": this.sHeader, + "nVersion": nMethod, + "sHeader": this.sHeader + nMethod + "/", "lArcVal": this.lArcVal, "nArcVal": this.nArcVal, "byDic": sByDic, "sLang": this.sLang, "nChar": this.nChar,