Grammalecte  Check-in [24a4a34b13]

Overview
Comment:[build] fix function rewriting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build
Files: files | file ages | folders
SHA3-256: 24a4a34b1300ec5b78d67edb57b6d72b11b59d1be9d214b4e637455c1dd22d39
User & Date: olr on 2020-11-28 21:20:08
Other Links: manifest | tags
Context
2020-11-28
22:58
[graphspell] tags update check-in: 811bdac5f7 user: olr tags: trunk, graphspell
21:20
[build] fix function rewriting check-in: 24a4a34b13 user: olr tags: trunk, build
21:19
[fr] ajustements check-in: dea5222659 user: olr tags: trunk, fr
Changes

Modified compile_rules_graph.py from [ae796c907e] to [611d15ee62].

54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68







-
+







    sCode = re.sub(r"\b(morph0?|tag|meta|value)\(<(\d+)", 'g_\\1(g_token(lToken, nTokenOffset+1-\\2)', sCode)   # previous token
    sCode = re.sub(r"\bspace[(](>1)", 'g_space(lToken[nLastToken+1], g_token(lToken, nLastToken+2)', sCode)     # next token
    sCode = re.sub(r"\bspace[(](<1)", 'g_space(lToken[nTokenOffset], lToken[nTokenOffset+1]', sCode)            # previous token
    sCode = re.sub(r"\bspell *[(]", '_oSpellChecker.isValid(', sCode)
    sCode = re.sub(r"\bbefore\(\s*", 'look(sSentence[:lToken[1+nTokenOffset]["nStart"]], ', sCode)          # before(sCode)
    sCode = re.sub(r"\bafter\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode)                 # after(sCode)
    sCode = re.sub(r"\bbefore0\(\s*", 'look(sSentence0[:lToken[1+nTokenOffset]["nStart"]], ', sCode)        # before0(sCode)
    sCode = re.sub(r"\bafter0\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode)                # after0(sCode)
    sCode = re.sub(r"\bafter0\(\s*", 'look(sSentence0[lToken[nLastToken]["nEnd"]:], ', sCode)               # after0(sCode)
    sCode = re.sub(r"\bagreement[(]\\(\d+), *\\(\d+)", 'g_agreement(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\2]', sCode)
    sCode = re.sub(r"\bagreement[(]\\(\d+), *\\-(\d+)", 'g_agreement(lToken[nTokenOffset+\\1], lToken[nLastToken-\\2+1]', sCode)
    sCode = re.sub(r"[\\](\d+)", 'lToken[nTokenOffset+\\1]["sValue"]', sCode)
    sCode = re.sub(r"[\\]-(\d+)", 'lToken[nLastToken-\\1+1]["sValue"]', sCode)
    sCode = re.sub(r">1", 'lToken[nLastToken+1]["sValue"]', sCode)
    sCode = re.sub(r"<1", 'lToken[nTokenOffset]["sValue"]', sCode)
    return sCode