Grammalecte  Check-in [3aa7844bdc]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[fr] faux positif: grand nombre binaire
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr
Files: files | file ages | folders
SHA3-256:3aa7844bdc88009e8df2f86a27c985ea99bdd9f27e46c35a15d68ebf581c544c
User & Date: olr 2019-08-22 12:04:56
Context
2019-08-22
21:35
[fr] faux positif: nombre négatif check-in: b7bc5ec2e7 user: olr tags: fr, trunk
12:04
[fr] faux positif: grand nombre binaire check-in: 3aa7844bdc user: olr tags: fr, trunk
11:16
[fr] nr: da substantifs, +ajustements check-in: ba1ed47d1e user: olr tags: fr, trunk
Changes

Changes to gc_lang/fr/rules.grx.

1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
....
1335
1336
1337
1338
1339
1340
1341

1342
1343
1344
1345
1346
1347
1348
!!

__[s]/num(num_grand_nombre_soudé)__
    \d\d\d\d+
    <<- not before("NF[  -]?(C|E|P|Q|X|Z|EN(?:[  -]ISO|)) *$") >>>
    <<- \0.__len__() > 4 ->> =formatNumber(\0)                                                      # Formatage des grands nombres.
    <<- __else__
        and after("^(?:,[0-9]+[⁰¹²³⁴⁵⁶⁷⁸⁹]?|[⁰¹²³⁴⁵⁶⁷⁸⁹])")
        or after("^[   ]*(?:[kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰€$£¥Åℓhj]|min|°C|℃)(?![\\w’'])")
    ->> =formatNumber(\0)                                                                           # Formatage des grands nombres.

__[s]/num(num_nombre_quatre_chiffres)__
    (?<!,)(\d\d\d\d)[  ]([a-zA-Zµ][a-zA-Z0-9Ωℓ⁰¹²³⁴⁵⁶⁷⁸⁹/·]*) @@0,$
    <<- morph(\2, ";S", ":[VCR]") or mbUnit(\2) -1>> =formatNumber(\1)                              # Formatage des grands nombres.

TEST: {{12345}}                                 ->> 12 345
................................................................................
TEST: {{0234567890}}                            ->> 0 234 567 890|02 34 56 78 90|023 456 78 90|0234 567-890
TEST: {{12345678901}}                           ->> 12 345 678 901
TEST: {{112798931830912839}}                    ->> 112 798 931 830 912 839
TEST: {{2308393909}}                            ->> 2 308 393 909|2308 393-909
TEST: {{2024}},9                                ->> 2 024
TEST: {{4000}} Å                                ->> 4 000
TEST: {{3240}} µA                               ->> 3 240



__[s>(num_grand_nombre_avec_points)__
    \d\d?\d?(?:[.]\d\d\d)+(?![0-9])
    <<- option("num") ->> =\0.replace(".", " ")                                                     # Grands nombres : utilisez des espaces insécables plutôt que des points.
    <<- ~>> =\0.replace(".", "_")








|
|







 







>







1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
....
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
!!

__[s]/num(num_grand_nombre_soudé)__
    \d\d\d\d+
    <<- not before("NF[  -]?(C|E|P|Q|X|Z|EN(?:[  -]ISO|)) *$") >>>
    <<- \0.__len__() > 4 ->> =formatNumber(\0)                                                      # Formatage des grands nombres.
    <<- __else__
        and ((after("^(?:,[0-9]+[⁰¹²³⁴⁵⁶⁷⁸⁹]?|[⁰¹²³⁴⁵⁶⁷⁸⁹])") and not (re.search("^[01]+$", \0) and after("^,[01]+\\b")))
        or after("^[   ]*(?:[kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰€$£¥Åℓhj]|min|°C|℃)(?![\\w’'])"))
    ->> =formatNumber(\0)                                                                           # Formatage des grands nombres.

__[s]/num(num_nombre_quatre_chiffres)__
    (?<!,)(\d\d\d\d)[  ]([a-zA-Zµ][a-zA-Z0-9Ωℓ⁰¹²³⁴⁵⁶⁷⁸⁹/·]*) @@0,$
    <<- morph(\2, ";S", ":[VCR]") or mbUnit(\2) -1>> =formatNumber(\1)                              # Formatage des grands nombres.

TEST: {{12345}}                                 ->> 12 345
................................................................................
TEST: {{0234567890}}                            ->> 0 234 567 890|02 34 56 78 90|023 456 78 90|0234 567-890
TEST: {{12345678901}}                           ->> 12 345 678 901
TEST: {{112798931830912839}}                    ->> 112 798 931 830 912 839
TEST: {{2308393909}}                            ->> 2 308 393 909|2308 393-909
TEST: {{2024}},9                                ->> 2 024
TEST: {{4000}} Å                                ->> 4 000
TEST: {{3240}} µA                               ->> 3 240
TEST: 1111 0011,01 (binaire)


__[s>(num_grand_nombre_avec_points)__
    \d\d?\d?(?:[.]\d\d\d)+(?![0-9])
    <<- option("num") ->> =\0.replace(".", " ")                                                     # Grands nombres : utilisez des espaces insécables plutôt que des points.
    <<- ~>> =\0.replace(".", "_")