@@ -146,11 +146,11 @@ throw RangeError("# Error. Unknown dictionary compression method: " + this.nCompressionMethod); } // to get the value of an arc, to get the char of an arc with its value this.dChar = helpers.objectToMap(this.dChar); this.dCharVal = this.dChar.gl_reverse(); - this.a2grams = new Set(this.l2grams); + this.a2grams = (this.l2grams) ? new Set(this.l2grams) : null; if (this.cStemming == "S") { this.funcStemming = str_transform.changeWordWithSuffixCode; } else if (this.cStemming == "A") { this.funcStemming = str_transform.changeWordWithAffixCode; @@ -412,10 +412,13 @@ } isNgramsOK (sChars) { if (sChars.length != 2) { return true; + } + if (!this.a2grams) { + return true; } return this.a2grams.has(sChars); } * _getCharArcs (iAddr) {