Grammalecte  Check-in [999ac69c3f]

Overview
Comment:[core][js][bug] fix word slicing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: 999ac69c3fa9e55bb44a3c54f1b956d86988be0d61d4f824fe4344100aa5483e
User & Date: olr on 2018-09-19 11:26:07
Original Comment: [core][js][bug] fix wrod slicing
Other Links: branch diff | manifest | tags
Context
2018-09-19
13:18
[core][js] fix disambiguation check-in: 3be8b61d5a user: olr tags: core, rg
11:26
[core][js][bug] fix word slicing check-in: 999ac69c3f user: olr tags: core, rg
08:59
[fr] de pied en cap + faux positifs avec tâche check-in: ddca4cc901 user: olr tags: fr, rg
Changes

Modified gc_core/js/lang_core/gc_engine.js from [10319254e1] to [aa97358578].

1120
1121
1122
1123
1124
1125
1126

1127

1128
1129
1130
1131
1132
1133
1134
1120
1121
1122
1123
1124
1125
1126
1127

1128
1129
1130
1131
1132
1133
1134
1135







+
-
+







    // analyse a token, return True if <sNegPattern> not in morphologies and <sPattern> in morphologies
    let lMorph;
    if (dToken.hasOwnProperty("lMorph")) {
        lMorph = dToken["lMorph"];
    }
    else {
        if (nLeft !== null) {
            let sValue = (nRight !== null) ? dToken["sValue"].slice(nLeft, nRight) : dToken["sValue"].slice(nLeft);
            lMorph = _oSpellChecker.getMorph(dToken["sValue"].slice(nLeft, nRight));
            lMorph = _oSpellChecker.getMorph(sValue);
            if (bMemorizeMorph) {
                dToken["lMorph"] = lMorph;
            }
        } else {
            lMorph = _oSpellChecker.getMorph(dToken["sValue"]);
        }
    }
1151
1152
1153
1154
1155
1156
1157

1158

1159
1160
1161
1162
1163
1164
1165
1152
1153
1154
1155
1156
1157
1158
1159

1160
1161
1162
1163
1164
1165
1166
1167







+
-
+







    return lMorph.some(sMorph  =>  (sMorph.search(sPattern) !== -1));
}

function g_analyse (dToken, sPattern, sNegPattern="", nLeft=null, nRight=null, bMemorizeMorph=true) {
    // analyse a token, return True if <sNegPattern> not in morphologies and <sPattern> in morphologies
    let lMorph;
    if (nLeft !== null) {
        let sValue = (nRight !== null) ? dToken["sValue"].slice(nLeft, nRight) : dToken["sValue"].slice(nLeft);
        lMorph = _oSpellChecker.getMorph(dToken["sValue"].slice(nLeft, nRight));
        lMorph = _oSpellChecker.getMorph(sValue);
        if (bMemorizeMorph) {
            dToken["lMorph"] = lMorph;
        }
    } else {
        lMorph = _oSpellChecker.getMorph(dToken["sValue"]);
    }
    if (lMorph.length == 0) {