Changes In Branch rg Through [6af3286a97] Excluding Merge-Ins
This is equivalent to a diff from 24d41be12e to 6af3286a97
2018-06-22
| ||
07:46 | [cli] option to load personal dictionary check-in: cb3f319c08 user: olr tags: trunk, cli | |
2018-06-21
| ||
08:49 | [fr] conversion: regex rules -> graph rules check-in: 23921e7012 user: olr tags: fr, rg | |
2018-06-20
| ||
20:32 | [fr] small update check-in: 6af3286a97 user: olr tags: fr, rg | |
19:17 | [fr] avoid regex tokens at the beginning of rules check-in: 93b1465f7d user: olr tags: fr, rg | |
2018-06-18
| ||
18:13 | merge trunk check-in: 10458c45e6 user: olr tags: rg | |
2018-06-15
| ||
20:44 | [fr] faux positif: accord de laisser avec les pronoms sans impératif check-in: 24d41be12e user: olr tags: trunk, fr | |
2018-06-13
| ||
20:52 | [fr] faux positif: le nm de son ex-xxx nf check-in: a331351127 user: olr tags: trunk, fr | |
Modified compile_rules.py from [1ea2b6d97a] to [5d5d5d7bf2].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | import re import traceback import json import compile_rules_js_convert as jsconv import compile_rules_graph as crg dDEF = {} lFUNCTIONS = [] aRULESET = set() # set of rule-ids to check if there is several rules with the same id nRULEWITHOUTNAME = 0 |
︙ | |||
25 26 27 28 29 30 31 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - - + + - + - - - + + + - - - - - - + + + + + + | s = re.sub(r"isRealStart *\(\)", 'before("^ *$")', s) s = re.sub(r"isStart0 *\(\)", 'before0("^ *$|, *$")', s) s = re.sub(r"isRealStart0 *\(\)", 'before0("^ *$")', s) s = re.sub(r"isEnd *\(\)", 'after("^ *$|^,")', s) s = re.sub(r"isRealEnd *\(\)", 'after("^ *$")', s) s = re.sub(r"isEnd0 *\(\)", 'after0("^ *$|^,")', s) s = re.sub(r"isRealEnd0 *\(\)", 'after0("^ *$")', s) |
︙ | |||
108 109 110 111 112 113 114 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + + + + + + + + + | def createRule (s, nIdLine, sLang, bParagraph, dOptPriority): "returns rule as list [option name, regex, bCaseInsensitive, identifier, list of actions]" global dJSREGEXES global nRULEWITHOUTNAME |
︙ | |||
341 342 343 344 345 346 347 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | + - - + + | print("# Unknown action at line " + sIdAction) return None def _calcRulesStats (lRules): d = {'=':0, '~': 0, '-': 0, '>': 0} for aRule in lRules: if aRule[0] != "@@@@": |
︙ | |||
430 431 432 433 434 435 436 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 | - - - + + + + - + - - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + | except: print("Error. Rules file in project [" + sLang + "] not found.") exit() # removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines print(" parsing rules...") global dDEF |
︙ | |||
515 516 517 518 519 520 521 | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | - + - + | # creating file with all functions callable by rules print(" creating callables...") sPyCallables = "# generated code, do not edit\n" sJSCallables = "// generated code, do not edit\nconst oEvalFunc = {\n" for sFuncName, sReturn in lFUNCTIONS: cType = sFuncName[0:1] if cType == "c": # condition |
︙ | |||
547 548 549 550 551 552 553 554 555 | 579 580 581 582 583 584 585 586 587 588 589 590 591 | + + + + | "gctests": sGCTests, "gctestsJS": sGCTestsJS, "paragraph_rules": mergeRulesByOption(lParagraphRules), "sentence_rules": mergeRulesByOption(lSentenceRules), "paragraph_rules_JS": jsconv.writeRulesToJSArray(mergeRulesByOption(lParagraphRulesJS)), "sentence_rules_JS": jsconv.writeRulesToJSArray(mergeRulesByOption(lSentenceRulesJS)) } d.update(dOptions) # compile graph rules d2 = crg.make(lGraphRule, dDEF, sLang, bJavaScript) d.update(d2) return d |
Added compile_rules_graph.py version [c0410177dd].