Grammalecte  Diff

Differences From Artifact [aaea18bb6c]:

To Artifact [34a3376ab5]:


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
9
10
11
12
13
14
15

16
17
18
19
20
21
22







-







import re
import time
from contextlib import contextmanager

from ..graphspell.ibdawg import IBDAWG
from ..graphspell.echo import echo
from . import gc_engine
from . import gc_options
from . import conj
from . import phonet
from . import mfsp


@contextmanager
def timeblock (label, hDst):
216
217
218
219
220
221
222
223

224
225

226
227
228
229
230
231
232
215
216
217
218
219
220
221

222
223

224
225
226
227
228
229
230
231







-
+

-
+








    def _splitTestLine (self, sLine):
        sText, sSugg = sLine.split("->>")
        return (sText.strip(), sSugg.strip())

    def _getFoundErrors (self, sLine, sOption):
        if sOption:
            gc_options.setOption(sOption, True)
            gc_engine.gc_options.setOption(sOption, True)
            aErrs = gc_engine.parse(sLine)
            gc_options.setOption(sOption, False)
            gc_engine.gc_options.setOption(sOption, False)
        else:
            aErrs = gc_engine.parse(sLine)
        sRes = " " * len(sLine)
        sListErr = ""
        lAllSugg = []
        for dErr in aErrs:
            sRes = sRes[:dErr["nStart"]] + "~" * (dErr["nEnd"] - dErr["nStart"]) + sRes[dErr["nEnd"]:]