Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -224,11 +224,11 @@ } if (sToken.includes("-")) { if (sToken.gl_count("-") > 4) { return true; } - return sToken.split("-").every(sWord => this.isValid(sWord)); + return sToken.split("-").every(sWord => this.isValid(sWord)); } if (sToken.includes(".") || sToken.includes("·")) { return true; } return false; @@ -237,12 +237,12 @@ isValid (sWord) { // checks if sWord is valid (different casing tested if the first letter is a capital) if (!sWord) { return null; } - if (sWord.includes("’")) { // ugly hack - sWord = sWord.replace("’", "'"); + if (sWord.includes("'")) { // ugly hack + sWord = sWord.replace("'", "’"); } if (this.lookup(sWord)) { return true; } if (sWord.charAt(0).gl_isUpperCase()) { @@ -482,11 +482,11 @@ } } } } } - } + } _morph1 (sWord) { // returns morphologies of sWord let iAddr = 0; for (let c of sWord) { @@ -504,11 +504,11 @@ while (!(nRawArc & this._lastArcMask)) { let iEndArcAddr = iAddr + this.nBytesArc; nRawArc = this._convBytesToInteger(this.byDic.slice(iAddr, iEndArcAddr)); let nArc = nRawArc & this._arcMask; if (nArc > this.nChar) { - // This value is not a char, this is a stemming code + // This value is not a char, this is a stemming code let sStem = ">" + this.funcStemming(sWord, this.lArcVal[nArc]); // Now , we go to the next node and retrieve all following arcs values, all of them are tags let iAddr2 = this._convBytesToInteger(this.byDic.slice(iEndArcAddr, iEndArcAddr+this.nBytesNodeAddress)); let nRawArc2 = 0; while (!(nRawArc2 & this._lastArcMask)) { @@ -543,11 +543,11 @@ while (!(nRawArc & this._lastArcMask)) { let iEndArcAddr = iAddr + this.nBytesArc; nRawArc = this._convBytesToInteger(this.byDic.slice(iAddr, iEndArcAddr)); let nArc = nRawArc & this._arcMask; if (nArc > this.nChar) { - // This value is not a char, this is a stemming code + // This value is not a char, this is a stemming code l.push(this.funcStemming(sWord, this.lArcVal[nArc])); } iAddr = iEndArcAddr + this.nBytesNodeAddress; } return l; @@ -559,11 +559,11 @@ // looks if nVal is an arc at the node at iAddr, if yes, returns address of next node else None while (true) { let iEndArcAddr = iAddr+this.nBytesArc; let nRawArc = this._convBytesToInteger(this.byDic.slice(iAddr, iEndArcAddr)); if (nVal == (nRawArc & this._arcMask)) { - // the value we are looking for + // the value we are looking for // we return the address of the next node return this._convBytesToInteger(this.byDic.slice(iEndArcAddr, iEndArcAddr+this.nBytesNodeAddress)); } else { // value not found Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -247,12 +247,12 @@ def isValid (self, sWord): "checks if is valid (different casing tested if the first letter is a capital)" if not sWord: return None - if "’" in sWord: # ugly hack - sWord = sWord.replace("’", "'") + if "'" in sWord: # ugly hack + sWord = sWord.replace("'", "’") if self.lookup(sWord): return True if sWord[0:1].isupper(): if len(sWord) > 1: if sWord.istitle():