Grammalecte  Check-in [86ac7fe88a]

Overview
Comment:[core] gc engine: define_from() update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: 86ac7fe88a182ae5bf0e3f9d59acb24a23b8d59008ca335c138d6441cc8b94e2
User & Date: olr on 2018-07-26 08:13:06
Other Links: branch diff | manifest | tags
Context
2018-07-26
08:13
[fr] conversion: regex rules -> graph rules check-in: 59eec1ef7b user: olr tags: fr, rg
08:13
[core] gc engine: define_from() update check-in: 86ac7fe88a user: olr tags: core, rg
2018-07-25
15:06
[fr] conversion: regex rules -> graph rules check-in: 11e28f20e0 user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [d74503b11e] to [3ecd1c5c57].

1166
1167
1168
1169
1170
1171
1172
1173
1174





1175
1176
1177
1178
1179
1180
1181
1166
1167
1168
1169
1170
1171
1172


1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184







-
-
+
+
+
+
+







def g_define (dToken, lMorph):
    "set morphologies of <dToken>, always return True"
    dToken["lMorph"] = lMorph
    #print("DA:", dToken["sValue"], lMorph)
    return True


def g_define_from (dToken, nLeft, nRight=None):
    dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"][slice(nLeft, nRight)])
def g_define_from (dToken, nLeft=None, nRight=None):
    if nLeft is not None:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"][slice(nLeft, nRight)])
    else:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"])
    return True


#### GRAMMAR CHECKER PLUGINS

${plugins}