︙ | | | ︙ | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
_dImpePro: new Map ([ [":2s", "-toi"], [":1p", "-nous"], [":2p", "-vous"] ]),
_dImpeProNeg: new Map ([ [":2s", "ne te "], [":1p", "ne nous "], [":2p", "ne vous "] ]),
_dImpeProEn: new Map ([ [":2s", "-t’en"], [":1p", "-nous-en"], [":2p", "-vous-en"] ]),
_dImpeProNegEn: new Map ([ [":2s", "ne t’en "], [":1p", "ne nous en "], [":2p", "ne vous en "] ]),
_dGroup: new Map ([ ["0", "auxiliaire"], ["1", "1ᵉʳ groupe"], ["2", "2ᵉ groupe"], ["3", "3ᵉ groupe"] ]),
_dTenseIdx: new Map ([ [":PQ", 0], [":Ip", 1], [":Iq", 2], [":Is", 3], [":If", 4], [":K", 5], [":Sp", 6], [":Sq", 7], [":E", 8] ]),
isVerb: function (sVerb) {
return this._dVerb.hasOwnProperty(sVerb);
},
getConj: function (sVerb, sTense, sWho) {
// returns conjugation (can be an empty string)
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
_dImpePro: new Map ([ [":2s", "-toi"], [":1p", "-nous"], [":2p", "-vous"] ]),
_dImpeProNeg: new Map ([ [":2s", "ne te "], [":1p", "ne nous "], [":2p", "ne vous "] ]),
_dImpeProEn: new Map ([ [":2s", "-t’en"], [":1p", "-nous-en"], [":2p", "-vous-en"] ]),
_dImpeProNegEn: new Map ([ [":2s", "ne t’en "], [":1p", "ne nous en "], [":2p", "ne vous en "] ]),
_dGroup: new Map ([ ["0", "auxiliaire"], ["1", "1ᵉʳ groupe"], ["2", "2ᵉ groupe"], ["3", "3ᵉ groupe"] ]),
_dTenseIdx: new Map ([ [":P", 0], [":Q", 1], [":Ip", 2], [":Iq", 3], [":Is", 4], [":If", 5], [":K", 6], [":Sp", 7], [":Sq", 8], [":E", 9] ]),
isVerb: function (sVerb) {
return this._dVerb.hasOwnProperty(sVerb);
},
getConj: function (sVerb, sTense, sWho) {
// returns conjugation (can be an empty string)
|
︙ | | | ︙ | |
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
if (this._dVerbNames.hasOwnProperty(sVerb)) {
// there are names derivated from the verb
return this._dVerbNames[sVerb];
} else {
// we suggest past participles
let tTags = this._getTags(sVerb);
if (tTags) {
let aSugg = [ this._getConjWithTags(sVerb, tTags, ":PQ", ":Q1") ];
if (this._hasConjWithTags(tTags, ":PQ", ":Q2")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":PQ", ":Q2"));
}
if (this._hasConjWithTags(tTags, ":PQ", ":Q3")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":PQ", ":Q3"));
}
if (this._hasConjWithTags(tTags, ":PQ", ":Q4")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":PQ", ":Q4"));
}
// if there is only one past participle (epi inv), unreliable.
return (aSugg.length > 1) ? aSugg : [];
}
return [];
}
},
|
|
|
|
|
|
|
|
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
if (this._dVerbNames.hasOwnProperty(sVerb)) {
// there are names derivated from the verb
return this._dVerbNames[sVerb];
} else {
// we suggest past participles
let tTags = this._getTags(sVerb);
if (tTags) {
let aSugg = [ this._getConjWithTags(sVerb, tTags, ":Q", ":m:s") ];
if (this._hasConjWithTags(tTags, ":Q", ":f:s")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":Q", ":f:s"));
}
if (this._hasConjWithTags(tTags, ":Q", ":m:p")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":Q", ":m:p"));
}
if (this._hasConjWithTags(tTags, ":Q", ":f:p")) {
aSugg.push(this._getConjWithTags(sVerb, tTags, ":Q", ":f:p"));
}
// if there is only one past participle (epi inv), unreliable.
return (aSugg.length > 1) ? aSugg : [];
}
return [];
}
},
|
︙ | | | ︙ | |
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
} else {
this.sProLabel = "# erreur #";
this.nPronominable = -1;
}
this.dConj = new Map ([
[":Y", new Map ([
["label", "Infinitif"],
[":", sVerb]
])],
[":P", new Map ([
["label", "Participe présent"],
[":", conj._getConjWithTags(sVerb, this._tTags, ":PQ", ":P")]
])],
[":Q", new Map ([
["label", "Participes passés"],
[":Q1", conj._getConjWithTags(sVerb, this._tTags, ":PQ", ":Q1")],
[":Q2", conj._getConjWithTags(sVerb, this._tTags, ":PQ", ":Q2")],
[":Q3", conj._getConjWithTags(sVerb, this._tTags, ":PQ", ":Q3")],
[":Q4", conj._getConjWithTags(sVerb, this._tTags, ":PQ", ":Q4")],
])],
[":Ip", new Map ([
["label", "Présent"],
[":1s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":1s")],
[":1ś", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":1ś")],
[":2s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":2s")],
[":3s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":3s")],
|
|
|
|
|
|
|
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
} else {
this.sProLabel = "# erreur #";
this.nPronominable = -1;
}
this.dConj = new Map ([
[":Y", new Map ([
["label", "Infinitif"],
[":Y", sVerb]
])],
[":P", new Map ([
["label", "Participe présent"],
[":P", conj._getConjWithTags(sVerb, this._tTags, ":P", ":P")]
])],
[":Q", new Map ([
["label", "Participes passés"],
[":m:s", conj._getConjWithTags(sVerb, this._tTags, ":Q", ":m:s")],
[":f:s", conj._getConjWithTags(sVerb, this._tTags, ":Q", ":f:s")],
[":m:p", conj._getConjWithTags(sVerb, this._tTags, ":Q", ":m:p")],
[":f:p", conj._getConjWithTags(sVerb, this._tTags, ":Q", ":f:p")],
])],
[":Ip", new Map ([
["label", "Présent"],
[":1s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":1s")],
[":1ś", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":1ś")],
[":2s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":2s")],
[":3s", conj._getConjWithTags(sVerb, this._tTags, ":Ip", ":3s")],
|
︙ | | | ︙ | |
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
}
participePasse (sWho) {
return this.dConj.get(":Q").get(sWho);
}
participePresent (bPro, bNeg, bTpsCo, bInt, bFem) {
if (!this.dConj.get(":P").get(":")) {
return "";
}
let sPartPre;
if (bTpsCo) {
sPartPre = (!bPro) ? conj._getConjWithTags(this.sVerbAux, this._tTagsAux, ":PQ", ":P") : conj.getConj("être", ":PQ", ":P");
} else {
sPartPre = this.dConj.get(":P").get(":");
}
if (sPartPre === "") {
return "";
}
let bEli = conj._zStartVoy.test(sPartPre);
if (bPro) {
if (this.bProWithEn) {
|
|
|
|
|
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
}
participePasse (sWho) {
return this.dConj.get(":Q").get(sWho);
}
participePresent (bPro, bNeg, bTpsCo, bInt, bFem) {
if (!this.dConj.get(":P").get(":P")) {
return "";
}
let sPartPre;
if (bTpsCo) {
sPartPre = (!bPro) ? conj._getConjWithTags(this.sVerbAux, this._tTagsAux, ":P", ":P") : conj.getConj("être", ":P", ":P");
} else {
sPartPre = this.dConj.get(":P").get(":P");
}
if (sPartPre === "") {
return "";
}
let bEli = conj._zStartVoy.test(sPartPre);
if (bPro) {
if (this.bProWithEn) {
|
︙ | | | ︙ | |
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
return sImpe + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r");
}
return sImpe;
}
_seekPpas (bPro, bFem, bPlur) {
if (!bPro && this.sVerbAux == "avoir") {
return this.dConj.get(":Q").get(":Q1");
}
if (!bFem) {
return (bPlur && this.dConj.get(":Q").get(":Q2")) ? this.dConj.get(":Q").get(":Q2") : this.dConj.get(":Q").get(":Q1");
}
if (!bPlur) {
return (this.dConj.get(":Q").get(":Q3")) ? this.dConj.get(":Q").get(":Q3") : this.dConj.get(":Q").get(":Q1");
}
return (this.dConj.get(":Q").get(":Q4")) ? this.dConj.get(":Q").get(":Q4") : this.dConj.get(":Q").get(":Q1");
}
createConjTable (bPro=false, bNeg=false, bTpsCo=false, bInt=false, bFem=false) {
let oConjTable = {
"t_infi": "Infinitif",
"infi": this.infinitif(bPro, bNeg, bTpsCo, bInt, bFem),
"t_ppre": "Participe présent",
"ppre": this.participePresent(bPro, bNeg, bTpsCo, bInt, bFem),
"t_ppas": "Participes passés",
"ppas1": this.participePasse(":Q1"),
"ppas2": this.participePasse(":Q2"),
"ppas3": this.participePasse(":Q3"),
"ppas4": this.participePasse(":Q4"),
"t_imp": "Impératif",
"t_impe": (bInt) ? "" : ((!bTpsCo) ? "Présent" : "Passé"),
"impe1": (!bInt) ? this.imperatif(":2s", bPro, bNeg, bTpsCo, bFem) : "",
"impe2": (!bInt) ? this.imperatif(":1p", bPro, bNeg, bTpsCo, bFem) : "",
"impe3": (!bInt) ? this.imperatif(":2p", bPro, bNeg, bTpsCo, bFem) : "",
"t_indi": "Indicatif",
"t_ipre": (!bTpsCo) ? "Présent" : "Passé composé",
|
|
|
|
|
|
|
|
|
|
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
return sImpe + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r");
}
return sImpe;
}
_seekPpas (bPro, bFem, bPlur) {
if (!bPro && this.sVerbAux == "avoir") {
return this.dConj.get(":Q").get(":m:s");
}
if (!bFem) {
return (bPlur && this.dConj.get(":Q").get(":f:s")) ? this.dConj.get(":Q").get(":f:s") : this.dConj.get(":Q").get(":m:s");
}
if (!bPlur) {
return (this.dConj.get(":Q").get(":m:p")) ? this.dConj.get(":Q").get(":m:p") : this.dConj.get(":Q").get(":m:s");
}
return (this.dConj.get(":Q").get(":f:p")) ? this.dConj.get(":Q").get(":f:p") : this.dConj.get(":Q").get(":m:s");
}
createConjTable (bPro=false, bNeg=false, bTpsCo=false, bInt=false, bFem=false) {
let oConjTable = {
"t_infi": "Infinitif",
"infi": this.infinitif(bPro, bNeg, bTpsCo, bInt, bFem),
"t_ppre": "Participe présent",
"ppre": this.participePresent(bPro, bNeg, bTpsCo, bInt, bFem),
"t_ppas": "Participes passés",
"ppas1": this.participePasse(":m:s"),
"ppas2": this.participePasse(":f:s"),
"ppas3": this.participePasse(":m:p"),
"ppas4": this.participePasse(":f:p"),
"t_imp": "Impératif",
"t_impe": (bInt) ? "" : ((!bTpsCo) ? "Présent" : "Passé"),
"impe1": (!bInt) ? this.imperatif(":2s", bPro, bNeg, bTpsCo, bFem) : "",
"impe2": (!bInt) ? this.imperatif(":1p", bPro, bNeg, bTpsCo, bFem) : "",
"impe3": (!bInt) ? this.imperatif(":2p", bPro, bNeg, bTpsCo, bFem) : "",
"t_indi": "Indicatif",
"t_ipre": (!bTpsCo) ? "Présent" : "Passé composé",
|
︙ | | | ︙ | |