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
51
52
53
54
55
|
else if (oToken["sValue"].search(/-l(?:es?|a)-(?:[mt]oi|nous|leur)$|(?:[nv]ous|lui|leur)-en$/) != -1) {
nEnd = oToken["sValue"].slice(0,nEnd).lastIndexOf("-");
}
}
return g_morph(oToken, sPattern, sNegPattern, 0, nEnd, false);
}
function rewriteSubject (s1, s2) {
// s1 is supposed to be prn/patr/npr (M[12P])
if (s2 == "lui") {
return "ils";
}
if (s2 == "moi") {
return "nous";
}
if (s2 == "toi") {
return "vous";
}
if (s2 == "nous") {
return "nous";
}
if (s2 == "vous") {
return "vous";
}
if (s2 == "eux") {
return "ils";
}
if (s2 == "elle" || s2 == "elles") {
if (cregex.mbNprMasNotFem(_oSpellChecker.getMorph(s1))) {
return "ils";
}
// si épicène, indéterminable, mais OSEF, le féminin l’emporte
return "elles";
}
return s1 + " et " + s2;
}
function apposition (sWord1, sWord2) {
// returns true if nom + nom (no agreement required)
return sWord2.length < 2 || (cregex.mbNomNotAdj(_oSpellChecker.getMorph(sWord2)) && cregex.mbPpasNomNotAdj(_oSpellChecker.getMorph(sWord1)));
}
function g_checkAgreement (oToken1, oToken2, bNotOnlyNames=true) {
// check agreement between <oToken1> and <oToken2>
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
else if (oToken["sValue"].search(/-l(?:es?|a)-(?:[mt]oi|nous|leur)$|(?:[nv]ous|lui|leur)-en$/) != -1) {
nEnd = oToken["sValue"].slice(0,nEnd).lastIndexOf("-");
}
}
return g_morph(oToken, sPattern, sNegPattern, 0, nEnd, false);
}
function apposition (sWord1, sWord2) {
// returns true if nom + nom (no agreement required)
return sWord2.length < 2 || (cregex.mbNomNotAdj(_oSpellChecker.getMorph(sWord2)) && cregex.mbPpasNomNotAdj(_oSpellChecker.getMorph(sWord1)));
}
function g_checkAgreement (oToken1, oToken2, bNotOnlyNames=true) {
// check agreement between <oToken1> and <oToken2>
|