62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
s = re.sub(r"\brealstart\(\)", 'before("^ *$")', s)
s = re.sub(r"\bstart0\(\)", 'before0("^ *$|, *$")', s)
s = re.sub(r"\brealstart0\(\)", 'before0("^ *$")', s)
s = re.sub(r"\bend\(\)", 'after("^ *$|^,")', s)
s = re.sub(r"\brealend\(\)", 'after("^ *$")', s)
s = re.sub(r"\bend0\(\)", 'after0("^ *$|^,")', s)
s = re.sub(r"\brealend0\(\)", 'after0("^ *$")', s)
s = re.sub(r"\b(select|exclude)[(][\\](\d+)", '\\1(dTokenPos, m.start(\\2), m.group(\\2)', s)
s = re.sub(r"\bdefine[(][\\](\d+)", 'define(dTokenPos, m.start(\\1)', s)
s = re.sub(r"\b(morph|info)[(][\\](\d+)", '\\1((m.start(\\2), m.group(\\2))', s)
s = re.sub(r"\b(morph|info)[(]", '\\1(dTokenPos, ', s)
s = re.sub(r"\b(sugg\w+|switch\w+)\(@", '\\1(m.group(i[4])', s)
s = re.sub(r"\bword\(\s*1\b", 'nextword1(sSentence, m.end()', s) # word(1)
s = re.sub(r"\bword\(\s*-1\b", 'prevword1(sSentence, m.start()', s) # word(-1)
s = re.sub(r"\bword\(\s*(\d)", 'nextword(sSentence, m.end(), \\1', s) # word(n)
|
|
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
s = re.sub(r"\brealstart\(\)", 'before("^ *$")', s)
s = re.sub(r"\bstart0\(\)", 'before0("^ *$|, *$")', s)
s = re.sub(r"\brealstart0\(\)", 'before0("^ *$")', s)
s = re.sub(r"\bend\(\)", 'after("^ *$|^,")', s)
s = re.sub(r"\brealend\(\)", 'after("^ *$")', s)
s = re.sub(r"\bend0\(\)", 'after0("^ *$|^,")', s)
s = re.sub(r"\brealend0\(\)", 'after0("^ *$")', s)
s = re.sub(r"\bselect[(][\\](\d+)", '\\1(dTokenPos, m.start(\\2), m.group(\\2)', s)
s = re.sub(r"\bdefine[(][\\](\d+)", 'define(dTokenPos, m.start(\\1)', s)
s = re.sub(r"\b(morph|info)[(][\\](\d+)", '\\1((m.start(\\2), m.group(\\2))', s)
s = re.sub(r"\b(morph|info)[(]", '\\1(dTokenPos, ', s)
s = re.sub(r"\b(sugg\w+|switch\w+)\(@", '\\1(m.group(i[4])', s)
s = re.sub(r"\bword\(\s*1\b", 'nextword1(sSentence, m.end()', s) # word(1)
s = re.sub(r"\bword\(\s*-1\b", 'prevword1(sSentence, m.start()', s) # word(-1)
s = re.sub(r"\bword\(\s*(\d)", 'nextword(sSentence, m.end(), \\1', s) # word(n)
|