Grammalecte  Check-in [3aa7844bdc]

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 on 2019-08-22 12:04:56
Other Links: manifest | tags
Context
2019-08-22
21:35
[fr] faux positif: nombre négatif check-in: b7bc5ec2e7 user: olr tags: trunk, fr
12:04
[fr] faux positif: grand nombre binaire check-in: 3aa7844bdc user: olr tags: trunk, fr
11:16
[fr] nr: da substantifs, +ajustements check-in: ba1ed47d1e user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/rules.grx from [d1cf473bd1] to [e53158c191].

1315
1316
1317
1318
1319
1320
1321
1322
1323


1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341

1342
1343
1344
1345
1346
1347
1348
1315
1316
1317
1318
1319
1320
1321


1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
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]+[⁰¹²³⁴⁵⁶⁷⁸⁹]?|[⁰¹²³⁴⁵⁶⁷⁸⁹])")
        or after("^[   ]*(?:[kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰€$£¥Åℓhj]|min|°C|℃)(?![\\w’'])")
        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: {{123456}}                                ->> 123 456
TEST: {{1234567}}                               ->> 1 234 567
TEST: {{12345678}}                              ->> 12 345 678
TEST: {{023456789}}                             ->> 023 456 789|023 45 67 89|02 345 67 89
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(".", "_")