Grammalecte  Check-in [d32a1cd66e]

Overview
Comment:[graphspell] remove split suggestions when start differs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: d32a1cd66e5f28cc574e7e5846c76c0f451504778627bec9b7c17b42e89f7755
User & Date: olr on 2019-02-05 18:17:57
Other Links: manifest | tags
Context
2019-02-07
11:48
[fr] faux positif check-in: d012b8a0d4 user: olr tags: trunk, fr
2019-02-05
18:40
merge trunk check-in: 521f9f5963 user: olr tags: comdic
18:17
[graphspell] remove split suggestions when start differs check-in: d32a1cd66e user: olr tags: trunk, graphspell
2019-01-31
12:02
[fr] faux positif: confusion des/dès check-in: 6745895369 user: olr tags: trunk, fr
Changes

Modified graphspell-js/ibdawg.js from [4f945b40c0] to [6cc335b8c9].

362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
            if (sRemain == "") {
                oSuggResult.addSugg(sNewWord);
                for (let sTail of this._getTails(iAddr)) {
                    oSuggResult.addSugg(sNewWord+sTail);
                }
                return;
            }
            else if (this.isValid(sRemain)) {
                oSuggResult.addSugg(sNewWord+" "+sRemain);
            }
        }
        if (nDist > oSuggResult.nDistLimit) {
            return;
        }








|







362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
            if (sRemain == "") {
                oSuggResult.addSugg(sNewWord);
                for (let sTail of this._getTails(iAddr)) {
                    oSuggResult.addSugg(sNewWord+sTail);
                }
                return;
            }
            else if (this.isValid(sRemain) && oSuggResult.sWord.startsWith(sNewWord)) {
                oSuggResult.addSugg(sNewWord+" "+sRemain);
            }
        }
        if (nDist > oSuggResult.nDistLimit) {
            return;
        }

Modified graphspell/ibdawg.py from [71e6fa50b3] to [b71a5faec3].

325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
        #logging.info((nDeep * "  ") + sNewWord + ":" + sRemain)
        if int.from_bytes(self.byDic[iAddr:iAddr+self.nBytesArc], byteorder='big') & self._finalNodeMask:
            if not sRemain:
                oSuggResult.addSugg(sNewWord, nDeep)
                for sTail in self._getTails(iAddr):
                    oSuggResult.addSugg(sNewWord+sTail, nDeep)
                return
            elif self.isValid(sRemain):
                oSuggResult.addSugg(sNewWord+" "+sRemain)
        if nDist > oSuggResult.nDistLimit:
            return
        cCurrent = sRemain[0:1]
        for cChar, jAddr in self._getCharArcs(iAddr):
            if cChar in cp.d1to1.get(cCurrent, cCurrent):
                self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nMaxJump, nDist, nDeep+1, jAddr, sNewWord+cChar)







|







325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
        #logging.info((nDeep * "  ") + sNewWord + ":" + sRemain)
        if int.from_bytes(self.byDic[iAddr:iAddr+self.nBytesArc], byteorder='big') & self._finalNodeMask:
            if not sRemain:
                oSuggResult.addSugg(sNewWord, nDeep)
                for sTail in self._getTails(iAddr):
                    oSuggResult.addSugg(sNewWord+sTail, nDeep)
                return
            elif self.isValid(sRemain) and oSuggResult.sWord.startswith(sNewWord):
                oSuggResult.addSugg(sNewWord+" "+sRemain)
        if nDist > oSuggResult.nDistLimit:
            return
        cCurrent = sRemain[0:1]
        for cChar, jAddr in self._getCharArcs(iAddr):
            if cChar in cp.d1to1.get(cCurrent, cCurrent):
                self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nMaxJump, nDist, nDeep+1, jAddr, sNewWord+cChar)