Grammalecte  Check-in [22ff60980a]

Overview
Comment:[graphspell][js] 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: 22ff60980aa1b5c2c200433281c14580a644fa38b4343c9cb2a391e206f4ecf8
User & Date: olr on 2018-02-09 15:26:53
Other Links: manifest | tags
Context
2018-02-09
15:30
[graphspell][js] dawg: fix bug in select() check-in: dd59a31d13 user: olr tags: trunk, graphspell
15:26
[graphspell][js] ibdawg: fix bug in select() check-in: 22ff60980a user: olr tags: trunk, graphspell
15:24
[graphspell][py] dawg: add select() function check-in: 057eab4afb user: olr tags: trunk, graphspell
Changes

Modified graphspell-js/ibdawg.js from [b0a7255037] to [04460c4785].

404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
    }

    // VERSION 1

    * _select1 (zPattern, iAddr, sWord) {
        // recursive generator
        for (let [nVal, jAddr] of this._getArcs1(iAddr)) {
            if (nVal < this.nChar) {
                // simple character
                yield* this._select1(zPattern, jAddr, sWord + this.lArcVal[nVal]);
            } else {
                let sEntry = sWord + "\t" + this.funcStemming(sWord, this.lArcVal[nVal]);
                for (let [nMorphVal, _] of this._getArcs1(jAddr)) {
                    if (!zPattern || zPattern.test(this.lArcVal[nMorphVal])) {
                        yield sEntry + "\t" + this.lArcVal[nMorphVal];







|







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
    }

    // VERSION 1

    * _select1 (zPattern, iAddr, sWord) {
        // recursive generator
        for (let [nVal, jAddr] of this._getArcs1(iAddr)) {
            if (nVal <= this.nChar) {
                // simple character
                yield* this._select1(zPattern, jAddr, sWord + this.lArcVal[nVal]);
            } else {
                let sEntry = sWord + "\t" + this.funcStemming(sWord, this.lArcVal[nVal]);
                for (let [nMorphVal, _] of this._getArcs1(jAddr)) {
                    if (!zPattern || zPattern.test(this.lArcVal[nMorphVal])) {
                        yield sEntry + "\t" + this.lArcVal[nMorphVal];