Grammalecte  Check-in [ad404457eb]

Overview
Comment:[graphspell] remove private useless vars from JSON dictionary files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: ad404457eb7877c1b222cb112e6610fbcf91c5f880c93bb2e184c2b3470d37f9
User & Date: olr on 2018-02-07 16:53:43
Other Links: manifest | tags
Context
2018-02-07
22:53
[fr] faux positif: COD que <suj> avoir oublié de… check-in: f7cdd20fe9 user: olr tags: trunk, fr
16:53
[graphspell] remove private useless vars from JSON dictionary files check-in: ad404457eb user: olr tags: trunk, graphspell
16:39
[fx] update: lexicon editor check-in: 00eca59ea8 user: olr tags: trunk, fx
Changes

Modified graphspell-js/dawg.js from [a299d0be58] to [c471dee066].

381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
            "nEntries": this.nEntry,
            "nNode": this.nNode,
            "nArc": this.nArc,
            "nAff": this.nAff,
            "cStemming": this.cStemming,
            "nTag": this.nTag,
            "dChar": helpers.mapToObject(this.dChar),
            "_arcMask": this._arcMask,
            "_finalNodeMask": this._finalNodeMask,
            "_lastArcMask": this._lastArcMask,
            "_addrBitMask": this._addrBitMask,
            "nBytesOffset": this.nBytesOffset
        };
        return oJSON;
    }
}


const oNodeCounter = {







<
<
<
<
|







381
382
383
384
385
386
387




388
389
390
391
392
393
394
395
            "nEntries": this.nEntry,
            "nNode": this.nNode,
            "nArc": this.nArc,
            "nAff": this.nAff,
            "cStemming": this.cStemming,
            "nTag": this.nTag,
            "dChar": helpers.mapToObject(this.dChar),




            "nBytesOffset": 1
        };
        return oJSON;
    }
}


const oNodeCounter = {

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

133
134
135
136
137
138
139





140
141
142
143
144
145
146
        if (this.cStemming == "S") {
            this.funcStemming = str_transform.changeWordWithSuffixCode;
        } else if (this.cStemming == "A") {
            this.funcStemming = str_transform.changeWordWithAffixCode;
        } else {
            this.funcStemming = str_transform.noStemming;
        }






        // Configuring DAWG functions according to nVersion
        switch (this.nVersion) {
            case 1:
                this.morph = this._morph1;
                this.stem = this._stem1;
                this._lookupArcNode = this._lookupArcNode1;







>
>
>
>
>







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
        if (this.cStemming == "S") {
            this.funcStemming = str_transform.changeWordWithSuffixCode;
        } else if (this.cStemming == "A") {
            this.funcStemming = str_transform.changeWordWithAffixCode;
        } else {
            this.funcStemming = str_transform.noStemming;
        }

        this._arcMask = (2 ** ((this.nBytesArc * 8) - 3)) - 1;
        this._finalNodeMask = 1 << ((this.nBytesArc * 8) - 1);
        this._lastArcMask = 1 << ((this.nBytesArc * 8) - 2);


        // Configuring DAWG functions according to nVersion
        switch (this.nVersion) {
            case 1:
                this.morph = this._morph1;
                this.stem = this._stem1;
                this._lookupArcNode = this._lookupArcNode1;

Modified graphspell/ibdawg.py from [047a0ad4e7] to [2a3e103bf0].

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
                            "nEntries": self.nEntries,
                            "nNode": self.nNode,
                            "nArc": self.nArc,
                            "nAff": self.nAff,
                            "cStemming": self.cStemming,
                            "nTag": self.nTag,
                            "dChar": self.dChar,
                            "_arcMask": self._arcMask,
                            "_finalNodeMask": self._finalNodeMask,
                            "_lastArcMask": self._lastArcMask,
                            "_addrBitMask": self._addrBitMask,
                            "nBytesOffset": self.nBytesOffset
                        }, ensure_ascii=False))
            if bInJSModule:
                hDst.write(";\n\nexports.dictionary = dictionary;\n")

    def isValidToken (self, sToken):
        "checks if <sToken> is valid (if there is hyphens in <sToken>, <sToken> is split, each part is checked)"







<
<
<
<







182
183
184
185
186
187
188




189
190
191
192
193
194
195
                            "nEntries": self.nEntries,
                            "nNode": self.nNode,
                            "nArc": self.nArc,
                            "nAff": self.nAff,
                            "cStemming": self.cStemming,
                            "nTag": self.nTag,
                            "dChar": self.dChar,




                            "nBytesOffset": self.nBytesOffset
                        }, ensure_ascii=False))
            if bInJSModule:
                hDst.write(";\n\nexports.dictionary = dictionary;\n")

    def isValidToken (self, sToken):
        "checks if <sToken> is valid (if there is hyphens in <sToken>, <sToken> is split, each part is checked)"