Grammalecte  Check-in [6977a98855]

Overview
Comment:[build] update: data conversion to JS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build
Files: files | file ages | folders
SHA3-256: 6977a98855524e3194b4d3bf9ca2f5af89c5129e70c362b9788de6bc0a62e578
User & Date: olr on 2018-11-25 09:32:18
Other Links: manifest | tags
Context
2018-11-25
12:03
[fr] faux positif: dates check-in: c7612a28d4 user: olr tags: trunk, fr
09:32
[build] update: data conversion to JS check-in: 6977a98855 user: olr tags: trunk, build
08:13
[fr] faux positifs check-in: 19d0fea7a4 user: olr tags: trunk, fr
Changes

Modified compile_rules_graph.py from [607f49e8f2] to [871ed3780f].

458
459
460
461
462
463
464
465

466
467

468
458
459
460
461
462
463
464

465
466

467
468







-
+

-
+

        print(sPyCallables)

    # Result
    return {
        "graph_callables": sPyCallables,
        "graph_callablesJS": sJSCallables,
        "rules_graphs": str(dAllGraph),
        "rules_graphsJS": str(dAllGraph).replace("True", "true").replace("False", "false"),
        "rules_graphsJS": str(dAllGraph),
        "rules_actions": str(dACTIONS),
        "rules_actionsJS": str(dACTIONS).replace("True", "true").replace("False", "false")
        "rules_actionsJS": jsconv.pyActionsToString(dACTIONS)
    }

Modified compile_rules_js_convert.py from [3755ac925a] to [22836fa3f3].

159
160
161
162
163
164
165








159
160
161
162
163
164
165
166
167
168
169
170
171
172
173







+
+
+
+
+
+
+
+

def groupsPositioningCodeToList (sGroupsPositioningCode):
    "convert <sGroupsPositioningCode> to a list of codes (numbers or strings)"
    if not sGroupsPositioningCode:
        return None
    return [ int(sCode)  if sCode.isdigit() or (sCode[0:1] == "-" and sCode[1:].isdigit())  else sCode \
             for sCode in sGroupsPositioningCode.split(",") ]


def pyActionsToString (dActions):
    for sKey, aValue in dActions.items():
        if aValue[2] == "-":
            aValue[3] = aValue[3].replace(" ", " ") # nbsp --> nnbsp
            aValue[10] = aValue[10].replace("« ", "« ").replace(" »", " »").replace(" :", " :").replace(" :", " :")
    return str(dActions).replace("True", "true").replace("False", "false");