Grammalecte  Check-in [e4fab36fc5]

Overview
Comment:[core][build][fr] rename functions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | core | build
Files: files | file ages | folders
SHA3-256: e4fab36fc5b9267ff261f9f24e5ad89f4d2a0d2a3820cfc55ce9a3114021f914
User & Date: olr on 2020-11-25 21:26:13
Other Links: manifest | tags
Context
2020-11-25
21:38
[core] remove useless parameter check-in: bd591492d4 user: olr tags: trunk, core
21:26
[core][build][fr] rename functions check-in: e4fab36fc5 user: olr tags: trunk, fr, core, build
20:50
[graphspell][fr][fx] rename tokens check-in: 6aae160f81 user: olr tags: trunk, fr, fx, graphspell
Changes

Modified compile_rules.py from [7ee8916cfb] to [fc5d304819].

64
65
66
67
68
69
70
71
72


73
74
75
76
77
78
79
64
65
66
67
68
69
70


71
72
73
74
75
76
77
78
79







-
-
+
+







    s = re.sub(r"isRealStart0 *\(\)", 'before0("^ *$")', s)
    s = re.sub(r"isEnd *\(\)", 'after("^ *$|^,")', s)
    s = re.sub(r"isRealEnd *\(\)", 'after("^ *$")', s)
    s = re.sub(r"isEnd0 *\(\)", 'after0("^ *$|^,")', s)
    s = re.sub(r"isRealEnd0 *\(\)", 'after0("^ *$")', s)
    s = re.sub(r"(select|exclude)[(][\\](\d+)", '\\1(dTokenPos, m.start(\\2), m.group(\\2)', s)
    s = re.sub(r"define[(][\\](\d+)", 'define(dTokenPos, m.start(\\1)', s)
    s = re.sub(r"(morph|displayInfo)[(][\\](\d+)", '\\1((m.start(\\2), m.group(\\2))', s)
    s = re.sub(r"(morph|displayInfo)[(]", '\\1(dTokenPos, ', s)
    s = re.sub(r"(morph|info)[(][\\](\d+)", '\\1((m.start(\\2), m.group(\\2))', s)
    s = re.sub(r"(morph|info)[(]", '\\1(dTokenPos, ', s)
    s = re.sub(r"(sugg\w+|switch\w+)\(@", '\\1(m.group(i[4])', s)
    s = re.sub(r"word\(\s*1\b", 'nextword1(sSentence, m.end()', s)                                  # word(1)
    s = re.sub(r"word\(\s*-1\b", 'prevword1(sSentence, m.start()', s)                               # word(-1)
    s = re.sub(r"word\(\s*(\d)", 'nextword(sSentence, m.end(), \\1', s)                             # word(n)
    s = re.sub(r"word\(\s*-(\d)", 'prevword(sSentence, m.start(), \\1', s)                          # word(-n)
    s = re.sub(r"before\(\s*", 'look(sSentence[:m.start()], ', s)                                   # before(sSentence)
    s = re.sub(r"after\(\s*", 'look(sSentence[m.end():], ', s)                                      # after(sSentence)

Modified compile_rules_graph.py from [1d9a1d39be] to [dc34a23095].

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
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







-
-
+
+


















-
-
+
+







