Changes In Branch mtok Through [684b825f2a] Excluding Merge-Ins
This is equivalent to a diff from f831e2b562 to 684b825f2a
2021-03-10
| ||
20:22 | [fr] faux positif check-in: 0915b69239 user: olr tags: trunk, fr | |
19:39 | [build] darg: regex for multi-token morphologies check-in: 1e120c280b user: olr tags: build, mtok | |
2021-03-09
| ||
17:23 | [fr] action du processeur de texte -> dans les règles par § uniquement check-in: 684b825f2a user: olr tags: fr, mtok | |
17:22 | [build] new: multi-token action check-in: 07442092e4 user: olr tags: build, mtok | |
17:20 | [misc] SublimeText syntaxic color check-in: 126b183b9d user: olr tags: misc, mtok | |
07:23 | [fr] ajustements check-in: f831e2b562 user: olr tags: trunk, fr | |
2021-03-06
| ||
23:10 | [fr] ajustements check-in: 199d498ccf user: olr tags: trunk, fr | |
Modified compile_rules_graph.py from [82cd1181fb] to [d24797f23b].
︙ | ︙ | |||
283 284 285 286 287 288 289 | if m: sOption = m.group(1) sAction = sAction[m.end():].strip() if nPriority == -1: nPriority = self.dOptPriority.get(sOption, 4) # valid action? | | | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | if m: sOption = m.group(1) sAction = sAction[m.end():].strip() if nPriority == -1: nPriority = self.dOptPriority.get(sOption, 4) # valid action? m = re.search(r"(?P<action>[-=~/!>&])(?P<start>-?\d+\.?|)(?P<end>:\.?-?\d+|)(?P<casing>:|)>>", sAction) if not m: print("\n# Error. No action found at: ", sLineId, sActionId) exit() # Condition sCondition = sAction[:m.start()].strip() if sCondition: |
︙ | ︙ | |||
371 372 373 374 375 376 377 | checkTokenNumbers(sCondition, sActionId, nToken) # check tokens in condition checkTokenNumbers(sAction, sActionId, nToken) # check tokens in action if cAction == ">": ## no action, break loop if condition is False return [sLineId, sOption, sCondition, cAction, ""] | | | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | checkTokenNumbers(sCondition, sActionId, nToken) # check tokens in condition checkTokenNumbers(sAction, sActionId, nToken) # check tokens in action if cAction == ">": ## no action, break loop if condition is False return [sLineId, sOption, sCondition, cAction, ""] if not sAction and cAction not in "!#": print(f"\n# Error in action at line <{sLineId}/{sActionId}>: This action is empty.") exit() if sAction[0:1] != "=" and cAction != "=": checkIfThereIsCode(sAction, sActionId) if cAction == "-": |
︙ | ︙ | |||
402 403 404 405 406 407 408 | nToken = sAction.count("|") + 1 if iStartAction > 0 and iEndAction > 0: if (iEndAction - iStartAction + 1) != nToken: print(f"\n# Error in action at line <{sLineId}/{sActionId}>: numbers of modified tokens modified.") elif iStartAction < 0 or iEndAction < 0 and iStartAction != iEndAction: print(f"\n# Warning in action at line <{sLineId}/{sActionId}>: rewriting with possible token position modified.") return [sLineId, sOption, sCondition, cAction, sAction, iStartAction, iEndAction, bCaseSensitivity] | | | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | nToken = sAction.count("|") + 1 if iStartAction > 0 and iEndAction > 0: if (iEndAction - iStartAction + 1) != nToken: print(f"\n# Error in action at line <{sLineId}/{sActionId}>: numbers of modified tokens modified.") elif iStartAction < 0 or iEndAction < 0 and iStartAction != iEndAction: print(f"\n# Warning in action at line <{sLineId}/{sActionId}>: rewriting with possible token position modified.") return [sLineId, sOption, sCondition, cAction, sAction, iStartAction, iEndAction, bCaseSensitivity] if cAction in "!/&": ## tags return [sLineId, sOption, sCondition, cAction, sAction, iStartAction, iEndAction] if cAction == "=": ## disambiguator sAction = self.createFunction("da", sAction) return [sLineId, sOption, sCondition, cAction, sAction] print("\n# Unknown action at ", sLineId, sActionId) |
︙ | ︙ | |||
541 542 543 544 545 546 547 | elif sLine.startswith(" ||"): # tokens line continuation iPrevLine, sPrevLine = lTokenLine[-1] lTokenLine[-1] = [iPrevLine, sPrevLine + " " + sLine.strip()[2:]] elif sLine.startswith(" <<- "): # actions lActions.append([iLine, sLine[12:].strip()]) | | | | 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 | elif sLine.startswith(" ||"): # tokens line continuation iPrevLine, sPrevLine = lTokenLine[-1] lTokenLine[-1] = [iPrevLine, sPrevLine + " " + sLine.strip()[2:]] elif sLine.startswith(" <<- "): # actions lActions.append([iLine, sLine[12:].strip()]) if not re.search(r"[-=~/!>&](?:-?\d\.?(?::\.?-?\d+|)|):?>>", sLine): bActionBlock = True elif sLine.startswith(" && "): # action message iPrevLine, sPrevLine = lActions[-1] lActions[-1] = [iPrevLine, sPrevLine + sLine] elif sLine.startswith(" ") and bActionBlock: # action line continuation iPrevLine, sPrevLine = lActions[-1] lActions[-1] = [iPrevLine, sPrevLine + " " + sLine.strip()] if re.search(r"[-=~/!>&](?:-?\d\.?(?::\.?-?\d+|)|):?>>", sLine): bActionBlock = False elif re.match("[ ]*$", sLine): # empty line to end merging if not lTokenLine: continue if bActionBlock or not lActions: print("# Error. No action found at line:", iLine) |
︙ | ︙ |
Modified gc_lang/fr/rules.grx from [16699b2371] to [9c6bc913d3].
︙ | ︙ | |||
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 | TEST: « Je suis donc perdu ? », dit Paul. TEST: “C’est bon !”, croit savoir Marie. TEST: “Parce que… ?” finit par demander Paul. TEST: « Dans quel pays sommes-nous ? » demanda un manifestant. !! !! !! !! !! | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 | TEST: « Je suis donc perdu ? », dit Paul. TEST: “C’est bon !”, croit savoir Marie. TEST: “Parce que… ?” finit par demander Paul. TEST: « Dans quel pays sommes-nous ? » demanda un manifestant. !!!! Purge des références aux notes !! # les références aux notes __<s>(p_exposants)__ [¹²³⁴⁵⁶⁷⁸⁹⁰]+ <<- ~>> * __[i](p_références_aux_notes)__ ({w_2})(\d+) @@0,$ <<- not morph(\0, ":") and morph(\1, ":") ~2>> * TEST: POLITIQUESOCIÉTÉÉCONOMIEMONDECULTUREART DE VIVREMAGAZINE (qui peut faire boguer JavaScript avec certaines regex) !!!! Normalisation du “t” euphonique !! __<i]/tu(tu_t_euphonique_incorrect)__ ([-–—− ]t(?:[’' ][-–—−]?|[-–—−][’' ]?))(ie?ls?|elles?|on|tu) @@0,$ <<- re.search("(?i)^(?:ie?ls|elles|tu)$", \2) -1>> - && Le “t” euphonique n’est pas nécessaire avec “\2”.|http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?T1=t+euphonique&id=2513 <<- __else__ and \1 != "-t-" and \1 != "-T-" -1>> -t- && Pour le “t” euphonique, il faut deux traits d’union. Pas d’apostrophe. Pas d’espace. <<- \1 != "-t-" ~1>> -t- __<i]/tu(tu_t_euphonique_superflu)__ [td]([- ]t[-’' ])(?:ie?l|elle|on) @@1 <<- -1>> - && Le “t” euphonique est superflu quand le verbe se termine par “t” ou “d”.|http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?T1=t+euphonique&id=2513 <<- \1 != "-t-" ~1>> -t- __<i]/eleu(eleu_t_euphonique_manquant)__ [aec](-(ie?l|elle|on)) @@1,2 <<- -1>> -t-\2 && Euphonie. Il faut un “t” euphonique.|http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?T1=t+euphonique&id=2513 TEST: va{{ t’}}il y parvenir ? ->> -t- TEST: A{{ t’}}elle soif ? ->> -t- TEST: A{{ t-}}elle faim ? ->> -t- TEST: a{{ t'}}elle ->> -t- TEST: a{{-t'}}il ->> -t- TEST: a{{-t }}il. ->> -t- TEST: a{{ t’}}il. ->> -t- TEST: a{{ t-}}on. ->> -t- TEST: donne{{ t-}}il ->> -t- TEST: donne{{-t }}il ->> -t- TEST: vient{{-t-}}il ->> - TEST: viendras{{-t-}}tu ->> - TEST: Viendront{{ t-}}ils ->> - TEST: viennent{{ t-}}ils ->> - TEST: mangent{{-t-}}elles ->> - TEST: Ont{{ t’}}ils ->> - TEST: Ont{{-t’}}ils ->> - TEST: l’ont{{ t’}}ils vu ? ->> - TEST: exploite{{−t−}}il les ressources numériques ->> -t- TEST: vainc{{-il}} ses ennemis aisément ->> -t-il TEST: Assis, gronde{{-t -}}elle ->> -t- TEST: vient-il demain ? TEST: prend-elle l’avantage ? TEST: saura-t-on jamais la vérité ? TEST: arrive-t-elle ce matin ? TEST: y aura-t-il du poulet au dîner ? !! !! !! !! !! |
︙ | ︙ | |||
1635 1636 1637 1638 1639 1640 1641 | __[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 ». TEST: année {{2O11}} ->> 2011 TEST: {{3O}} (chiffre avec un O). ->> 30 | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 | __[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 ». TEST: année {{2O11}} ->> 2011 TEST: {{3O}} (chiffre avec un O). ->> 30 !!!! Traits d’union !! __[i]/tu(tu_trait_union_douteux)__ ({w1})(?:--|—|–|−|⁃)({w1}) @@0,$ <<- spell(\1+"-"+\2) and analyse(\1+"-"+\2, ":") ->> \1-\2 && Trait d’union : un tiret simple suffit. TEST: Nous préparons une {{contre–attaque}}. ->> contre-attaque TEST: Nous préparons une {{contre−attaque}}. ->> contre-attaque @@@@ @@@@ @@@@ @@@@ @@@@GRAPH: graphe0|g0 _ |
︙ | ︙ | |||
3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 | <<- ~2:0>> ␣ <<- =>> define(\2, ":MP:m:s") ~^[A-ZÀÂÉÈÊÎÔ]. Airways <<- ~>> ␣ <<- =>> define(\2, ":MP:e:i") __immunités__ il y a il n’ y a <<- !-1>> à l’ arrache | > > > > > | 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 | <<- ~2:0>> ␣ <<- =>> define(\2, ":MP:m:s") ~^[A-ZÀÂÉÈÊÎÔ]. Airways <<- ~>> ␣ <<- =>> define(\2, ":MP:e:i") __merge__ à la fois <<- &>> :LW __immunités__ il y a il n’ y a <<- !-1>> à l’ arrache |
︙ | ︙ | |||
23205 23206 23207 23208 23209 23210 23211 | <<- /conf/ -3>> nues && Confusion. Écrivez “nues” (ancien terme pour “nuages”).|https://fr.wiktionary.org/wiki/tomber_des_nues TEST: Elle en est tombée des {{nus}}. ->> nues # numérique / digital __conf_numérique_digital__ | | > > | 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 | <<- /conf/ -3>> nues && Confusion. Écrivez “nues” (ancien terme pour “nuages”).|https://fr.wiktionary.org/wiki/tomber_des_nues TEST: Elle en est tombée des {{nus}}. ->> nues # numérique / digital __conf_numérique_digital__ [>agence|>appareil|>banque|>caméra|>colonie|>colonisation|>communication|>compagnie|>connexion] >digital [>document|>économie|>entreprise|>ère|>expérience|>fichier|>identité|>industrie|>présence|>prise] >digital [>service|>solution|>stratégie|>télévision|>transformation|>transition|>révolution] >digital <<- /conf/ -2>> numérique|numériques && Confusion : “digital” est un adjectif se rapportant aux doigts (empreinte digitale, arthrose digitale, etc.). Écrivez “numérique”. [le|du|au] digital <<- /conf/ -2>> numérique && Confusion : “digital” est un adjectif se rapportant aux doigts (empreinte digitale, arthrose digitale, etc.). Écrivez “numérique”. |
︙ | ︙ |
Modified misc/grammalecte.sublime-color-scheme from [c24fa9f267] to [a8384ba127].
︙ | ︙ | |||
64 65 66 67 68 69 70 | { "name": "Entity Valid", "scope": "entity.valid", "foreground": "hsl(150, 100%, 80%)", "background": "hsl(150, 100%, 20%)", "font_style": "bold", }, { "name": "Entity Invalid", "scope": "entity.invalid", "foreground": "hsl(0, 100%, 80%)", "background": "hsl(0, 100%, 20%)", "font_style": "bold", }, { "name": "Token meta", "scope": "string.meta", "foreground": "hsl(270, 100%, 90%)", "background": "hsl(270, 100%, 40%)", }, { "name": "Token token", "scope": "string.token", "foreground": "hsl(240, 50%, 90%)", "background": "hsl(240, 50%, 40%)", }, { "name": "Token Jumptoken", "scope": "string.jumptoken", "foreground": "hsl(0, 50%, 90%)", "background": "hsl(10, 50%, 40%)", }, { "name": "Token lemma", "scope": "string.lemma", "foreground": "hsl(210, 100%, 80%)", "background": "hsl(210, 100%, 15%)", }, | | | > | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | { "name": "Entity Valid", "scope": "entity.valid", "foreground": "hsl(150, 100%, 80%)", "background": "hsl(150, 100%, 20%)", "font_style": "bold", }, { "name": "Entity Invalid", "scope": "entity.invalid", "foreground": "hsl(0, 100%, 80%)", "background": "hsl(0, 100%, 20%)", "font_style": "bold", }, { "name": "Token meta", "scope": "string.meta", "foreground": "hsl(270, 100%, 90%)", "background": "hsl(270, 100%, 40%)", }, { "name": "Token token", "scope": "string.token", "foreground": "hsl(240, 50%, 90%)", "background": "hsl(240, 50%, 40%)", }, { "name": "Token Jumptoken", "scope": "string.jumptoken", "foreground": "hsl(0, 50%, 90%)", "background": "hsl(10, 50%, 40%)", }, { "name": "Token lemma", "scope": "string.lemma", "foreground": "hsl(210, 100%, 80%)", "background": "hsl(210, 100%, 15%)", }, { "name": "Token phonet", "scope": "string.phonet", "foreground": "hsl(90, 100%, 80%)", "background": "hsl(90, 100%, 10%)", }, { "name": "Token tag", "scope": "string.tag", "foreground": "hsl(30, 100%, 90%)", "background": "hsl(30, 100%, 20%)", }, { "name": "Token regex", "scope": "string.regex", "foreground": "hsl(60, 100%, 80%)", "background": "hsl(60, 100%, 10%)", }, { "name": "Token morph regex", "scope": "string.morph.regex", "foreground": "hsl(150, 80%, 90%)", "background": "hsl(150, 80%, 10%)", }, { "name": "Token morph negregex", "scope": "string.morph.negregex", "foreground": "hsl(0, 80%, 90%)", "background": "hsl(0, 80%, 10%)", }, { "name": "MulToken morph regex", "scope": "string.mt.morph.regex", "foreground": "hsl(180, 80%, 90%)", "background": "hsl(180, 80%, 10%)", }, { "name": "Keyword Python", "scope": "keyword.python", "foreground": "#A0A0A0", }, { "name": "Keyword", "scope": "keyword - (source.c keyword.operator | source.c++ keyword.operator | source.objc keyword.operator | source.objc++ keyword.operator), keyword.operator.word", "foreground": "#F06070", }, { "name": "String", "scope": "string", "foreground": "hsl(40, 100%, 80%)", }, { "name": "Number", "scope": "constant.numeric", "foreground": "hsl(270, 100%, 70%)", "font_style": "bold", }, |
︙ | ︙ |
Modified misc/grammalecte.sublime-syntax from [9e26acd942] to [d99bbc135a].
︙ | ︙ | |||
166 167 168 169 170 171 172 | - match: '(@)([^@\s¬]*)' scope: string.morph captures: 1: entity.valid 2: string.morph.regex | | > > > > > > | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | - match: '(@)([^@\s¬]*)' scope: string.morph captures: 1: entity.valid 2: string.morph.regex - match: '(\$)([^\s¬]*)' scope: string.morph captures: 1: entity.valid 2: string.morph.regex - match: '(&)([^\s¬]*)' scope: string.morph captures: 1: entity.valid 2: string.mt.morph.regex - match: '(/)[\w-]+' scope: string.tag captures: 1: entity.valid - match: '(?<=[^\w])([*][a-zA-Z0-9_]+)' scope: string.morph |
︙ | ︙ |