Grammalecte  Check-in [bb3e601640]

Overview
Comment:[graphspell] suggestion mechanism: case recognition for split suggestions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: bb3e601640403bcc3c75c4d5e255b02a15532f5ffb1ef3ab58e96555d6c3b1fa
User & Date: olr on 2019-02-09 19:13:54
Other Links: manifest | tags
Context
2019-02-09
20:09
[graphspell][js] acronyms recognized by default check-in: 39acddf4cc user: olr tags: trunk, graphspell
19:13
[graphspell] suggestion mechanism: case recognition for split suggestions check-in: bb3e601640 user: olr tags: trunk, graphspell
18:00
[fr] nr: confusion nom/verbe check-in: b6eb18fc44 user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/rules.grx from [85766b3360] to [17d13b9474].

18212
18213
18214
18215
18216
18217
18218

18219
18220
18221
18222
18223
18224
18225

    [quel|quels|quelle|quelles]  >être  [les|ces|mes|tes|ses|nos|vos|leurs|plusieurs]  @:V¬:[NA]
    [quel|quels|quelle|quelles]  >pouvoir être  [les|ces|mes|tes|ses|nos|vos|leurs|plusieurs]  @:V¬:[NA]
        <<- /conf/ morph(\2, ":[123][sp]") --1>> =suggSimil(\-1, ":[NA].*:[pi]", True)          # Confusion probable : “\-1”  est un forme verbale conjuguée, alors qu’il faudrait probablement un substantif.

TEST: Quel serait leur {{impacte}} sur la population.                               ->> impact
TEST: Quels étaient les {{ennuient}} avec ces gens                                  ->> ennuis




!!!
!!!
!!! Processeur: purge des préverbes                                                               !!
!!!







>







18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226

    [quel|quels|quelle|quelles]  >être  [les|ces|mes|tes|ses|nos|vos|leurs|plusieurs]  @:V¬:[NA]
    [quel|quels|quelle|quelles]  >pouvoir être  [les|ces|mes|tes|ses|nos|vos|leurs|plusieurs]  @:V¬:[NA]
        <<- /conf/ morph(\2, ":[123][sp]") --1>> =suggSimil(\-1, ":[NA].*:[pi]", True)          # Confusion probable : “\-1”  est un forme verbale conjuguée, alors qu’il faudrait probablement un substantif.

TEST: Quel serait leur {{impacte}} sur la population.                               ->> impact
TEST: Quels étaient les {{ennuient}} avec ces gens                                  ->> ennuis
TEST: un homme humble et doux, quel être le deviendrait en de telles circonstances ?



!!!
!!!
!!! Processeur: purge des préverbes                                                               !!
!!!

Modified graphspell-js/ibdawg.js from [6cc335b8c9] to [1f3d80161a].

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;
        }








|







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.toLowerCase().startsWith(sNewWord.toLowerCase())) {
                oSuggResult.addSugg(sNewWord+" "+sRemain);
            }
        }
        if (nDist > oSuggResult.nDistLimit) {
            return;
        }

Modified graphspell/ibdawg.py from [b71a5faec3] to [bd7f8fa082].

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)







|







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.lower().startswith(sNewWord.lower()):
                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)