def rewriteCode (sCode):
    "convert simple code syntax to a string of Python code"
    if sCode[0:1] == "=":
        sCode = sCode[1:]
    sCode = sCode.replace("__also__", "bCondMemo")
    sCode = sCode.replace("__else__", "not bCondMemo")
    sCode = sCode.replace("sContext", "_sAppContext")
    sCode = re.sub(r"\b(morph|morphVC|analyse|value|tag|meta|displayInfo)[(]\\(\d+)", 'g_\\1(lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\b(morph|morphVC|analyse|value|tag|meta|displayInfo)[(]\\-(\d+)", 'g_\\1(lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"\b(morph|morphVC|analyse|value|tag|meta|info)[(]\\(\d+)", 'g_\\1(lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\b(morph|morphVC|analyse|value|tag|meta|info)[(]\\-(\d+)", 'g_\\1(lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"\b(select|exclude|define|define_from|rewrite|add_morph|change_meta)[(][\\](\d+)", 'g_\\1(lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\b(select|exclude|define|define_from|rewrite|add_morph|change_meta)[(][\\]-(\d+)", 'g_\\1(lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"\b(tag_before|tag_after)[(][\\](\d+)", 'g_\\1(lToken[nTokenOffset+\\2], dTags', sCode)
    sCode = re.sub(r"\b(tag_before|tag_after)[(][\\]-(\d+)", 'g_\\1(lToken[nLastToken-\\2+1], dTags', sCode)
    sCode = re.sub(r"\bspace_after[(][\\](\d+)", 'g_space_between_tokens(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\1+1]', sCode)
    sCode = re.sub(r"\bspace_after[(][\\]-(\d+)", 'g_space_between_tokens(lToken[nLastToken-\\1+1], lToken[nLastToken-\\1+2]', sCode)
    sCode = re.sub(r"\banalyse_with_next[(][\\](\d+)", 'g_merged_analyse(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\1+1]', sCode)
    sCode = re.sub(r"\banalyse_with_next[(][\\]-(\d+)", 'g_merged_analyse(lToken[nLastToken-\\1+1], lToken[nLastToken-\\1+2]', sCode)
    sCode = re.sub(r"\b(morph|analyse|tag|meta|value)\(>1", 'g_\\1(lToken[nLastToken+1]', sCode)                       # next token
    sCode = re.sub(r"\b(morph|analyse|tag|meta|value)\(<1", 'g_\\1(lToken[nTokenOffset]', sCode)                       # previous token
    sCode = re.sub(r"\b(morph|analyse|tag|meta|value)\(>(\d+)", 'g_\\1(g_token(lToken, nLastToken+\\2)', sCode)        # next token
    sCode = re.sub(r"\b(morph|analyse|tag|meta|value)\(<(\d+)", 'g_\\1(g_token(lToken, nTokenOffset+1-\\2)', sCode)    # previous token
    sCode = re.sub(r"\bspell *[(]", '_oSpellChecker.isValid(', sCode)
    sCode = re.sub(r"\bbefore\(\s*", 'look(sSentence[:lToken[1+nTokenOffset]["nStart"]], ', sCode)          # before(sCode)
    sCode = re.sub(r"\bafter\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode)                 # after(sCode)
    sCode = re.sub(r"\bbefore0\(\s*", 'look(sSentence0[:lToken[1+nTokenOffset]["nStart"]], ', sCode)        # before0(sCode)
    sCode = re.sub(r"\bafter0\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode)                # after0(sCode)
    sCode = re.sub(r"\banalyseWord[(]", 'analyse(', sCode)
    sCode = re.sub(r"\bcheckAgreement[(]\\(\d+), *\\(\d+)", 'g_checkAgreement(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\bcheckAgreement[(]\\(\d+), *\\-(\d+)", 'g_checkAgreement(lToken[nTokenOffset+\\1], lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"\bagreement[(]\\(\d+), *\\(\d+)", 'g_agreement(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\bagreement[(]\\(\d+), *\\-(\d+)", 'g_agreement(lToken[nTokenOffset+\\1], lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"[\\](\d+)", 'lToken[nTokenOffset+\\1]["sValue"]', sCode)
    sCode = re.sub(r"[\\]-(\d+)", 'lToken[nLastToken-\\1+1]["sValue"]', sCode)
    sCode = re.sub(r">1", 'lToken[nLastToken+1]["sValue"]', sCode)
    sCode = re.sub(r"<1", 'lToken[nTokenOffset]["sValue"]', sCode)
    return sCode


Modified gc_core/js/lang_core/gc_functions.js from [2b92bbcf40] to [4922b66d6d].

104
105
106
107
108
109
110
111

112
113
114
115
116
117
118
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118







-
+







    }
    return false;
}


//////// Analyse groups for regex rules

function displayInfo (dTokenPos, aWord) {
function info (dTokenPos, aWord) {
    // for debugging: info of word
    if (!aWord) {
        console.log("> nothing to find");
        return true;
    }
    let lMorph = gc_engine.oSpellChecker.getMorph(aWord[1]);
    if (lMorph.length === 0) {

Modified gc_core/py/lang_core/gc_functions.py from [da32688995] to [1dce18157c].

91
92
93
94
95
96
97
98

99
100
101
102
103
104
105
91
92
93
94
95
96
97

98
99
100
101
102
103
104
105







-
+







        return False
    return morph(dTokenPos, (nPos, sWord), sPatternGroup1, sNegPatternGroup1)



#### Analyse groups for regex rules

def displayInfo (dTokenPos, tWord):
def info (dTokenPos, tWord):
    "for debugging: retrieve info of word"
    if not tWord:
        echo("> nothing to find")
        return True
    lMorph = _oSpellChecker.getMorph(tWord[1])
    if not lMorph:
        echo("> not in dictionary")

Modified gc_lang/fr/modules-js/cregex.js from [e477cb5ed7] to [63b1a41c99].

82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96







-
+








    ///// FONCTIONS

    getLemmaOfMorph: function (sMorph) {
        return this._zLemma.exec(sMorph)[1];
    },

    checkAgreement: function (l1, l2) {
    agreement: function (l1, l2) {
        // check number agreement
        if (!this.mbInv(l1) && !this.mbInv(l2)) {
            if (this.mbSg(l1) && !this.mbSg(l2)) {
                return false;
            }
            if (this.mbPl(l1) && !this.mbPl(l2)) {
                return false;

Modified gc_lang/fr/modules-js/gce_analyseur.js from [ec9bd24475] to [822c4ce723].

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
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







-
+












-
+







}

function apposition (sWord1, sWord2) {
    // returns true if nom + nom (no agreement required)
    return sWord2.length < 2 || (cregex.mbNomNotAdj(gc_engine.oSpellChecker.getMorph(sWord2)) && cregex.mbPpasNomNotAdj(gc_engine.oSpellChecker.getMorph(sWord1)));
}

function g_checkAgreement (oToken1, oToken2, bNotOnlyNames=true) {
function g_agreement (oToken1, oToken2, bNotOnlyNames=true) {
    // check agreement between <oToken1> and <oToken2>
    let lMorph1 = oToken1.hasOwnProperty("lMorph") ? oToken1["lMorph"] : gc_engine.oSpellChecker.getMorph(oToken1["sValue"]);
    if (lMorph1.length === 0) {
        return true;
    }
    let lMorph2 = oToken2.hasOwnProperty("lMorph") ? oToken2["lMorph"] : gc_engine.oSpellChecker.getMorph(oToken2["sValue"]);
    if (lMorph2.length === 0) {
        return true;
    }
    if (bNotOnlyNames && !(cregex.mbAdj(lMorph2) || cregex.mbAdjNb(lMorph1))) {
        return false;
    }
    return cregex.checkAgreement(lMorph1, lMorph2);
    return cregex.agreement(lMorph1, lMorph2);
}

function mbUnit (s) {
    if (/[µ\/⁰¹²³⁴⁵⁶⁷⁸⁹Ωℓ·]/.test(s)) {
        return true;
    }
    if (s.length > 1 && s.length < 16 && s.slice(0, 1).gl_isLowerCase() && (!s.slice(1).gl_isLowerCase() || /[0-9]/.test(s))) {

Modified gc_lang/fr/modules/cregex.py from [297fc71806] to [552bd47629].

81
82
83
84
85
86
87
88

89
90
91
92
93
94
95
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95







-
+








#### FONCTIONS

def getLemmaOfMorph (s):
    "return lemma in morphology <s>"
    return Lemma.search(s).group(1)

def checkAgreement (l1, l2):
def agreement (l1, l2):
    "returns True if agreement in gender and number is possible between morphologies <l1> and <l2>"
    # check number agreement
    if not mbInv(l1) and not mbInv(l2):
        if mbSg(l1) and not mbSg(l2):
            return False
        if mbPl(l1) and not mbPl(l2):
            return False

Modified gc_lang/fr/modules/gce_analyseur.py from [f2364f5e33] to [6a83d3b431].

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
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







-
+









-
+









def apposition (sWord1, sWord2):
    "returns True if nom + nom (no agreement required)"
    return len(sWord2) < 2 or (cr.mbNomNotAdj(_oSpellChecker.getMorph(sWord2)) and cr.mbPpasNomNotAdj(_oSpellChecker.getMorph(sWord1)))


def g_checkAgreement (dToken1, dToken2, bNotOnlyNames=True):
def g_agreement (dToken1, dToken2, bNotOnlyNames=True):
    "check agreement between <dToken1> and <dToken2>"
    lMorph1 = dToken1["lMorph"]  if "lMorph" in dToken1  else  _oSpellChecker.getMorph(dToken1["sValue"])
    if not lMorph1:
        return True
    lMorph2 = dToken2["lMorph"]  if "lMorph" in dToken2  else  _oSpellChecker.getMorph(dToken2["sValue"])
    if not lMorph2:
        return True
    if bNotOnlyNames and not (cr.mbAdj(lMorph2) or cr.mbAdjNb(lMorph1)):
        return False
    return cr.checkAgreement(lMorph1, lMorph2)
    return cr.agreement(lMorph1, lMorph2)


_zUnitSpecial = re.compile("[µ/⁰¹²³⁴⁵⁶⁷⁸⁹Ωℓ·]")
_zUnitNumbers = re.compile("[0-9]")

def mbUnit (s):
    "returns True it can be a measurement unit"

Modified gc_lang/fr/rules.grx from [6feac788e5] to [f8fdf0f604].

22978
22979
22980
22981
22982
22983
22984
22985

22986
22987
22988
22989
22990
22991
22992
22978
22979
22980
22981
22982
22983
22984

22985
22986
22987
22988
22989
22990
22991
22992







-
+







    des  *WORD  *WORD
        <<- /gn/ (morph(<1, ":(?:[VRBXÉ]|Cs)|>comme/|<start>|>,", "*") or morph(\3, ":N", ":[AQ]")) and not morph(\3, ">(?:seul|minimum|maximum)/") >>>
        <<- /gn/ ( (morph(\2, ":[NA].*:m", ":[fe]") and morph(\3, ":[NA].*:f", "*")) or (morph(\2, ":[NA].*:f", ":[me]") and morph(\3, ":[NA].*:m", "*")) ) and not apposition(\2, \3)
        -3>> =switchGender(\3, True)                                                                && Accord de genre erroné avec « \2 ».
        <<- /gn/ __also__ and hasFemForm(\2) -2>> =switchGender(\2)                                 && Accord de genre erroné avec « \3 ».
        <<- /gn/ morph(\2, ":[NA].*:[pi]", ":G") and morph(\3, ":[NA].*:s", "*") and not apposition(\2, \3) and not (value(>1, "|et|,|") and morph(>2, ":A"))
        -3>> =suggPlur(\3)                                                                          && Accord de nombre erroné avec « \1 \2 » : « \3 » devrait être au pluriel.
        <<- not morph(\3, ":G|>a/") and checkAgreement(\2, \3) =>> =exclude(\3, ":V")
        <<- not morph(\3, ":G|>a/") and agreement(\2, \3) =>> =exclude(\3, ":V")

TEST: faire table rase des passions {{inutile}}               ->> inutiles
TEST: à bonne distance des {{chiens}} {{méchante}}
TEST: des hommes {{attaquée}}
TEST: des femmes {{agressé}}
TEST: des hommes très mal {{renseigné}}                       ->> renseignés
TEST: des dépenses non {{nécessaire}}                         ->> nécessaires
27876
27877
27878
27879
27880
27881
27882
27883

27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894

27895
27896
27897
27898
27899
27900
27901
27876
27877
27878
27879
27880
27881
27882

27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893

27894
27895
27896
27897
27898
27899
27900
27901







-
+










-
+







        || [être|devenir|redevenir|rester|paraître|paraitre|sembler]                                *WORD
    *WORD  [que|qu’]  [un|le|ce|cet|une|la|ma|ta|sa|cette|l’|mon|ton|son|notre|votre|leur|les|ces|mes|tes|ses|nos|vos|leurs|quelques|plusieurs|$:B]  *WORD  ?[ne|n’]¿  ?[en|y]¿
        || ([>affirmer|>croire|>déclarer|>désirer|>détester|>dire|>estimer|>imaginer|>penser|>préférer|>savoir|>souhaiter|>vouloir])
        || être [devenu+e|redevenu+e|resté+e|demeuré+e]                                             *WORD
    *WORD  [que|qu’]  [un|le|ce|cet|une|la|ma|ta|sa|cette|l’|mon|ton|son|notre|votre|leur|les|ces|mes|tes|ses|nos|vos|leurs|quelques|plusieurs|$:B]  *WORD  ?[ne|n’]¿  ?[en|y]¿
        || ([>affirmer|>croire|>déclarer|>désirer|>détester|>dire|>estimer|>imaginer|>penser|>préférer|>savoir|>souhaiter|>vouloir])
        || avoir [été|semblé|paru]                                                                  *WORD
        <<- /ppas/ checkAgreement(\1, \-1) !-1>>
        <<- /ppas/ agreement(\1, \-1) !-1>>

    *WORD  [que|qu’]  $:M  ?[ne|n’]¿
        || ([>affirmer|>croire|>déclarer|>désirer|>détester|>dire|>estimer|>imaginer|>penser|>préférer|>savoir|>souhaiter|>vouloir])
        || [être|devenir|redevenir|rester|paraître|paraitre|sembler]                                *WORD
    *WORD  [que|qu’]  $:M  ?[ne|n’]¿
        || ([>affirmer|>croire|>déclarer|>désirer|>détester|>dire|>estimer|>imaginer|>penser|>préférer|>savoir|>souhaiter|>vouloir])
        || être [devenu+e|redevenu+e|resté+e|demeuré+e]                                             *WORD
    *WORD  [que|qu’]  $:M  ?[ne|n’]¿
        || ([>affirmer|>croire|>déclarer|>désirer|>détester|>dire|>estimer|>imaginer|>penser|>préférer|>savoir|>souhaiter|>vouloir])
        || avoir [été|semblé|paru]                                                                  *WORD
        <<- /ppas/ checkAgreement(\1, \-1) !-1>>
        <<- /ppas/ agreement(\1, \-1) !-1>>


__ppas_sujet_être_accord_singulier__
    [<start>|,|(|/_start_]  [un|le|ce|cet]  (*WORD)  ?qui¿  ?[ne|n’]¿  ?[en|y]¿          (/_VE_)                                                @:[AQ]¬:(?:[GWM]|[me]:[si])
    [<start>|,|(|/_start_]  [un|le|ce|cet]  (*WORD)  ?qui¿  ?[ne|n’]¿  ?[en|y]¿          (/_LVED_) ?/_LVE_¿ ?/_LVE_¿ ?/_LVE_¿ ?/_LVE_¿ /_LVEF_  @:[AQ]¬:(?:[GWM]|[me]:[si])
    [<start>|,|(|/_start_]  [un|le|ce|cet]  (*WORD)  ?qui¿  ?[ne|n’]¿  [se|s’] ?[en|y]¿  (/_VEP_)                                               @:[AQ]¬:(?:[GWM]|[me]:[si])
    [<start>|,|(|/_start_]  [un|le|ce|cet]  (*WORD)  ?qui¿  ?[ne|n’]¿  [se|s’] ?[en|y]¿  (/_LVEPD_) ?/_LVEP_¿ ?/_LVEP_¿ ?/_LVEP_¿ /_LVEPF_      @:[AQ]¬:(?:[GWM]|[me]:[si])
30889
30890
30891
30892
30893
30894
30895
30896

30897
30898
30899
30900
30901
30902
30903
30889
30890
30891
30892
30893
30894
30895

30896
30897
30898
30899
30900
30901
30902
30903







-
+







TEST: y être sans ma femme ni les enfants fait monter en moi une certaine nervosité.


__conj_le_la_leur_nom__
    [le|la|l’|leur]  *WORD  @:V¬:(?:3s|P|Q|Y|3p!|G|M)
        <<- /conj/ not tag(\2, "_enum_") and morph(<1, ":C|<start>|>,", ":[YP]") and morph(\2, ":[NA].*:[si]", ":G")
            and not ( (value(\2, "|dizaine|douzaine|quinzaine|vingtaine|trentaine|quarantaine|cinquantaine|soixantaine|centaine|majorité|minorité|millier|partie|poignée|tas|paquet|moitié|")
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not checkAgreement(\2, \3)
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not agreement(\2, \3)
            and not ( morph(\2, "(?:[123][sp]|P)") and not value(<1, "|<start>|,|") ) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:p") or (morph(\3, ":N.*:p") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3s", suggSing)                                                         && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3s")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du singulier.

    [le|la|l’|leur]  *WORD  qui  @:V¬:(?:3s|P|3p!|G|M)
        <<- /conj/ not tag(\2, "_enum_") and morph(<1, ":C|<start>|>,", ":[YP]") and morph(\2, ":[NA].*:[si]", ":G")
30938
30939
30940
30941
30942
30943
30944
30945

30946
30947
30948
30949
30950
30951
30952
30953

30954
30955
30956
30957
30958
30959
30960
30938
30939
30940
30941
30942
30943
30944

30945
30946
30947
30948
30949
30950
30951
30952

30953
30954
30955
30956
30957
30958
30959
30960







-
+







-
+







TEST: un grand nombre avaient été humiliés par ces pratiques délétères


__conj_det_sing_nom__
    [un|ce|cet|mon|ton|son|notre|votre]  *WORD  @:[123][sp]¬:(?:3s|P|Y|3p!|G|M)
        <<- /conj/ not tag(\2, "_enum_") and morph(<1, ":C|<start>|>,", ":[YP]") and morph(\2, ":[NA].*:[me]:[si]", ":G")
            and not ( (value(\2, "|dizaine|douzaine|quinzaine|vingtaine|trentaine|quarantaine|cinquantaine|soixantaine|centaine|majorité|minorité|millier|partie|poignée|tas|paquet|moitié|nombre|")
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not checkAgreement(\2, \3) >>>
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not agreement(\2, \3) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:p") or (morph(\3, ":N.*:p") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3s", suggSing)                                                         && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3s")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du singulier.

    [une|cette|mon|ton|son|ma|ta|sa|notre|votre]  *WORD  @:[123][sp]¬:(?:3s|P|Y|3p!|G|M)
        <<- /conj/ not tag(\2, "_enum_") and morph(<1, ":C|<start>|>,", ":[YP]") and morph(\2, ":[NA].*:[fe]:[si]", ":G")
            and not ( (value(\2, "|dizaine|douzaine|quinzaine|vingtaine|trentaine|quarantaine|cinquantaine|soixantaine|centaine|majorité|minorité|millier|partie|poignée|tas|paquet|moitié|")
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not checkAgreement(\2, \3) >>>
                        or tag_before(\1, "_ni_") or value(<1, "|et|ou|")) and morph(\3, ":3?p") ) and not agreement(\2, \3) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:p") or (morph(\3, ":N.*:p") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3s", suggSing)                                                         && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3s")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du singulier.

    [un|une|ce|cet|cette|mon|ton|son|ma|ta|sa|notre|votre]  *WORD  qui  @:V¬:(?:3s|P|3p!|G|M)
        <<- /conj/ not tag(\2, "_enum_") and morph(<1, ":C|<start>|>,", ":[YP]") and morph(\2, ":[NA].*:[si]", ":G")
            and not ( (value(\2, "|dizaine|douzaine|quinzaine|vingtaine|trentaine|quarantaine|cinquantaine|soixantaine|centaine|majorité|minorité|millier|partie|poignée|tas|paquet|moitié|")
31292
31293
31294
31295
31296
31297
31298
31299

31300
31301
31302
31303
31304
31305
31306
31292
31293
31294
31295
31296
31297
31298

31299
31300
31301
31302
31303
31304
31305
31306







-
+







TEST: Tu penses que quelqu’un qui frappe sa femme et ses enfants est un bon père ?


__conj_les_nom__
    les  @:[NA].*:[pi]¬:V0  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
            and not ( morph(\3, ":3s") and before("(?i)\\b(?:l[ea] |l’|une? |ce(?:tte|t|) |[mts](?:on|a) |[nv]otre ).+ entre .+ et ") )
            and not checkAgreement(\2, \3)
            and not agreement(\2, \3)
            and not ( morph(\2, "(?:[123][sp]|P)") and not value(<1, "|<start>|,|") ) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:s") or (morph(\3, ":N.*:s") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3p", suggPlur)                                                         && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3p")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    les  @:[NA].*:[pi]  qui  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
31346
31347
31348
31349
31350
31351
31352
31353

31354
31355
31356
31357
31358
31359
31360
31361
31362

31363
31364
31365
31366
31367
31368
31369
31370
31371

31372
31373
31374
31375
31376
31377
31378
31346
31347
31348
31349
31350
31351
31352

31353
31354
31355
31356
31357
31358
31359
31360
31361

31362
31363
31364
31365
31366
31367
31368
31369
31370

31371
31372
31373
31374
31375
31376
31377
31378







-
+








-
+








-
+







TEST: les souris enceintes


__conj_certains_certaines_plusieurs_nom__
    [certains|maints]  @:[NA].*:[pi]  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
            and not( morph(\3, ":3s") and before("(?i)\\b(?:l[ea] |l’|une? |ce(?:tte|t|) |[mts](?:on|a) |[nv]otre ).+ entre .+ et ") )
            and not checkAgreement(\2, \3)
            and not agreement(\2, \3)
            and not ( morph(\2, "(?:[123][sp]|P)") and not value(<1, "|<start>|,|") ) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:s") or (morph(\3, ":N.*:s") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3p", suggMasPlur)                                                      && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3p")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    [certaines|maintes]  @:[NA].*:[pi]  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
            and not( morph(\3, ":3s") and before("(?i)\\b(?:l[ea] |l’|une? |ce(?:tte|t|) |[mts](?:on|a) |[nv]otre ).+ entre .+ et ") )
            and not checkAgreement(\2, \3)
            and not agreement(\2, \3)
            and not ( morph(\2, "(?:[123][sp]|P)") and not value(<1, "|<start>|,|") ) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:s") or (morph(\3, ":N.*:s") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3p", suggFemPlur)                                                      && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3p")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    plusieurs  @:[NA].*:[pi]  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
            and not( morph(\3, ":3s") and before("(?i)\\b(?:l[ea] |l’|une? |ce(?:tte|t|) |[mts](?:on|a) |[nv]otre ).+ entre .+ et ") )
            and not checkAgreement(\2, \3)
            and not agreement(\2, \3)
            and not ( morph(\2, "(?:[123][sp]|P)") and not value(<1, "|<start>|,|") ) >>>
        <<- /conj/ not tag(\-1, "_ngn_") and morph(\3, ":A.*:s") or (morph(\3, ":N.*:s") and morph(\2, ":A"))
        -3>> =suggVerb(\3, ":3p", suggPlur)                                                         && Accord avec “\1 \2…” incorrect. Conjugaison erronée ou accord nom/adjectif incorrect.
        <<- /conj/ __else__ -3>> =suggVerb(\3, ":3p")                                               && Conjugaison erronée. Accord avec “\1 \2…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    [certains|certaines|plusieurs|maints|maintes]  @:[NA].*:[pi]  qui  @:V¬:(?:3p|P|Y|G|M)
        <<- /conj/ morph(<1, ":Cs|<start>|>,")
31395
31396
31397
31398
31399
31400
31401
31402

31403
31404
31405
31406
31407
31408
31409
31395
31396
31397
31398
31399
31400
31401

31402
31403
31404
31405
31406
31407
31408
31409







-
+







TEST: certains imbéciles passés à l’ennemi feraient mieux de se taire.


__conj_des_nom__
    [<start>|,|(]  des  @:[NA].*:[pi]  @:V¬:(?:3p|P|G|Q|Y|A.*:[pi]|V[23].*:Y)
        <<- /conj/ morph(>1, ":(?:R|D.*:p)|>au/|<end>|>,") >>>
        <<- /conj/ not morph(\4, ":[NA]") -4>> =suggVerb(\4, ":3p")                                 && Conjugaison erronée. Accord avec “\2 \3…”. Le verbe devrait être à la 3ᵉ personne du pluriel.
        <<- /conj/ __else__ and not checkAgreement(\3, \4) -4>> =suggVerb(\4, ":3p", suggPlur)      && Conjugaison erronée. Accord avec “\2 \3…”. Le verbe devrait être à la 3ᵉ personne du pluriel.
        <<- /conj/ __else__ and not agreement(\3, \4) -4>> =suggVerb(\4, ":3p", suggPlur)           && Conjugaison erronée. Accord avec “\2 \3…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    [<start>|,|(]  des  @:[NA].*:[pi]  qui  @:V¬:(?:3p|P|G)
        <<- /conj/ -5>> =suggVerb(\5, ":3p")                                                        && Conjugaison erronée. Accord avec “\2 \3 \4…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

    *WORD  des  @:[NA].*:[pi]  qui  @:V¬:(?:3p|P|G)
        <<- /conj/ morph(\1, ":[VR]", ":[NA]") --1>> =suggVerb(\-1, ":3p")                          && Conjugaison erronée. Accord avec “\2 \3 \4…”. Le verbe devrait être à la 3ᵉ personne du pluriel.

Modified misc/grammalecte.sublime-syntax from [90c3fa5c9d] to [3aba4c4214].

56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70







-
+







    # other.
    - match: '\b(?:if|else|and|or|not|in)\b'
      scope: keyword.python

    - match: '\b(?:True|False|None)\b'
      scope: constant.language

    - match: '\b(?:spell|morph|morphVC|stem|tag|value|space_after|textarea0?\w*|before0?\w*|after0?\w*|word|option|define|define_from|select|exclude|analyse\w*|tag_\w+|apposition|is[A-Z]\w+|checkAgreement|rewrite|checkD\w+|getD\w+|has[A-Z]\w+|sugg[A-Z]\w+|switch[A-Z]\w+|ceOrCet|formatN\w+|mbUnit)\b'
    - match: '\b(?:spell|morph|morphVC|stem|tag|value|space_after|textarea0?\w*|before0?\w*|after0?\w*|word|option|define|define_from|select|exclude|analyse\w*|tag_\w+|apposition|is[A-Z]\w+|agreement|rewrite|checkD\w+|getD\w+|has[A-Z]\w+|sugg[A-Z]\w+|switch[A-Z]\w+|ceOrCet|formatN\w+|mbUnit)\b'
      scope: entity.name.function

    - match: '\b(?:replace|endswith|startswith|search|upper|lower|capitalize|strip|rstrip|is(?:alpha|upper|lower|digit|title))\b'
      scope: support.function

    - match: '\becho\b'
      scope: support.function.debug