Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -266,14 +266,11 @@ if (sWord.length > 1) { if (sWord.gl_isTitle()) { return !!this.lookup(sWord.toLowerCase()); } if (sWord.gl_isUpperCase()) { - if (this.bAcronymValid) { - return true; - } - return !!(this.lookup(sWord.toLowerCase()) || this.lookup(sWord.gl_toCapitalize())); + return !!(this.bAcronymValid || this.lookup(sWord.toLowerCase()) || this.lookup(sWord.gl_toCapitalize())); } return !!this.lookup(sWord.slice(0, 1).toLowerCase() + sWord.slice(1)); } return !!this.lookup(sWord.toLowerCase()); } Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -1,11 +1,11 @@ #!python3 """ INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH Implementation of a spellchecker as a transducer (storing transformation code to get lemma and morphologies) -and a spell suggestion mechanim +and a spell suggestion mechanism """ import traceback import pkgutil import re @@ -264,13 +264,11 @@ if sWord[0:1].isupper(): if len(sWord) > 1: if sWord.istitle(): return self.lookup(sWord.lower()) if sWord.isupper(): - if self.bAcronymValid: - return True - return self.lookup(sWord.lower()) or self.lookup(sWord.capitalize()) + return self.bAcronymValid or self.lookup(sWord.lower()) or self.lookup(sWord.capitalize()) return self.lookup(sWord[:1].lower() + sWord[1:]) return self.lookup(sWord.lower()) if sWord[0:1].isdigit(): return True return False