Grammalecte  Check-in [d283df68f1]

Overview
Comment:[core][py] quick hack to avoid stupidity of .istitle()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: d283df68f190c642a9313b1012f772a39cf59135f723a0d44b948769ca7506ef
User & Date: olr on 2018-06-21 09:11:46
Other Links: branch diff | manifest | tags
Context
2018-06-21
11:37
[core] gc engine: small debugging readability improvement check-in: acd785f13d user: olr tags: core, rg
09:11
[core][py] quick hack to avoid stupidity of .istitle() check-in: d283df68f1 user: olr tags: core, rg
08:49
[fr] conversion: regex rules -> graph rules check-in: 23921e7012 user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [5229bc46eb] to [889885e93a].

599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
    def _getNextMatchingNodes (self, dToken, dGraph, dNode, bDebug=False):
        "generator: return nodes where <dToken> “values” match <dNode> arcs"
        # token value
        if dToken["sValue"] in dNode:
            if bDebug:
                print("MATCH:", dToken["sValue"])
            yield dGraph[dNode[dToken["sValue"]]]
        if dToken["sValue"].istitle():
            sValue = dToken["sValue"].lower()
            if sValue in dNode:
                if bDebug:
                    print("MATCH:", sValue)
                yield dGraph[dNode[sValue]]
        elif dToken["sValue"].isupper():
            sValue = dToken["sValue"].lower()







|







599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
    def _getNextMatchingNodes (self, dToken, dGraph, dNode, bDebug=False):
        "generator: return nodes where <dToken> “values” match <dNode> arcs"
        # token value
        if dToken["sValue"] in dNode:
            if bDebug:
                print("MATCH:", dToken["sValue"])
            yield dGraph[dNode[dToken["sValue"]]]
        if dToken["sValue"][0:2].istitle(): # we test only 2 first chars, to make valid words such as "Laissez-les", "Passe-partout".
            sValue = dToken["sValue"].lower()
            if sValue in dNode:
                if bDebug:
                    print("MATCH:", sValue)
                yield dGraph[dNode[sValue]]
        elif dToken["sValue"].isupper():
            sValue = dToken["sValue"].lower()