Overview
Comment: | [build][core][fr] drop universal arc for meta arcs (analyzing tokens type) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fr | core | build | rg |
Files: | files | file ages | folders |
SHA3-256: |
2ac407c52f2c9d36dd708bb5bddfec30 |
User & Date: | olr on 2018-06-23 07:11:27 |
Other Links: | branch diff | manifest | tags |
Context
2018-06-23
| ||
08:11 | [fr] conversion: regex rules -> graph rules check-in: c79567338a user: olr tags: fr, rg | |
07:11 | [build][core][fr] drop universal arc for meta arcs (analyzing tokens type) check-in: 2ac407c52f user: olr tags: fr, core, build, rg | |
06:52 | [build] stop debugging display check-in: cbdcf386fd user: olr tags: build, rg | |
Changes
Modified darg.py from [2922c13402] to [182863e043].
︙ | ︙ | |||
153 154 155 156 157 158 159 | return self.__str__() == other.__str__() def getNodeAsDict (self): "returns the node as a dictionary structure" dNode = {} dReValue = {} dReMorph = {} | | | > | > > | | | > > | | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | return self.__str__() == other.__str__() def getNodeAsDict (self): "returns the node as a dictionary structure" dNode = {} dReValue = {} dReMorph = {} dRule = {} dLemma = {} dMeta = {} for sArc, oNode in self.dArcs.items(): if sArc.startswith("@") and len(sArc) > 1: dReMorph[sArc[1:]] = oNode.__hash__() elif sArc.startswith("~") and len(sArc) > 1: dReValue[sArc[1:]] = oNode.__hash__() elif sArc.startswith(">") and len(sArc) > 1: dLemma[sArc[1:]] = oNode.__hash__() elif sArc.startswith("*") and len(sArc) > 1: dMeta[sArc[1:]] = oNode.__hash__() elif sArc.startswith("##"): dRule[sArc[1:]] = oNode.__hash__() else: dNode[sArc] = oNode.__hash__() if dReValue: dNode["<re_value>"] = dReValue if dReMorph: dNode["<re_morph>"] = dReMorph if dLemma: dNode["<lemmas>"] = dLemma if dMeta: dNode["<meta>"] = dMeta if dRule: dNode["<rules>"] = dRule #if self.bFinal: # dNode["<final>"] = 1 return dNode |
Modified gc_core/py/lang_core/gc_engine.py from [97f5a67ddc] to [dbd98c6fb9].
︙ | ︙ | |||
625 626 627 628 629 630 631 | # token lemmas if "<lemmas>" in dNode: for sLemma in _oSpellChecker.getLemma(dToken["sValue"]): if sLemma in dNode["<lemmas>"]: if bDebug: print(" MATCH: >" + sLemma) yield dGraph[dNode["<lemmas>"][sLemma]] | < < < < < < | 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | # token lemmas if "<lemmas>" in dNode: for sLemma in _oSpellChecker.getLemma(dToken["sValue"]): if sLemma in dNode["<lemmas>"]: if bDebug: print(" MATCH: >" + sLemma) yield dGraph[dNode["<lemmas>"][sLemma]] # regex value arcs if "<re_value>" in dNode: for sRegex in dNode["<re_value>"]: if "¬" not in sRegex: # no anti-pattern if re.search(sRegex, dToken["sValue"]): if bDebug: |
︙ | ︙ | |||
674 675 676 677 678 679 680 681 682 683 684 685 686 687 | else: if sNegPattern and any(re.search(sNegPattern, sMorph) for sMorph in _oSpellChecker.getMorph(dToken["sValue"])): continue if not sPattern or any(re.search(sPattern, sMorph) for sMorph in _oSpellChecker.getMorph(dToken["sValue"])): if bDebug: print(" MATCH: @" + sRegex) yield dGraph[dNode["<re_morph>"][sRegex]] def parse (self, dGraph, dPriority, sCountry="${country_default}", dOptions=None, bShowRuleId=False, bDebug=False, bContext=False): dErr = {} dPriority = {} # Key = position; value = priority dOpt = _dOptions if not dOptions else dOptions lPointer = [] bChange = False | > > > > > > > > > > > > > > > > > | 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 | else: if sNegPattern and any(re.search(sNegPattern, sMorph) for sMorph in _oSpellChecker.getMorph(dToken["sValue"])): continue if not sPattern or any(re.search(sPattern, sMorph) for sMorph in _oSpellChecker.getMorph(dToken["sValue"])): if bDebug: print(" MATCH: @" + sRegex) yield dGraph[dNode["<re_morph>"][sRegex]] # meta arc (for token type) if "<meta>" in dNode: for sMeta in dNode["<meta>"]: if sMeta == "*": if bDebug: print(" MATCH: *" + sMeta) yield dGraph[dNode["<meta>"]["*"]] elif "¬" in sMeta: if dNode["sType"] not in sMeta: if bDebug: print(" MATCH: *" + sMeta) yield dGraph[dNode["<meta>"][sMeta]] elif dNode["sType"] in sMeta: if bDebug: print(" MATCH: *" + sMeta) yield dGraph[dNode["<meta>"][sMeta]] def parse (self, dGraph, dPriority, sCountry="${country_default}", dOptions=None, bShowRuleId=False, bDebug=False, bContext=False): dErr = {} dPriority = {} # Key = position; value = priority dOpt = _dOptions if not dOptions else dOptions lPointer = [] bChange = False |
︙ | ︙ |
Modified gc_lang/fr/rules.grx from [cf42f7d52c] to [425bfbfeed].
︙ | ︙ | |||
4740 4741 4742 4743 4744 4745 4746 | !! !! __locutions_invariables__ [plus|moins|autant] que [prévue|prévus|prévues] <<- -3>> prévu # Invariable. Implicitement, \1 que ce qui était prévu. | | | | 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 | !! !! __locutions_invariables__ [plus|moins|autant] que [prévue|prévus|prévues] <<- -3>> prévu # Invariable. Implicitement, \1 que ce qui était prévu. [plus|moins|aussi] ** que [prévue|prévus|prévues] <<- -4>> prévu # Invariable. Implicitement, \1 \2 que ce qui était prévu. [plus|moins|autant] [de|d’] ** que [prévue|prévus|prévues] <<- -5>> prévu # Invariable. Implicitement, \1 \2 \3 que ce qui était prévu. comme [annoncés|annoncée|annoncées] <<- -2>> annoncé # Invariable. Implicitement, comme ce qui était annoncé. comme [convenus|convenue|convenues] <<- -2>> convenu # Invariable. Implicitement, comme ce qui était convenu. |
︙ | ︙ | |||
5935 5936 5937 5938 5939 5940 5941 | loin d’ [être|ici] loin s’ en [faut|fallait] maintes fois malgré [ça|cela|ceci|tout] manu militari mieux [vaut|valait] tard que jamais moins que [nécessaire|prévu] | | | 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 | loin d’ [être|ici] loin s’ en [faut|fallait] maintes fois malgré [ça|cela|ceci|tout] manu militari mieux [vaut|valait] tard que jamais moins que [nécessaire|prévu] moitié ** ?,¿ moitié ** mot pour mot ne [lui|leur|m’|t’|nous|vous] en déplaise nez à nez non loin [de|d’] [ici|là] nulle part ô combien oh |
︙ | ︙ |