Grammalecte  Check-in [d4deec6280]

Overview
Comment:[fr] conversion: regex rules -> graph rules
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fr | rg
Files: files | file ages | folders
SHA3-256: d4deec6280f6bbd546b468875da5ac14e2911dc00c2f8e39e1c536dc081e20b2
User & Date: olr on 2018-07-14 12:44:25
Other Links: branch diff | manifest | tags
Context
2018-07-14
12:45
[build][core] desambiguisation: define tokens according to a slice of it check-in: c41af43fe1 user: olr tags: core, build, rg
12:44
[fr] conversion: regex rules -> graph rules check-in: d4deec6280 user: olr tags: fr, rg
12:04
[build] use default option priority for graph rules check-in: 58285f596f user: olr tags: build, rg
Changes

Modified gc_lang/fr/rules.grx from [f842ed1125] to [da3efe0557].

905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951

!!
!!
!!!! Apostrophes                                                                                  !!
!!
!!
## Apostrophe typographique
__[i>/apos(apostrophe_typographique)__
    ([ldsncjmç]|jusqu|lorsqu|aujourd|presqu|quelqu|puisqu|qu|prud|entr)['´‘′`ʼ](?=[\w"«]) @@0 <<- ->> \1’    # Apostrophe typographique.
__[i>/apos(apostrophe_typographique_après_t)__
    t['´‘′`ʼ](?!ils?|elles?|on)(?=[\w"«]) <<- ->> t’                                                         # Apostrophe typographique.

TEST: {{C'}}est l’apostrophe typographique qui manque.                    ->> C’
TEST: C’est {{l'}}apostrophe typographique qui manque.                    ->> l’
TEST: {{Aujourd'}}hui, je suis fatigué
TEST: Je pense {{qu`}}elle se trompe
TEST: Que {{t'}}arrive-t-il ?


__[i>/typo(typo_apostrophe_incorrecte)__
    (([ldsncjmtç]|lorsqu|puisqu|presqu|quoiqu|quelqu|jusqu|qu|aujourd|entr)(?:[’'´‘′`ʼ][’'´‘′`ʼ ]|”|“|"| [’'´‘′`ʼ] ?))[aeéiouhœæyîèêôû]  @@0,0
    <<- not (\2.__len__() == 1  and  \1.endswith("′ ")) -1>> \2’                                    # Apostrophe incorrecte.

TEST: {{C’ }}est rageant.                                                 ->> C’
TEST: {{Lorsqu’ }}il vient, on s’ennuie.
TEST: {{l’'}}électricien est parti
TEST: Je pense {{qu ` }}elle ne viendra pas.


## Apostrophes manquantes
__[i>/typo(typo_apostrophe_manquante)__
    "(lorsqu|puisqu|presqu|quoiqu|jusqu|qu|aujourd|entr) "  @@0  <<- ->> \1’                        # Il manque vraisemblablement une apostrophe.
# Solution prudente :
__[i>/typo(typo_apostrophe_manquante_prudence1)__
    ne ([mtsl] )([aeéiouhyîèêôû][\w-]*)  @@3,$  <<- -1>> =\1[:-1]+"’"                               # Il manque une apostrophe.
__[i>/typo(typo_apostrophe_manquante_prudence2)__
    (?:je|tu|ils?|nous|vous|on|ça|elles?) ([nmtsl] )([aeéiouhyîèêôû][\w-]*)  @@*,$
    <<- not option("mapos") and morph(\2, ":V", False) -1>> =\1[:-1]+"’"                            # Il manque probablement une apostrophe.
# Solution audacieuse :
__[s>/typo(typo_apostrophe_manquante_audace1)__
    ([ldsncjmtç] )[aeéiouhAEÉIOUHyîèêôûYÎÈÊÔÛ]  @@0
    <<- option("mapos") and not before("(?i)(?:lettre|caractère|glyphe|dimension|variable|fonction|point) *$")
    -1>> =\1[:-1]+"’"                                                                               # Il manque peut-être une apostrophe.
# Note : pour les majuscules, la règle se situe lors de la passe suivante.

TEST: __mapos__ {{n }}arrive pas à sa cheville
TEST: le coup {{qu }}avait donné                                                ->> qu’







|

|









|










|


|

|



|







905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951

!!
!!
!!!! Apostrophes                                                                                  !!
!!
!!
## Apostrophe typographique
__[i>/apos(apostrophe_typographique)!8__
    ([ldsncjmç]|jusqu|lorsqu|aujourd|presqu|quelqu|puisqu|qu|prud|entr)['´‘′`ʼ](?=[\w"«]) @@0 <<- ->> \1’    # Apostrophe typographique.
__[i>/apos(apostrophe_typographique_après_t)!8__
    t['´‘′`ʼ](?!ils?|elles?|on)(?=[\w"«]) <<- ->> t’                                                         # Apostrophe typographique.

TEST: {{C'}}est l’apostrophe typographique qui manque.                    ->> C’
TEST: C’est {{l'}}apostrophe typographique qui manque.                    ->> l’
TEST: {{Aujourd'}}hui, je suis fatigué
TEST: Je pense {{qu`}}elle se trompe
TEST: Que {{t'}}arrive-t-il ?


__[i>/typo(typo_apostrophe_incorrecte)!8__
    (([ldsncjmtç]|lorsqu|puisqu|presqu|quoiqu|quelqu|jusqu|qu|aujourd|entr)(?:[’'´‘′`ʼ][’'´‘′`ʼ ]|”|“|"| [’'´‘′`ʼ] ?))[aeéiouhœæyîèêôû]  @@0,0
    <<- not (\2.__len__() == 1  and  \1.endswith("′ ")) -1>> \2’                                    # Apostrophe incorrecte.

TEST: {{C’ }}est rageant.                                                 ->> C’
TEST: {{Lorsqu’ }}il vient, on s’ennuie.
TEST: {{l’'}}électricien est parti
TEST: Je pense {{qu ` }}elle ne viendra pas.


## Apostrophes manquantes
__[i>/typo(typo_apostrophe_manquante)!8__
    "(lorsqu|puisqu|presqu|quoiqu|jusqu|qu|aujourd|entr) "  @@0  <<- ->> \1’                        # Il manque vraisemblablement une apostrophe.
# Solution prudente :
__[i>/typo(typo_apostrophe_manquante_prudence1)!8__
    ne ([mtsl] )([aeéiouhyîèêôû][\w-]*)  @@3,$  <<- -1>> =\1[:-1]+"’"                               # Il manque une apostrophe.
__[i>/typo(typo_apostrophe_manquante_prudence2)!8__
    (?:je|tu|ils?|nous|vous|on|ça|elles?) ([nmtsl] )([aeéiouhyîèêôû][\w-]*)  @@*,$
    <<- not option("mapos") and morph(\2, ":V", False) -1>> =\1[:-1]+"’"                            # Il manque probablement une apostrophe.
# Solution audacieuse :
__[s>/typo(typo_apostrophe_manquante_audace1)!8__
    ([ldsncjmtç] )[aeéiouhAEÉIOUHyîèêôûYÎÈÊÔÛ]  @@0
    <<- option("mapos") and not before("(?i)(?:lettre|caractère|glyphe|dimension|variable|fonction|point) *$")
    -1>> =\1[:-1]+"’"                                                                               # Il manque peut-être une apostrophe.
# Note : pour les majuscules, la règle se situe lors de la passe suivante.

TEST: __mapos__ {{n }}arrive pas à sa cheville
TEST: le coup {{qu }}avait donné                                                ->> qu’
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319











2320
2321
2322
2323
2324
2325
2326
    ->> \1-\2                                                                                       # S’il s’agit d’un seul mot, il manque un trait d’union.

TEST: des {{franco américains}}
TEST: {{franco américaine}}                             ->> franco-américaine
TEST: {{ferro électrique}}                              ->> ferro-électrique
TEST: {{rétro ingénierie}}.                             ->> rétro-ingénierie


__[i]/tu(tu_préfixe_pseudo)__
    pseudo ({w_2}) @@$
    <<- morph(\1, ":N") ->> pseudo-\1                                                               # Si vous voulez évoquer le simulacre de “\1”, mettez un trait d’union.
    <<- __also__ ~>> \1
__[i](p_pseudo_xxx)__
    (pseudo-){w_2} @@0 <<- ~1>> *

TEST: il n’avait contracté qu’un {{pseudo mariage}}.




@@@@
@@@@
@@@@
@@@@
@@@@GRAPH: graphe1                                                                                 _
@@@@
@@@@
@@@@
@@@@

__tu_préfixe_divers__
    [anti|auto|arrière|avant|demi|extra|intra|multi|post]  *WORD
        <<- /tu/ analyse_with_next(\1, "-", ":") and morph(<1, ":D|<start>")
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

    [non|sans|sous]  *WORD
        <<- /tu/ analyse_with_next(\1, "-", ":") and morph(<1, ":D")
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

TEST: il a pris une balle dans l’{{arrière train}}.
TEST: Ce {{sans gêne}} mérite une bonne leçon
TEST: Sans gêne, il avança parmi nous.













__tu_mots_composés_verbe_nom__
    [attrape|garde|porte|brise|cache|casse|chauffe|contre|coupe|cure|croque|entre|essuie|lance|lave|lève|marque|pare|passe|perce|pèse|porte|poste|pousse|presse|protège|ramasse|serre|taille|tire|tourne|traîne|traine|vide]  *WORD
        <<- /tu/ not (morph(\1, ":G") and morph(\2, ":[GYB]")) and morph(<1, ":(?:D|V0e)|<start>") and analyse_with_next(\1, "-", ":N")
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

TEST: ce sont des {{lève tard}}.







<
<
<
<
<
<
<
<
<
<
<














|










>
>
>
>
>
>
>
>
>
>
>







2277
2278
2279
2280
2281
2282
2283











2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
    ->> \1-\2                                                                                       # S’il s’agit d’un seul mot, il manque un trait d’union.

TEST: des {{franco américains}}
TEST: {{franco américaine}}                             ->> franco-américaine
TEST: {{ferro électrique}}                              ->> ferro-électrique
TEST: {{rétro ingénierie}}.                             ->> rétro-ingénierie














@@@@
@@@@
@@@@
@@@@
@@@@GRAPH: graphe1                                                                                 _
@@@@
@@@@
@@@@
@@@@

__tu_préfixe_divers__
    [anti|auto|arrière|avant|demi|extra|intra|multi|post]  *WORD
        <<- /tu/ analyse_with_next(\1, "-", ":") and (morph(<1, ":D|<start>") or value(<1, "|l’|d’|"))
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

    [non|sans|sous]  *WORD
        <<- /tu/ analyse_with_next(\1, "-", ":") and morph(<1, ":D")
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

TEST: il a pris une balle dans l’{{arrière train}}.
TEST: Ce {{sans gêne}} mérite une bonne leçon
TEST: Sans gêne, il avança parmi nous.


    pseudo  @:N¬*
        <<- ->> pseudo-\2                                                                           # Si vous voulez évoquer le simulacre de “\2”, mettez un trait d’union.
        <<- ~1>> *

    ~^[pP]seudo-\w+
        <<- =>> define_from(\1, 7)

TEST: il n’avait contracté qu’un {{pseudo mariage}}.
TEST: elle connaissait de cet {{pseudo-prêtresse}} uniquement de nom.


__tu_mots_composés_verbe_nom__
    [attrape|garde|porte|brise|cache|casse|chauffe|contre|coupe|cure|croque|entre|essuie|lance|lave|lève|marque|pare|passe|perce|pèse|porte|poste|pousse|presse|protège|ramasse|serre|taille|tire|tourne|traîne|traine|vide]  *WORD
        <<- /tu/ not (morph(\1, ":G") and morph(\2, ":[GYB]")) and morph(<1, ":(?:D|V0e)|<start>") and analyse_with_next(\1, "-", ":N")
        ->> \1-\2                                                                                   # Il manque probablement un trait d’union.

TEST: ce sont des {{lève tard}}.