Changes In Branch rg Through [cb88d3d2dc] Excluding Merge-Ins
This is equivalent to a diff from f2d8271145 to cb88d3d2dc
2018-06-13
| ||
05:39 | [fr] merge rules in one file check-in: 6fb93b7388 user: olr tags: fr, rg | |
05:37 | [build] merge graph rules building and regex rules building check-in: cb88d3d2dc user: olr tags: build, rg | |
2018-06-12
| ||
19:55 | [fr] conversion: regex -> graph rules check-in: 3d50852f45 user: olr tags: fr, rg | |
2018-05-16
| ||
16:22 | [fr] pt: descente aux enfers/flambeaux check-in: b5310203be user: olr tags: trunk, fr | |
16:14 | [build][core] rules graph: first draft check-in: 061252f41e user: olr tags: core, build, rg | |
11:58 | [graphspell][bug] fix affixes occurrences calculation check-in: f2d8271145 user: olr tags: trunk, graphspell | |
2018-05-15
| ||
12:51 | [fr] test contre faux positif check-in: f8bf9c3922 user: olr tags: trunk, fr | |
Modified compile_rules.py from [1ea2b6d97a] to [22bdc8ba86].
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 |
︙ | |||
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 | - - - + + + + - + - - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + - + + | 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 |
︙ | |||
547 548 549 550 551 552 553 554 555 | 577 578 579 580 581 582 583 584 585 586 587 588 589 | + + + + | "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, sLang, bJavaScript) d.update(d2) return d |
Added compile_rules_graph.py version [e76a1b508a].