Overview
| Comment: | [fr] désambiguïsation, processeur de texte et correction de faux positifs |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | fr |
| Files: | files | file ages | folders |
| SHA3-256: |
0af18422ef87eae3e37ed0420b627dad |
| User & Date: | olr on 2017-10-18 12:17:09 |
| Other Links: | manifest | tags |
Context
|
2017-10-18
| ||
| 12:35 | [fr] nouvelle règle pour l’écriture dite “inclusive” check-in: a9a70b640f user: olr tags: trunk, fr | |
| 12:17 | [fr] désambiguïsation, processeur de texte et correction de faux positifs check-in: 0af18422ef user: olr tags: trunk, fr | |
| 11:11 | [fx] merge webext3: better interface check-in: a176d99c0b user: olr tags: trunk, fx | |
Changes
Modified gc_lang/fr/rules.grx from [9041a1c843] to [876b0f12d4].
| ︙ | |||
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 | 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 | + + + + |
!!!
# mots grammaticaux
__[i](d_dans)__
dans
<<- not morph(word(-1), ":D.*:p|>[a-z]+ièmes ", False, False) =>> select(\0, ":R")
__[i](d_ton_son)__
(\w+) ([ts]on) @@0,$
<<- morph(\1, ">(?:le|ce[st]?|ton|mon|son|quel(?:que|)s?|[nv]otre|un|leur|ledit|dudit) ") =>> exclude(\2, ":D")
# Pronoms le/la/les
__[i](p_astuce_je_le_la_les)__
je (l(?:e(?:ur|s|)|a)) @@$ <<- not morph(word(-1), ":1s", False, False) =>> select(\1, ":Oo")
__[i](p_astuce_tu_le_la_les)__
tu (l(?:e(?:ur|s|)|a)) @@$ <<- not morph(word(-1), ":2s", False, False) =>> select(\1, ":Oo")
__[i](p_astuce_il_elle_on_le_la_les)__
(?:il|elle|on) (l(?:e(?:ur|s|)|a)) @@$ <<- not morph(word(-1), ":3s", False, False) =>> select(\1, ":Oo")
|
| ︙ | |||
5091 5092 5093 5094 5095 5096 5097 | 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 | - + |
({avoir}) +(besoin|bon (?:dos|pied,? bon œil)|carte blanche|confiance|crainte|faim|forme humaine|honte|partie (?:gagnée|liée)|peur|soif|voix au chapitre) @@0,$
<<- morph(\1, ":V0a", False) and not (\2 == "crainte" and before(r"\w")) ~2>> *
__[i](p_avoir_pronom_loc_adv)__
({avoir})-(?:je|tu|ils?|elles?|nous|vous|on) +(besoin|bon (?:dos|pied,? bon œil)|confiance|crainte|faim|forme humaine|honte|partie (?:gagnée|liée)|peur|soif|voix au chapitre) @@0,$
<<- morph(\1, ":V0a", False) ~2>> *
__[i](p_avoir_tous_toutes_les)__
({avoir}) +(tou(?:te|)s les ({w_2})) +({w_2}) @@0,w,>3:$,$
|
| ︙ | |||
5156 5157 5158 5159 5160 5161 5162 | 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 | - + |
# couleurs invariables
__[i](p_couleurs_invariables)__
({w_2}) +((?:beige|blanc|bleu|brun|châtain|cyan|gris|jaune|magenta|marron|orange|pourpre|rose|rouge|vert|violet) (?:clair|fluo|foncé|irisé|pâle|pastel|sombre|vif|tendre)) @@0,$
<<- morph(\1, ":[NAQ]", False) ~2>> *
# locutions adjectivales, nominales & couleurs
__[i](p_locutions_adj_nom_et_couleurs)__
|
| ︙ | |||
5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 | 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 | + + |
__<s>(p_balise_vide)__ [<] +[>] <<- ~>> *
## Seconde passe (il faut réorganiser tout le cycle de simplification)
__[i](p_à_nos_yeux)__
(à (?:[mts]es|[nv]os|leurs) yeux) +({w_1}) @@0,$ <<- not morph(\2, ":A.*:[me]:[pi]", False) ~1>> *
__[i](p_au_pire)__
(au pire) +({w_1}) @@0,$ <<- morph(\2, ":A", ":N:[me]:[si]") ~1>> *
__[i](p_ben_voyons)__
ben voyons <<- isStart() ~>> *
__[i](p_chaque_année_semaine_journée_décennie)__
(chaque (?:année|semaine|journée|décennie)) +({w_1}) @@0,$ <<- not morph(\2, ":(?:A.*:[fe]:[si]|Oo|[123][sp])", False) ~1>> *
__[i](p_chaque_an_jour_mois)__
(chaque (?:an|jour|mois)) +({w_1}) @@0,$ <<- not morph(\2, ":(?:A.*:[me]:[si]|Oo|[123][sp])", False) ~1>> *
__[i](p_d_évidence)__
|
| ︙ | |||
5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 | 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 | + + + + | TEST: c’était le signe évident d’une politique volontaire TEST: ce que c’est : le signe évident d’une politique volontaire TEST: On aura carte blanche. TEST: La seule façon de redonner sens à des notions… TEST: Les longues tresses que j’ai pris l’habitude de porter depuis quelque temps et qu’il faut cinq heures pour parfaire. TEST: Il est pieds nus. TEST: des dossiers secrets défense TEST: il y en a pour une demi-heure grand maximum aller et retour. TEST: nous avions tous les deux besoin d’un peu de réconfort. TEST: Une tierce connaissance qui est au pire triviale, mais non nulle. # # //////////////////////////////////////// RÈGLES DE CONTRÔLE //////////////////////////////////////// # |
| ︙ | |||
5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 | 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 | + |
(ce) +({w_2}) @@0,$
<<- morphex(\2, ":[NAQ].*:f", ":(?:3s|[GWme])") -1>> cette # Accord de genre erroné : « \2 » est féminin.
<<- __also__ and hasMasForm(\2) -2>> =suggMasSing(@, True) # Accord de genre erroné : « \1 » est un déterminant masculin.
<<- morphex(\2, ":[NAQ].*:f", ":[GWme]") and morph(\2, ":3s", False) -1>> cette|se # Accord de genre erroné : « \2 » est féminin. Ou bien vous confondez le déterminant “ce” avec le pronom “se”.
<<- morphex(\2, ":[NAQ].*:p", ":[siGW]") -2>> =suggMasSing(@) # Accord de nombre erroné : « \2 » devrait être au singulier.
__[i]/gn(gn_mon_ton_son_accord)__
([mts]on) +({w_2}) @@0,$
<<- morph(\1, ":D", False) >>>
<<- morphex(\2, ">[bcdfgjklmnpqrstvwxz].*:[NAQ].*:f", ":[GWme]") -1>> =\1.replace("on", "a") # Accord de genre erroné : « \2 » est féminin.
<<- __also__ and hasMasForm(\2) -2>> =suggMasSing(@, True) # Accord de genre erroné : « \1 » est un déterminant masculin.
<<- morphex(\2, ":[NAQ].*:p", ":[siGW]") -2>> =suggMasSing(@) # Accord de nombre erroné : « \2 » devrait être au singulier.
__[i]/gn(gn_au_accord)__
(au) +({w_2}) @@0,$
<<- morphex(\2, ":[NAQ].*:f:s", ":[GWme]") -1>> à la # Accord de genre erroné : « \2 » est féminin.
<<- __also__ and hasMasForm(\2) -2>> =suggMasSing(@, True) # Accord de genre erroné : « \1 » est un déterminant masculin.
|
| ︙ | |||
5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 | 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 | + |
TEST: {{Ce}} animal. ->> Cet
TEST: {{un}} des {{chattes}}
TEST: {{une}} des {{chats}}
TEST: {{mon}} {{chienne}}
TEST: cet {{oliviers}}
TEST: ce {{claviers}}
TEST: cette bouffe, c’est du {{chiens}}
TEST: le ton monte.
__<i]/gn(gn_la_accord1)__
, +(la) +({w_2}) @@w,$
<<- morphex(\2, ":[NAQ].*:m", ":(?:e|f|P|G|W|[1-3][sp]|Y)") -1>> le # Accord de genre erroné : « \2 » est masculin.
<<- __also__ and hasFemForm(\2) -2>> =suggFemSing(@, True) # Accord de genre erroné : « \1 » est un déterminant féminin.
<<- __else__ and morph(\2, ":[NAQ].*:p") -2>> =suggFemSing(@) # Accord de nombre erroné : « \2 » devrait être au singulier.
|
| ︙ | |||
8446 8447 8448 8449 8450 8451 8452 | 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 | - + + |
__[s]/maj(maj_gentilés)__
({w_2}) ((?:[aA]fghan|[aA]lbanais|[aA]lgérien|[aA]llemand|[aA]méricain|[aA]ndorran|[aA]ngo?lais|[aA]rabe|[aA]rgentin|[aA]rménien|[aA]ustralien|[aA]utrichien|[aA]siatique|[aA]zerbaïdjanais|[bB]ahamien|[bB]angladais|[bB]engladeshi|[bB]arbadien|[bB]asque|[bB]elge|[bB]élizien|[bB]éninois|[bB]reton|[bB]houtanais|[bB]iélorusse|[bB]irman|[bB]olivien|[bB]osnien|[bB]otswanais|[bB]résilien|[bB]ritannique|[bB]runéien|[bB]ulgare|[bB]urkinabé|[bB]urundais|[cC]ambodgien|[cC]amerounais|[cC]anadien|[cC]apverdien|[cC]entrafricain|[cC]hilien|[cC]hinois|[cC]hypriote|[cC]olombien|[cC]omorien|[cC]ongolais|nord-coréen|[cC]orse|[cC]ostaricien|[cC]roate|[cC]ubain|[dD]anois|[dD]jiboutien|[dD]ominicain|[éÉ]gyptien|[éÉ]mirati|[éÉ]quatorien|[éÉ]rythréen|[eE]stonien|[eE]spagnol|[éÉ]tats-?unien|[éÉ]tasunien|[éÉ]thiopien|[fF]idjien|[fF]inlandais|[fF]ormosan|[fF]rançais|[gG]abonais|[gG]ambien|[gG]éorgien|[gG]hanéen|[gG]rec|[gG]renadien|[gG]uadeloupéen|[gG]uatémaltèque|[gG]uinéen|[éÉ]quato-guinéen|[gG]uyanien|[hH]aïtien|[hH]ondurien|[hH]ollandais|[hH]ongrois|[iI]ndien|[iI]ndochinois|[iI]ndonésien|[iI]rakien|[iI]talien|[iI]ranien|[iI]rlandais|[iI]slandais|[iI]sraélien|[iI]voirien|[jJ]amaïcain|[jJ]aponais|[jJ]ordanien|[kK]azakh|[kK]ényan|[kK]osovar|[kK]oweïtien|[lL]aotien|[lL]apon|[lL]etton|[lL]ibanais|[lL]ibérien|[lL]ibyen|[lL]iechtensteinois|[lL]ituanien|[lL]uxembourgeois|[mM]acédonien|[mM]aghrébin|[mM]algache|[mM]alaisien|[mM]alawite|[mM]aldivien|[mM]alien|[mM]altais|[mM]aori|[mM]arocain|[mM]artien|[mM]auricien|[mM]auritanien|[mM]exicain|[mM]icronésien|[mM]oldave|[mM]onégasque|[mM]onténégrin|[mM]ongol|[mM]ozambicain|[nN]amibien|[nN]épalais|[nN]icaraguayen|[nN]igérien|[nN]igérian|[nN]éerlandais|[nN]orvégien|[nN]éo-zélandais|[oO]ugandais|[oO]uzbek|[pP]akistanais|[pP]alestinien|[pP]anaméen|[pP]araguayen|[pP]erse|[pP]éruvien|[pP]hilippin|[pP]olonais|[pP]olynésien|[pP]ortugais|[qQ]uébécois|[qQ]atari|[rR]oumain|[rR]usse|[rR]wandais|[s]aoudien|[s]candinave|[sS]alvadorien|[sS]énégalais|[sS]erbe|[sS]ingapourien|[sS]lovaque|[sS]lovène|[sS]omalien|[sS]oudanais|[sS]oviétique|[sS]rilankais|[sS]uédois|[sS]uisse|[sS]urinamais|[sS]yrien|[sS]ud-(?:africain|coréen|américain)|[tT]adjik|[tT]anzanien|[tT]chadien|[tT]chèque|[tT]haïlandais|[tT]ogolais|[tT]ahitien|[tT]unisien|[tT]urkmène|[tT]urc|[tT]aïwanais|[uU]krainien|[uU]ruguayen|[vV]énézuélien|[vV]ietnamien|[yY]éménite|[yY]ougoslave|[zZ]aïrois|[zZ]ambien|[zZ]imbabwéen)n?e?s?)
@@0,$
<<- \2.istitle() and morphex(\1, ":N", ":(?:A|V0e|D|R|B)") and not re.search("^([oO]céan Indien|[îÎiI]les Britanniques)", \0)
-2>> =\2.lower() # S’il s’agit d’un adjectif, ne mettez pas de majuscule.
<<- \2.islower() and not \2.startswith("canadienne") and
( re.search("(?i)^(?:certaine?s?|cette|ce[ts]?|[dl]es|[nv]os|quelques|plusieurs|chaque|une|aux)$", \1) or
|
| ︙ |