Grammalecte  Check-in [0df82b3083]

Overview
Comment:[core] change comment to avoid useless code validator warnings
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core
Files: files | file ages | folders
SHA3-256: 0df82b3083f66622c43697f49f5b46362157911155cc1153751af82544a38da7
User & Date: olr on 2021-01-29 14:34:03
Other Links: manifest | tags
Context
2021-01-29
15:00
[server] update bottle.py check-in: dfc463e07d user: olr tags: server, trunk
14:34
[core] change comment to avoid useless code validator warnings check-in: 0df82b3083 user: olr tags: core, trunk
11:51
[fr] faux positifs et ajustements check-in: 1e2de42383 user: olr tags: fr, trunk
Changes

Modified gc_core/js/lang_core/gc_engine.js from [a05d9994e2] to [04cf68e8aa].

396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
        try {
            let bTokenFound = false;
            // token value
            if (oNode.hasOwnProperty(oToken["sValue"])) {
                yield [" ", oToken["sValue"], oNode[oToken["sValue"]]];
                bTokenFound = true;
            }
            if (oToken["sValue"].slice(0,2).gl_isTitle()) { // we test only 2 first chars, to make valid words such as "Laissez-les", "Passe-partout".
                let sValue = oToken["sValue"].toLowerCase();
                if (oNode.hasOwnProperty(sValue)) {
                    yield [" ", sValue, oNode[sValue]];
                    bTokenFound = true;
                }
            }
            else if (oToken["sValue"].gl_isUpperCase()) {







|







396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
        try {
            let bTokenFound = false;
            // token value
            if (oNode.hasOwnProperty(oToken["sValue"])) {
                yield [" ", oToken["sValue"], oNode[oToken["sValue"]]];
                bTokenFound = true;
            }
            if (oToken["sValue"].slice(0,2).gl_isTitle()) {
                let sValue = oToken["sValue"].toLowerCase();
                if (oNode.hasOwnProperty(sValue)) {
                    yield [" ", sValue, oNode[sValue]];
                    bTokenFound = true;
                }
            }
            else if (oToken["sValue"].gl_isUpperCase()) {

Modified gc_core/js/lang_core/gc_functions.js from [7edc6f08c2] to [75a3af0350].

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

function g_value (oToken, sValues, nLeft=null, nRight=null) {
    // test if <oToken['sValue']> is in sValues (each value should be separated with |)
    let sValue = (nLeft === null) ? "|"+oToken["sValue"]+"|" : "|"+oToken["sValue"].slice(nLeft, nRight)+"|";
    if (sValues.includes(sValue)) {
        return true;
    }
    if (oToken["sValue"].slice(0,2).gl_isTitle()) { // we test only 2 first chars, to make valid words such as "Laissez-les", "Passe-partout".
        if (sValues.includes(sValue.toLowerCase())) {
            return true;
        }
    }
    else if (oToken["sValue"].gl_isUpperCase()) {
        //if sValue.lower() in sValues:
        //    return true;







|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

function g_value (oToken, sValues, nLeft=null, nRight=null) {
    // test if <oToken['sValue']> is in sValues (each value should be separated with |)
    let sValue = (nLeft === null) ? "|"+oToken["sValue"]+"|" : "|"+oToken["sValue"].slice(nLeft, nRight)+"|";
    if (sValues.includes(sValue)) {
        return true;
    }
    if (oToken["sValue"].slice(0,2).gl_isTitle()) {
        if (sValues.includes(sValue.toLowerCase())) {
            return true;
        }
    }
    else if (oToken["sValue"].gl_isUpperCase()) {
        //if sValue.lower() in sValues:
        //    return true;

Modified gc_core/py/lang_core/gc_engine.py from [da8987b870] to [ce7092fc44].

403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
    def _getMatches (self, dGraph, dToken, dNode, bKeep=False):
        "generator: return matches where <dToken> “values” match <dNode> arcs"
        bTokenFound = False
        # token value
        if dToken["sValue"] in dNode:
            yield (" ", dToken["sValue"], dNode[dToken["sValue"]])
            bTokenFound = True
        if dToken["sValue"][0:2].istitle(): # we test only 2 first chars, to make valid words such as "Laissez-les", "Passe-partout".
            sValue = dToken["sValue"].lower()
            if sValue in dNode:
                yield (" ", sValue, dNode[sValue])
                bTokenFound = True
        elif dToken["sValue"].isupper():
            sValue = dToken["sValue"].lower()
            if sValue in dNode:







|







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
    def _getMatches (self, dGraph, dToken, dNode, bKeep=False):
        "generator: return matches where <dToken> “values” match <dNode> arcs"
        bTokenFound = False
        # token value
        if dToken["sValue"] in dNode:
            yield (" ", dToken["sValue"], dNode[dToken["sValue"]])
            bTokenFound = True
        if dToken["sValue"][0:2].istitle(): # we test only 2 first chars, to match words such as "Laissez-les", "Crève-cœur".
            sValue = dToken["sValue"].lower()
            if sValue in dNode:
                yield (" ", sValue, dNode[sValue])
                bTokenFound = True
        elif dToken["sValue"].isupper():
            sValue = dToken["sValue"].lower()
            if sValue in dNode:

Modified gc_core/py/lang_core/gc_functions.py from [8d220fa67a] to [f53748ec4f].

167
168
169
170
171
172
173
174
175
176
177
178
179
180
181


def g_value (dToken, sValues, nLeft=None, nRight=None):
    "test if <dToken['sValue']> is in sValues (each value should be separated with |)"
    sValue = "|"+dToken["sValue"]+"|"  if nLeft is None  else "|"+dToken["sValue"][slice(nLeft, nRight)]+"|"
    if sValue in sValues:
        return True
    if dToken["sValue"][0:2].istitle(): # we test only 2 first chars, to make valid words such as "Laissez-les", "Passe-partout".
        if sValue.lower() in sValues:
            return True
    elif dToken["sValue"].isupper():
        #if sValue.lower() in sValues:
        #    return True
        sValue = "|"+sValue[1:].capitalize()
        if sValue in sValues:







|







167
168
169
170
171
172
173
174
175
176
177
178
179
180
181


def g_value (dToken, sValues, nLeft=None, nRight=None):
    "test if <dToken['sValue']> is in sValues (each value should be separated with |)"
    sValue = "|"+dToken["sValue"]+"|"  if nLeft is None  else "|"+dToken["sValue"][slice(nLeft, nRight)]+"|"
    if sValue in sValues:
        return True
    if dToken["sValue"][0:2].istitle(): # we test only 2 first chars, to match words such as "Laissez-les", "Crève-cœur".
        if sValue.lower() in sValues:
            return True
    elif dToken["sValue"].isupper():
        #if sValue.lower() in sValues:
        #    return True
        sValue = "|"+sValue[1:].capitalize()
        if sValue in sValues: