Grammalecte  Diff

Differences From Artifact [00e5bc27ed]:

To Artifact [5148be3923]:


1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991









1992
1993
1994
1995
1996
1997
1998
!!
!!
!!
!!

[++]

### Traits d’union douteux
__[i]/tu(tu_trait_union_douteux)__
    ({w1})(?:--|—|–)({w1})  @@0,$
    <<- spell(\1+"-"+\2) and analyse(\1+"-"+\2, ":", False) ->> \1-\2                               # Trait d’union : un tiret simple suffit.

TEST: Nous préparons une {{contre–attaque}}.


!!!! Doublons (casse identique)                                                                   !!

__[s](doublon)__
    ({w1}) {1,3}\1  @@0
    <<- not re.search("(?i)^([nv]ous|faire|en|la|lui|donnant|œuvre|h[éoa]|hou|olé|joli|Bora|couvent|dément|sapiens|très|vroum|[0-9]+)$", \1)
        and not (re.search("^(?:est|une?)$", \1) and before("[’']$"))
        and not (\1 == "mieux" and before("(?i)qui +$"))
    ->> \1   # Doublon.

TEST: Il y a un {{doublon doublon}}.











!!!! Nombres: typographie                                                                         !!

#(\d\d\d\d)-(\d\d\d\d)   <<- ->> \1–\2                              # Ne pas séparer deux dates par un trait d’union, mais par un tiret demi-cadratin.

__[s]/num(num_lettre_O_zéro1)__  [\dO]+[O][\dO]+ <<- not option("ocr") ->> =\0.replace("O", "0")    # S’il s’agit d’un nombre, utilisez le chiffre « 0 » plutôt que la lettre « O ».
__[s]/num(num_lettre_O_zéro2)__  [1-9]O <<- not option("ocr") ->> =\0.replace("O", "0")             # S’il s’agit d’un nombre, utilisez le chiffre « 0 » plutôt que la lettre « O ».







<
<
<
<
|
<
<
<
<
<









>
>
>
>
>
>
>
>
>







1966
1967
1968
1969
1970
1971
1972




1973





1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
!!
!!
!!
!!

[++]





#FASTER THAN TOKEN RULE





__[s](doublon)__
    ({w1}) {1,3}\1  @@0
    <<- not re.search("(?i)^([nv]ous|faire|en|la|lui|donnant|œuvre|h[éoa]|hou|olé|joli|Bora|couvent|dément|sapiens|très|vroum|[0-9]+)$", \1)
        and not (re.search("^(?:est|une?)$", \1) and before("[’']$"))
        and not (\1 == "mieux" and before("(?i)qui +$"))
    ->> \1   # Doublon.

TEST: Il y a un {{doublon doublon}}.



### Traits d’union douteux
__[i]/tu(tu_trait_union_douteux)__
    ({w1})(?:--|—|–)({w1})  @@0,$
    <<- spell(\1+"-"+\2) and analyse(\1+"-"+\2, ":", False) ->> \1-\2                               # Trait d’union : un tiret simple suffit.

TEST: Nous préparons une {{contre–attaque}}.


!!!! Nombres: typographie                                                                         !!

#(\d\d\d\d)-(\d\d\d\d)   <<- ->> \1–\2                              # Ne pas séparer deux dates par un trait d’union, mais par un tiret demi-cadratin.

__[s]/num(num_lettre_O_zéro1)__  [\dO]+[O][\dO]+ <<- not option("ocr") ->> =\0.replace("O", "0")    # S’il s’agit d’un nombre, utilisez le chiffre « 0 » plutôt que la lettre « O ».
__[s]/num(num_lettre_O_zéro2)__  [1-9]O <<- not option("ocr") ->> =\0.replace("O", "0")             # S’il s’agit d’un nombre, utilisez le chiffre « 0 » plutôt que la lettre « O ».
2137
2138
2139
2140
2141
2142
2143

















2144
2145
2146
2147
2148
2149
2150
@@@@
@@@@
@@@@GRAPH: graphe1                                                                                 _
@@@@
@@@@
@@@@
@@@@



















!!!! Nombres ordinaux                                                                             !!

__typo_ordinaux_chiffres__
    1 ier
    1ier







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
@@@@
@@@@
@@@@GRAPH: graphe1                                                                                 _
@@@@
@@@@
@@@@
@@@@


!!!! Doublons (casse identique)                                                                   !!


# SLOWER THAN REGEX RULE
#__doublon__
#    *WORD  *WORD
#    <<- \1 == \2
#        and not value(\2, "|nous|vous|faire|en|la|lui|donnant|œuvre|ah|oh|eh|hé|ho|ha|hou|olé|joli|Bora|couvent|dément|sapiens|très|vroum|")
#        and not (value(\1, "|est|une|") and value(<1, "|l’|d’|"))
#        and not (\2 == "mieux" and value(<1, "|qui|"))
#    ->> \1                                                                                          # Doublon.
#
#TEST: Il y a un {{doublon doublon}}.




!!!! Nombres ordinaux                                                                             !!

__typo_ordinaux_chiffres__
    1 ier
    1ier
8218
8219
8220
8221
8222
8223
8224
8225
8226

8227
8228



8229












8230

8231

8232
8233
8234

8235
8236
8237
8238
8239


8240
8241
8242
8243



8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254

    on ne peut [plus|moins]
    on ne peut pas [plus|moins]
    plus que
        <<- morph(<1, ":(?:V0e|N)") and morph(>1, ":[AQ]") ~>> *



@@@@

@@@@END_GRAPH                                                                                      _
@@@@


















# après avoir

__[i](p_avoir_être_loc_adv1)__
    ({avoir}) +(pas|jamais|plus|en partie|point|tous (?:deux|trois)|somme toute)  @@0,$
    <<- morph(\1, ":V0", False) ~2>> *

__[i](p_avoirtre_loc_adv2)__
    ({avoir}) +(beaucoup|bien entendu|dans (?:leur |son |l’)ensemble|à ce(?:t (?:instant|endroit)| moment)|sans peine|un (?:moment|peu|minimum|petit peu|tout petit peu)) +({w_2})  @@0,w,$
    <<- morph(\1, ":V0", False) and morph(\3, ":[QY]", False) ~2>> *
__[i](p_avoir_loc_adv)__
    ({avoir}) +(besoin|bon (?:dos|pied,? bon œil)|carte blanche|confiance|conscience|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)|carte blanche|confiance|conscience|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:$,$
    <<- morph(\1, ":V0a", False) and morph(\3, ":B", False) and morph(\4, ">besoin/|:(?:Q|V1.*:Y)", False) ~2>> *


# après verbe
__[i](p_verbe_loc_adv1)__       ({w1}) (?:pas |)(jour et nuit|quand même(?: pas|)) @@0,$ <<- morph(\1, ":V", False) ~2>> *
__[i](p_verbe_loc_adv2)__       ({w_2}) (bien entendu|juste|ensemble) @@0,$ <<- morph(\1, ":V[123]") ~2>> *
__[i](p_verbe_loc_adv3)__       ({w_2}) ((?:fort|très|super) (?:bien|mal)|bien|mal) @@0,$ <<- morph(\1, ":V[123]", False) ~2>> *
__[i](p_verbe_pronom_aussi)__   ({w_1}) ((?:[mt]oi|[nv]ous|elles?|lui|eux) aussi) @@0,$ <<- morph(\1, ":V", False) ~2>> *
__[i](p_tout_aussi)__           (?:tout |)aussi <<- ~>> *







|
<
>
|
<
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>

>
|
>
|
|
<
>
|
<
|
|
|
>
>
|
|
|
|
>
>
>
|
<
<








8235
8236
8237
8238
8239
8240
8241
8242

8243
8244

8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266

8267
8268

8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281


8282
8283
8284
8285
8286
8287
8288
8289

    on ne peut [plus|moins]
    on ne peut pas [plus|moins]
    plus que
        <<- morph(<1, ":(?:V0e|N)") and morph(>1, ":[AQ]") ~>> *


__purge_après_avoir__

    >avoir  [pas|jamais|plus|guère|point]
    >avoir  ?[pas|jamais|plus|guère|point]¿  en partie

    >avoir  ?[pas|jamais|plus|guère|point]¿  tous [deux|trois]
    >avoir  ?[pas|jamais|plus|guère|point]¿  somme toute
        <<- ~2:0>> *

    >avoir  ?[pas|jamais|plus|guère|point]¿  beaucoup
    >avoir  ?[pas|jamais|plus|guère|point]¿  bien entendu
    >avoir  ?[pas|jamais|plus|guère|point]¿  dans [leur|l’|son] ensemble
    >avoir  ?[pas|jamais|plus|guère|point]¿  à cet [instant|endroit] ?précis¿
    >avoir  ?[pas|jamais|plus|guère|point]¿  à ce moment ?précis¿
    >avoir  ?[pas|jamais|plus|guère|point]¿  sans peine
    >avoir  ?[pas|jamais|plus|guère|point]¿  un [moment|instant]
    >avoir  ?[pas|jamais|plus|guère|point]¿  un minimum
    >avoir  ?[pas|jamais|plus|guère|point]¿  un peu
    >avoir  ?[pas|jamais|plus|guère|point]¿  un petit peu
    >avoir  ?[pas|jamais|plus|guère|point]¿  un tout petit peu
        <<- morph(>1, ":[QY]") ~2:0>> *

    >avoir  ?[pas|jamais|plus|guère|point]¿  [besoin|confiance|conscience|crainte|faim|honte|peur|soif]
    >avoir  ?[pas|jamais|plus|guère|point]¿  bon dos
    >avoir  ?[pas|jamais|plus|guère|point]¿  bon pied ?,¿ bon œil
    >avoir  ?[pas|jamais|plus|guère|point]¿  carte blanche
    >avoir  ?[pas|jamais|plus|guère|point]¿  forme humaine

    >avoir  ?[pas|jamais|plus|guère|point]¿  partie [gagnée|liée]
    >avoir  ?[pas|jamais|plus|guère|point]¿  voix au chapitre

        <<- ~2:0>> *

    >avoir  ?[pas|jamais|plus|guère|point]¿  [tous|toutes] les @:B  [besoin|confiance|conscience|crainte|faim|honte|peur|soif]
    >avoir  ?[pas|jamais|plus|guère|point]¿  [tous|toutes] les @:B  @:(?:Q|V1.*:Y)
        <<- ~2:4>> *




@@@@
@@@@END_GRAPH                                                                                      _
@@@@





# après verbe
__[i](p_verbe_loc_adv1)__       ({w1}) (?:pas |)(jour et nuit|quand même(?: pas|)) @@0,$ <<- morph(\1, ":V", False) ~2>> *
__[i](p_verbe_loc_adv2)__       ({w_2}) (bien entendu|juste|ensemble) @@0,$ <<- morph(\1, ":V[123]") ~2>> *
__[i](p_verbe_loc_adv3)__       ({w_2}) ((?:fort|très|super) (?:bien|mal)|bien|mal) @@0,$ <<- morph(\1, ":V[123]", False) ~2>> *
__[i](p_verbe_pronom_aussi)__   ({w_1}) ((?:[mt]oi|[nv]ous|elles?|lui|eux) aussi) @@0,$ <<- morph(\1, ":V", False) ~2>> *
__[i](p_tout_aussi)__           (?:tout |)aussi <<- ~>> *