Grammalecte  Check-in [0187a02172]

Overview
Comment:[core] gc engine: tag()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: 0187a02172af031ed5ef26e851f8f592a65db5e012cae9273d0e9efb0ee35429
User & Date: olr on 2018-08-06 20:11:56
Other Links: branch diff | manifest | tags
Context
2018-08-07
07:27
[fr] conversion: regex rules -> graph rules check-in: 9b089fd7db user: olr tags: fr, rg
2018-08-06
20:11
[core] gc engine: tag() check-in: 0187a02172 user: olr tags: core, rg
19:59
[fr] conversion: regex rules -> graph rules check-in: dc7c85fc4b user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [652a920cd2] to [493b1ff4c9].

1132
1133
1134
1135
1136
1137
1138




1139
1140
1141
1142
1143
1144
1145
def g_tag_after (dToken, dTags, sTag):
    if sTag not in dTags:
        return False
    if dToken["i"] < dTags[sTag][1]:
        return True
    return False






def g_space_between_tokens (dToken1, dToken2, nMin, nMax=None):
    nSpace = dToken2["nStart"] - dToken1["nEnd"]
    if nSpace < nMin:
        return False
    if nMax is not None and nSpace > nMax:
        return False







>
>
>
>







1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
def g_tag_after (dToken, dTags, sTag):
    if sTag not in dTags:
        return False
    if dToken["i"] < dTags[sTag][1]:
        return True
    return False


def g_tag (dToken, sTag):
    return "tags" in dToken and sTag in dTags["tags"]


def g_space_between_tokens (dToken1, dToken2, nMin, nMax=None):
    nSpace = dToken2["nStart"] - dToken1["nEnd"]
    if nSpace < nMin:
        return False
    if nMax is not None and nSpace > nMax:
        return False