Grammalecte  Check-in [8142bf4c10]

Overview
Comment:[graphspell][py] ibdawg: fix bug in select()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 8142bf4c10c2c68e672683118c8cc643d3d50e69d71cac62197aaa14649146c7
User & Date: olr on 2018-02-09 15:23:50
Original Comment: [graphspell] ibdawg: fix bug in select()
Other Links: manifest | tags
Context
2018-02-09
15:24
[graphspell][py] dawg: add select() function check-in: 057eab4afb user: olr tags: trunk, graphspell
15:23
[graphspell][py] ibdawg: fix bug in select() check-in: 8142bf4c10 user: olr tags: trunk, graphspell
10:34
[graphspell][js] useless commit: console.log() for debugging check-in: 2aa4af79ac user: olr tags: trunk, graphspell
Changes

Modified graphspell/ibdawg.py from [2a3e103bf0] to [575cbfa96d].

391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
    # def morph (self, sWord):
    #     is defined in __init__

    # VERSION 1
    def _select1 (self, zPattern, iAddr, sWord):
        # recursive generator
        for nVal, jAddr in self._getArcs1(iAddr):
            if nVal < self.nChar:
                # simple character
                yield from self._select1(zPattern, jAddr, sWord + self.lArcVal[nVal])
            else:
                sEntry = sWord + "\t" + self.funcStemming(sWord, self.lArcVal[nVal])
                for nMorphVal, _ in self._getArcs1(jAddr):
                    if not zPattern or zPattern.search(self.lArcVal[nMorphVal]):
                        yield sEntry + "\t" + self.lArcVal[nMorphVal]







|







391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
    # def morph (self, sWord):
    #     is defined in __init__

    # VERSION 1
    def _select1 (self, zPattern, iAddr, sWord):
        # recursive generator
        for nVal, jAddr in self._getArcs1(iAddr):
            if nVal <= self.nChar:
                # simple character
                yield from self._select1(zPattern, jAddr, sWord + self.lArcVal[nVal])
            else:
                sEntry = sWord + "\t" + self.funcStemming(sWord, self.lArcVal[nVal])
                for nMorphVal, _ in self._getArcs1(jAddr):
                    if not zPattern or zPattern.search(self.lArcVal[nMorphVal]):
                        yield sEntry + "\t" + self.lArcVal[nMorphVal]