Grammalecte  Check-in [41d308e073]

Overview
Comment:[core][bug] ibdawg: suggest2 > fix char priority
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | spellsugg
Files: files | file ages | folders
SHA3-256: 41d308e073ad143a78adec5e014b3bdfda488cb2bba912b1871f4d25feaa040e
User & Date: olr on 2017-11-07 22:04:04
Other Links: branch diff | manifest | tags
Context
2017-11-08
08:16
[core] ibdawg: suggest > maximum number of switches > faster search check-in: a85c70d24d user: olr tags: core, spellsugg
2017-11-07
22:04
[core][bug] ibdawg: suggest2 > fix char priority check-in: 41d308e073 user: olr tags: core, spellsugg
19:56
[core] ibdawg: suggest2 > char priority check-in: 8ea89d19b5 user: olr tags: core, spellsugg
Changes

Modified gc_core/py/ibdawg.py from [7b0e081c93] to [fdecb6280f].

349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
                if jAddr:
                    yield (c, jAddr)

    def _getCharArcsWithPriority (self, iAddr, cChar):
        if not cChar:
            yield from self._getCharArcs(iAddr)
        lTuple = list(self._getCharArcs(iAddr))
        lTuple.sort(key=lambda t: 0  if t[0] in cp.d1to1.get(cChar, "")  else  1)
        yield from lTuple

    def _getTails (self, iAddr, sTail="", n=2):
        "return a list of suffixes ending at a distance of <n> from <iAddr>"
        aTails = set()
        for nVal, jAddr in self._getArcs(iAddr):
            if nVal < self.nChar:







|







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
                if jAddr:
                    yield (c, jAddr)

    def _getCharArcsWithPriority (self, iAddr, cChar):
        if not cChar:
            yield from self._getCharArcs(iAddr)
        lTuple = list(self._getCharArcs(iAddr))
        lTuple.sort(key=lambda t: 0  if t[0] in cp.d1to1.get(cChar, cChar)  else  1)
        yield from lTuple

    def _getTails (self, iAddr, sTail="", n=2):
        "return a list of suffixes ending at a distance of <n> from <iAddr>"
        aTails = set()
        for nVal, jAddr in self._getArcs(iAddr):
            if nVal < self.nChar: