Overview
| Comment: | [core][js] fix spell suggestion engine |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | core |
| Files: | files | file ages | folders |
| SHA3-256: |
4b57907a818e5b677a5550ddf81c7672 |
| User & Date: | olr on 2017-09-15 10:01:02 |
| Original Comment: | [core][js] fx spell suggestion engine |
| Other Links: | manifest | tags |
Context
|
2017-09-15
| ||
| 13:12 | [core][js] fix Damerau-Levenshtein distance check-in: 4486055937 user: olr tags: trunk, core | |
| 10:01 | [core][js] fix spell suggestion engine check-in: 4b57907a81 user: olr tags: trunk, core | |
| 08:16 | [core][fx] ibdawg: fix bugs, WebExt: retrieve spelling suggestion check-in: d7eb5a15ee user: olr tags: trunk, core, fx | |
Changes
Modified gc_core/js/ibdawg.js from [8b27735529] to [da811a4bb4].
| ︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + + |
*/
if (!this.sHeader.startsWith("/pyfsa/")) {
throw TypeError("# Error. Not a pyfsa binary dictionary. Header: " + this.sHeader);
}
if (!(this.nVersion == "1" || this.nVersion == "2" || this.nVersion == "3")) {
throw RangeError("# Error. Unknown dictionary version: " + this.nVersion);
}
|
| ︙ | |||
263 264 265 266 267 268 269 | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | - + - + |
_getTails (iAddr, sTail="", n=2) {
// return a list of suffixes ending at a distance of <n> from <iAddr>
let aTails = new Set();
for (let [nVal, jAddr] of this._getArcs(iAddr)) {
if (nVal < this.nChar) {
if (this._convBytesToInteger(this.byDic.slice(jAddr, jAddr+this.nBytesArc)) & this._finalNodeMask) {
|
| ︙ | |||
293 294 295 296 297 298 299 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - - + + |
}
return aSugg;
}
* _getSimilarArcsAndCrushedChars (cChar, iAddr) {
// generator: yield similar char of <cChar> and address of the following node
for (let [nVal, jAddr] of this._getArcs(iAddr)) {
|
| ︙ |
Modified gc_core/js/jsex_map.js from [3dc39be41a] to [640f46f082].
| ︙ | |||
39 40 41 42 43 44 45 46 47 48 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | + + + + + + + + |
Map.prototype.gl_updateOnlyExistingKeys = function (dDict) {
for (let [k, v] of dDict.entries()) {
if (this.has(k)){
this.set(k, v);
}
}
};
Map.prototype.gl_reverse = function () {
let dNewMap = new Map();
this.forEach((val, key) => {
dNewMap.set(val, key);
});
return dNewMap;
};
Map.prototype.grammalecte = true;
}
|
Modified gc_lang/fr/webext/gce_worker.js from [5edde2a5fd] to [ad4b1695da].
| ︙ | |||
284 285 286 287 288 289 290 | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - |
function getSpellSuggestions (sWord, dInfo) {
if (!oDict) {
postMessage(createResponse("getSpellSuggestions", "# Error. Dictionary not loaded.", dInfo, true));
return;
}
let aSugg = oDict.suggest(sWord);
|
| ︙ |