Differences From Artifact [5a573a5745]:
- File graphspell-js/str_transform.js — part of check-in [45fdbe84fa] at 2020-09-14 13:29:25 on branch bdic_opt — [graphspell] distance Jaro-Winkler (user: olr, size: 13062) [annotate] [blame] [check-ins using]
To Artifact [8ec0376c2c]:
- File graphspell-js/str_transform.js — part of check-in [3b3a02f4d3] at 2020-09-15 13:50:00 on branch bdic_opt — [graphspell][js] suggest optimisation with Jaro-Winkler (thanks to IllusionPerdu) (user: olr, size: 13479) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
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");
},
_xTransNumbersToExponent: new Map([
["0", "⁰"], ["1", "¹"], ["2", "²"], ["3", "³"], ["4", "⁴"], ["5", "⁵"], ["6", "⁶"], ["7", "⁷"], ["8", "⁸"], ["9", "⁹"]
]),
numbersToExponent: function (sWord) {
let sNewWord = "";
| > > > > > > > > > > > > > | 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 |
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]]) {
| | | 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]]) {
N_simi += adjwt[a[i]][b[j]];
b_flag[j] = 2;
break;
}
}
}
}
}
|
| ︙ | ︙ |