Grammalecte  Check-in [ee36aa096c]

Overview
Comment:[build] rules condition rewriting update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: ee36aa096cb9872248a8495ef4d23f614a46b6588d35cfba0b76cf935d8d304a
User & Date: olr on 2018-07-23 17:52:52
Other Links: branch diff | manifest | tags
Context
2018-07-23
17:54
[core] gc engine: fix bug check-in: b5a5b6b161 user: olr tags: core, rg
17:52
[build] rules condition rewriting update check-in: ee36aa096c user: olr tags: build, rg
17:51
[fr][core] analyse pour les verbes composés check-in: e778dbe980 user: olr tags: fr, core, rg
Changes

Modified compile_rules_graph.py from [86144631f9] to [7bc95b954c].

14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28







-
+







dFUNCTIONS = {}


def prepareFunction (s):
    "convert simple rule syntax to a string of Python code"
    s = s.replace("__also__", "bCondMemo")
    s = s.replace("__else__", "not bCondMemo")
    s = re.sub(r"(morph|analyse|value|displayInfo)[(]\\(\d+)", 'g_\\1(lToken[\\2+nTokenOffset]', s)
    s = re.sub(r"(morph|morphVC|analyse|value|displayInfo)[(]\\(\d+)", 'g_\\1(lToken[\\2+nTokenOffset]', s)
    s = re.sub(r"(select|exclude|define|define_from)[(][\\](\d+)", 'g_\\1(lToken[\\2+nTokenOffset]', s)
    s = re.sub(r"(tag_before|tag_after)[(][\\](\d+)", 'g_\\1(lToken[\\2+nTokenOffset], dTags', s)
    s = re.sub(r"space_after[(][\\](\d+)", 'g_space_between_tokens(lToken[\\1+nTokenOffset], lToken[\\1+nTokenOffset+1]', s)
    s = re.sub(r"analyse_with_next[(][\\](\d+)", 'g_merged_analyse(lToken[\\1+nTokenOffset], lToken[\\1+nTokenOffset+1]', s)
    s = re.sub(r"(morph|analyse|value)\(>1", 'g_\\1(lToken[nLastToken+1]', s)                       # next token
    s = re.sub(r"(morph|analyse|value)\(<1", 'g_\\1(lToken[nTokenOffset]', s)                       # previous token
    s = re.sub(r"\bspell *[(]", '_oSpellChecker.isValid(', s)