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:
|