Overview
| Comment: | [graphspell][js] suggest optimisation with Jaro-Winkler (thanks to IllusionPerdu) |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | graphspell | bdic_opt |
| Files: | files | file ages | folders |
| SHA3-256: |
3b3a02f4d385bf7b9d9c2ef3f992cc0c |
| User & Date: | olr on 2020-09-15 13:50:00 |
| Other Links: | branch diff | manifest | tags |
Context
|
2020-09-15
| ||
| 14:01 | [graphspell][js] remove specific trick in cleanWord() check-in: 6569849b49 user: olr tags: graphspell, bdic_opt | |
| 13:50 | [graphspell][js] suggest optimisation with Jaro-Winkler (thanks to IllusionPerdu) check-in: 3b3a02f4d3 user: olr tags: graphspell, bdic_opt | |
|
2020-09-14
| ||
| 14:38 | [graphspell] string comparison: use Jaro-Winkler check-in: efebe44d15 user: olr tags: graphspell, bdic_opt | |
Changes
Modified graphspell-js/char_player.js from [0602ec129b] to [8dac23cf9b].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + |
// list of similar chars
// useful for suggestion mechanism
/* jshint esversion:6 */
/* jslint esversion:6 */
${map}
var char_player = {
|
| ︙ |
Modified graphspell-js/ibdawg.js from [1cb5337715] to [2160aa77f7].
| ︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - + + - - - + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + - + + - - - + + + - + + + - - - + + + + + + - - - + + + + + + + + + - - + - + - - + + + |
var char_player = require("./char_player.js");
}
class SuggResult {
// Structure for storing, classifying and filtering suggestions
|
| ︙ | |||
327 328 329 330 331 332 333 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | - + + - + |
if (this.lexicographer) {
[sPfx, sWord, sSfx] = this.lexicographer.split(sWord);
}
let nMaxSwitch = Math.max(Math.floor(sWord.length / 3), 1);
let nMaxDel = Math.floor(sWord.length / 5);
let nMaxHardRepl = Math.max(Math.floor((sWord.length - 5) / 4), 1);
let nMaxJump = Math.max(Math.floor(sWord.length / 4), 1);
|
| ︙ |
Modified graphspell-js/str_transform.js from [5a573a5745] to [8ec0376c2c].
| ︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | + + + + + + + + + + + + + |
if (c != sWord.slice(i, i+1) || (c == 'e' && sWord.slice(i, i+2) != "ee")) { // exception for <e> to avoid confusion between crée / créai
sNewWord += c;
}
i++;
}
return sNewWord.replace(/eau/g, "o").replace(/au/g, "o").replace(/ai/g, "éi").replace(/ei/g, "é").replace(/ph/g, "f");
},
cleanWord: function (sWord) {
// word clean for the user who make commun and preditive error help suggest
// remove letters repeated more than 2 times
if (sWord.match(/(.)(\1){2,}/igm)){
sWord = sWord.replace(/(.*)(.)(.\2)/igm,'$1$2').replace(/(.)(\1)+/igm,'$1$1');
}
// words ending with -ik -> replace with -ique
if (sWord.match(/ik$/ig)){
sWord = sWord.replace(/(.*)ik$/ig,'$1ique');
}
return sWord;
},
_xTransNumbersToExponent: new Map([
["0", "⁰"], ["1", "¹"], ["2", "²"], ["3", "³"], ["4", "⁴"], ["5", "⁵"], ["6", "⁶"], ["7", "⁷"], ["8", "⁸"], ["9", "⁹"]
]),
numbersToExponent: function (sWord) {
let sNewWord = "";
|
| ︙ | |||
205 206 207 208 209 210 211 | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | - + |
let adjwt = char_player.oDistanceBetweenChars;
if (minv > Num_com) {
for (let i = 0; i < a_len; i++) {
if (!a_flag[i]) {
for (let j = 0; j < b_len; j++) {
if (!b_flag[j]) {
if (adjwt[a[i]] && adjwt[a[i]][b[j]]) {
|
| ︙ |