Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -172,12 +172,12 @@ break; default: throw ValueError("# Error: unknown code: " + this.nCompressionMethod); } //console.log(this.getInfo()); - this.bOptNumSigle = true; - this.bOptNumAtLast = false; + this.bAcronymValid = true; + this.bNumAtLastValid = false; } getInfo () { return ` Language: ${this.sLangName} Lang code: ${this.sLangCode} Dictionary name: ${this.sDicName}\n` + ` Compression method: ${this.nCompressionMethod} Date: ${this.sDate} Stemming: ${this.cStemming}FX\n` + @@ -246,11 +246,11 @@ if (sWord.length > 1) { if (sWord.gl_isTitle()) { return !!this.lookup(sWord.toLowerCase()); } if (sWord.gl_isUpperCase()) { - if (this.bOptNumSigle) { + if (this.bAcronymValid) { return true; } return !!(this.lookup(sWord.toLowerCase()) || this.lookup(sWord.gl_toCapitalize())); } return !!this.lookup(sWord.slice(0, 1).toLowerCase() + sWord.slice(1)); Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -133,12 +133,12 @@ self._getArcs = self._getArcs3 self._writeNodes = self._writeNodes3 else: raise ValueError(" # Error: unknown code: {}".format(self.nCompressionMethod)) - self.bOptNumSigle = False - self.bOptNumAtLast = False + self.bAcronymValid = True + self.bNumAtLastValid = False def _initBinary (self): "initialize with binary structure file" if self.by[0:17] != b"/grammalecte-fsa/": raise TypeError("# Error. Not a grammalecte-fsa binary dictionary. Header: {}".format(self.by[0:9])) @@ -247,11 +247,11 @@ if sWord[0:1].isupper(): if len(sWord) > 1: if sWord.istitle(): return self.lookup(sWord.lower()) if sWord.isupper(): - if self.bOptNumSigle: + if self.bAcronymValid: return True return self.lookup(sWord.lower()) or self.lookup(sWord.capitalize()) return self.lookup(sWord[:1].lower() + sWord[1:]) else: return self.lookup(sWord.lower())