Grammalecte  Check-in [b89ba9acea]

Overview
Comment:[graphspell] dawg: rename var name <aff> to <sAff>
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | multid
Files: files | file ages | folders
SHA3-256: b89ba9aceaaee65c4a3568918c595aa82f1329b7fc64ec3be1605ed21157844d
User & Date: olr on 2018-03-20 13:19:58
Other Links: branch diff | manifest | tags
Context
2018-03-20
13:28
[graphspell][py] dawg: use <set> to prevent duplicate entries check-in: 9e16a5b1a9 user: olr tags: graphspell, multid
13:19
[graphspell] dawg: rename var name <aff> to <sAff> check-in: b89ba9acea user: olr tags: graphspell, multid
13:15
[graphspell] spellchecker: comments check-in: ae399c509c user: olr tags: graphspell, multid
Changes

Modified graphspell/dawg.py from [5d3489a731] to [6286ff6ef8].

70
71
72
73
74
75
76
77
78
79
80




81
82

83
84
85
86
87
88
89

90
91
92
93
94
95
96
70
71
72
73
74
75
76




77
78
79
80
81

82
83
84
85
86
87
88

89
90
91
92
93
94
95
96







-
-
-
-
+
+
+
+

-
+






-
+







            for c in sFlex:
                if c not in dChar:
                    dChar[c] = nChar
                    lChar.append(c)
                    nChar += 1
                dCharOccur[c] = dCharOccur.get(c, 0) + 1
            # affixes to find stem from flexion
            aff = funcStemmingGen(sFlex, sStem)
            if aff not in dAff:
                dAff[aff] = nAff
                lAff.append(aff)
            sAff = funcStemmingGen(sFlex, sStem)
            if sAff not in dAff:
                dAff[sAff] = nAff
                lAff.append(sAff)
                nAff += 1
            dAffOccur[aff] = dCharOccur.get(aff, 0) + 1
            dAffOccur[sAff] = dCharOccur.get(sAff, 0) + 1
            # tags
            if sTag not in dTag:
                dTag[sTag] = nTag
                lTag.append(sTag)
                nTag += 1
            dTagOccur[sTag] = dTagOccur.get(sTag, 0) + 1
            lEntry.append((sFlex, dAff[aff], dTag[sTag]))
            lEntry.append((sFlex, dAff[sAff], dTag[sTag]))
        if not lEntry:
            raise ValueError("# Error. Empty lexicon")
        
        # Preparing DAWG
        print(" > Preparing list of words")
        lVal = lChar + lAff + lTag
        lWord = [ [dChar[c] for c in sFlex] + [iAff+nChar] + [iTag+nChar+nAff]  for sFlex, iAff, iTag in lEntry ]