Grammalecte  Check-in [84c2ade56e]

Overview
Comment:[graphspell][py] fix import
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 84c2ade56eb54b1540cd8948368c42c7878938d7e59e124715fefc9c9ed0604d
User & Date: olr on 2018-02-11 18:26:09
Other Links: manifest | tags
Context
2018-02-11
19:19
[graphspell][bug] ibdawg: fix confusion between <char value> and <tag value> check-in: ad412c44e3 user: olr tags: graphspell, trunk
18:26
[graphspell][py] fix import check-in: 84c2ade56e user: olr tags: graphspell, trunk
16:06
[graphspell][py] ibdawg: initialization from binary file or JSON check-in: 96290e4468 user: olr tags: graphspell, trunk
Changes

Modified graphspell/ibdawg.py from [fc4fe9f629] to [56b76111df].

     3      3   import os
     4      4   import traceback
     5      5   import pkgutil
     6      6   import re
     7      7   from functools import wraps
     8      8   import datetime
     9      9   import time
           10  +import json
    10     11   
    11     12   #import logging
    12     13   #logging.basicConfig(filename="suggestions.log", level=logging.DEBUG)
    13     14   
    14     15   from . import str_transform as st
    15     16   from . import char_player as cp
    16     17   from .echo import echo
................................................................................
   177    178                   "  Compression method: {0.nCompressionMethod:>2}   Date: {0.sDate}   Stemming: {0.cStemming}FX\n" \
   178    179                   "  Arcs values:  {0.nArcVal:>10,} = {0.nChar:>5,} characters,  {0.nAff:>6,} affixes,  {0.nTag:>6,} tags\n" \
   179    180                   "  Dictionary: {0.nEntry:>12,} entries,    {0.nNode:>11,} nodes,   {0.nArc:>11,} arcs\n" \
   180    181                   "  Address size: {0.nBytesNodeAddress:>1} bytes,  Arc size: {0.nBytesArc:>1} bytes\n".format(self)
   181    182   
   182    183       def writeAsJSObject (self, spfDest, bInJSModule=False, bBinaryDictAsHexString=False):
   183    184           "write IBDAWG as a JavaScript object in a JavaScript module"
   184         -        import json
   185    185           with open(spfDest, "w", encoding="utf-8", newline="\n") as hDst:
   186    186               if bInJSModule:
   187    187                   hDst.write('// JavaScript\n// Generated data (do not edit)\n\n"use strict";\n\nconst dictionary = ')
   188    188               hDst.write(json.dumps({
   189    189                               "sHeader": "/pyfsa/",
   190    190                               "sLangCode": self.sLangCode,
   191    191                               "sLangName": self.sLangName,