Grammalecte  Check-in [5dc606a9bd]

Overview
Comment:[graphspell][py][bug] ibdawg: fix dictionary of chars
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | multid
Files: files | file ages | folders
SHA3-256: 5dc606a9bdf575c32c8c98c2aeff3cbe5417bd97468b9aa91d184b6b30fc29c3
User & Date: olr on 2018-02-13 16:57:52
Original Comment: [ibdawg][py][bug] fix dictionary of chars
Other Links: branch diff | manifest | tags
Context
2018-02-13
18:34
[graphspell] add space in comments check-in: 6a6c2f6878 user: olr tags: graphspell, multid
16:57
[graphspell][py][bug] ibdawg: fix dictionary of chars check-in: 5dc606a9bd user: olr tags: graphspell, multid
16:05
[graphspell][py] drawPath() for spellchecker check-in: ad736fa52b user: olr tags: graphspell, multid
Changes

Modified graphspell/ibdawg.py from [6527ad55bf] to [3bf18d8144].

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
        self.nNode = int(l.pop(0))
        self.nArc = int(l.pop(0))
        self.nAff = int(l.pop(0))
        self.cStemming = l.pop(0)
        self.nTag = self.nArcVal - self.nChar - self.nAff
        # <dChar> to get the value of an arc, <dCharVal> to get the char of an arc with its value
        self.dChar = {}
        for i in range(1, self.nChar):
            self.dChar[self.lArcVal[i]] = i
        self.dCharVal = { v: k  for k, v in self.dChar.items() }
        self.nBytesOffset = 1 # version 3

    def _initJSON (self):
        "initialize with a JSON text file"
        self.__dict__.update(json.loads(self.by.decode("utf-8")))







|







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
        self.nNode = int(l.pop(0))
        self.nArc = int(l.pop(0))
        self.nAff = int(l.pop(0))
        self.cStemming = l.pop(0)
        self.nTag = self.nArcVal - self.nChar - self.nAff
        # <dChar> to get the value of an arc, <dCharVal> to get the char of an arc with its value
        self.dChar = {}
        for i in range(1, self.nChar+1):
            self.dChar[self.lArcVal[i]] = i
        self.dCharVal = { v: k  for k, v in self.dChar.items() }
        self.nBytesOffset = 1 # version 3

    def _initJSON (self):
        "initialize with a JSON text file"
        self.__dict__.update(json.loads(self.by.decode("utf-8")))