Grammalecte  Check-in [6e4f6d12f0]

Overview
Comment:[core] gc engine, text processor: remove useless commands, code clarification
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: 6e4f6d12f0bead9361f72b04394742244a7a44c8b4903e2659e14b30a6bdfef3
User & Date: olr on 2018-06-03 17:43:47
Other Links: branch diff | manifest | tags
Context
2018-06-04
08:11
[graphspell] French ad hoc suggestions check-in: 7c28bd0420 user: olr tags: graphspell, rg
2018-06-03
17:43
[core] gc engine, text processor: remove useless commands, code clarification check-in: 6e4f6d12f0 user: olr tags: core, rg
13:51
[build][core] gc engine update check-in: 1d9246b161 user: olr tags: build, core, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [dc1fba7ea9] to [1262fde6c4].

   312    312       if bContext:
   313    313           dErr['sUnderlined'] = sSentence0[dErr["nStart"]:dErr["nEnd"]]
   314    314           dErr['sBefore'] = sSentence0[max(0,dErr["nStart"]-80):dErr["nStart"]]
   315    315           dErr['sAfter'] = sSentence0[dErr["nEnd"]:dErr["nEnd"]+80]
   316    316       return dErr
   317    317   
   318    318   
   319         -def _rewrite (s, sRepl, iGroup, m, bUppercase):
   320         -    "text processor: write sRepl in s at iGroup position"
          319  +def _rewrite (sSentence, sRepl, iGroup, m, bUppercase):
          320  +    "text processor: write <sRepl> in <sSentence> at <iGroup> position"
   321    321       nLen = m.end(iGroup) - m.start(iGroup)
   322    322       if sRepl == "*":
   323    323           sNew = " " * nLen
   324         -    elif sRepl == ">" or sRepl == "_" or sRepl == "~":
          324  +    elif sRepl == "_":
   325    325           sNew = sRepl + " " * (nLen-1)
   326         -    elif sRepl == "@":
   327         -        sNew = "@" * nLen
   328    326       elif sRepl[0:1] == "=":
   329         -        sNew = globals()[sRepl[1:]](s, m)
          327  +        sNew = globals()[sRepl[1:]](sSentence, m)
   330    328           sNew = sNew + " " * (nLen-len(sNew))
   331    329           if bUppercase and m.group(iGroup)[0:1].isupper():
   332    330               sNew = sNew.capitalize()
   333    331       else:
   334    332           sNew = m.expand(sRepl)
   335    333           sNew = sNew + " " * (nLen-len(sNew))
   336         -    return s[0:m.start(iGroup)] + sNew + s[m.end(iGroup):]
          334  +    return sSentence[0:m.start(iGroup)] + sNew + sSentence[m.end(iGroup):]
   337    335   
   338    336   
   339    337   def ignoreRule (sRuleId):
   340    338       _aIgnoredRules.add(sRuleId)
   341    339   
   342    340   
   343    341   def resetIgnoreRules ():