Grammalecte  Check-in [ffacab70c5]

Overview
Comment:[build] check regexes: memorize checked regexes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: ffacab70c520b32f1eb98ade47405f5ab90684fb20b9319ac011d8cd03a51b7a
User & Date: olr on 2018-06-27 23:30:57
Other Links: branch diff | manifest | tags
Context
2018-06-27
23:36
[build] check regexes: memorize checked regexes check-in: 6f12ea6825 user: olr tags: build, rg
23:30
[build] check regexes: memorize checked regexes check-in: ffacab70c5 user: olr tags: build, rg
23:26
[build] check regexes of DARGs check-in: cf5fbaf4dc user: olr tags: build, rg
Changes

Modified compile_rules_graph.py from [ffaec91e64] to [9a2e2f9a01].

263
264
265
266
267
268
269

270
271
272
273

274

275
276

277


278
279
280
281
282
283
284
        print("# Unknown action at line " + sActionId)
        return None


def checkRegexes (dAllGraph):
    "check validity of regexes"
    print("  checking regexes...")

    for sGraphName, dGraph in dAllGraph.items():
        for nKey, dVal in dGraph.items():
            if "<re_value>" in dVal:
                for sRegex in dVal["<re_value>"]:

                    _checkRegex(sRegex)

            if "<re_morph>" in dVal:
                for sRegex in dVal["<re_morph>"]:

                    _checkRegex(sRegex)



def _checkRegex (sRegex):
    #print(sRegex)
    if "¬" in sRegex:
        sPattern, sNegPattern = sRegex.split("¬")
        try:
            if not sNegPattern:







>




>
|
>


>
|
>
>







263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
        print("# Unknown action at line " + sActionId)
        return None


def checkRegexes (dAllGraph):
    "check validity of regexes"
    print("  checking regexes...")
    aRegex = set()
    for sGraphName, dGraph in dAllGraph.items():
        for nKey, dVal in dGraph.items():
            if "<re_value>" in dVal:
                for sRegex in dVal["<re_value>"]:
                    if sRegex not in aRegex:
                        _checkRegex(sRegex)
                        aRegex.add(sRegex)
            if "<re_morph>" in dVal:
                for sRegex in dVal["<re_morph>"]:
                    if sRegex not in aRegex:
                        _checkRegex(sRegex)
                        aRegex.add(sRegex)
    aRegex.clear()

def _checkRegex (sRegex):
    #print(sRegex)
    if "¬" in sRegex:
        sPattern, sNegPattern = sRegex.split("¬")
        try:
            if not sNegPattern: