Grammalecte  Check-in [e1240a6d7e]

Overview
Comment:[core] gc engine: token tags
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: e1240a6d7e27c1c70814e7bf970f04f201c4f4c3c2800845c790d3130a464b1a
User & Date: olr on 2018-07-19 07:28:30
Other Links: branch diff | manifest | tags
Context
2018-07-19
07:33
[build] DARG builder: token tags check-in: 9b68ab4908 user: olr tags: build, rg
07:28
[core] gc engine: token tags check-in: e1240a6d7e user: olr tags: core, rg
05:45
[fr] conversion: regex rules -> graph rules check-in: 24988d689e user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [08553979b3] to [3e0ddd4369].

678
679
680
681
682
683
684







685
686
687
688
689
690
691
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]]
        # token tags
        if "tags" in dToken and "<tags>" in dNode:
            for sTag in dNode["<tags>"]:
                if sTag in dToken["tags"]:
                    if bDebug:
                        print("  MATCH: $" + sTag)
                    yield dGraph[dNode["<tags>"][sTag]]
        # meta arc (for token type)
        if "<meta>" in dNode:
            for sMeta in dNode["<meta>"]:
                # not regex here, we just search if <dNode["sType"]> exists within <sMeta>
                if sMeta == "*":
                    if bDebug:
                        print("  MATCH: *" + sMeta)