Grammalecte  Check-in [c35d85a03b]

Overview
Comment:[graphspell] spellchecker: missing docstrings
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: c35d85a03b62030f68a32c250cfb8ad2724db8b60019af1c05253c50aba88804
User & Date: olr on 2020-09-10 19:25:03
Other Links: manifest | tags
Context
2020-09-10
19:34
[fr] tests: useless imports check-in: 2a513248b5 user: olr tags: trunk, fr
19:25
[graphspell] spellchecker: missing docstrings check-in: c35d85a03b user: olr tags: trunk, graphspell
19:06
[fx] gc panel: clipboard fallback when failed check-in: a6007f74a3 user: olr tags: trunk, fx
Changes

Modified graphspell/spellchecker.py from [0ef2e9e17a] to [3d385eb49e].

124
125
126
127
128
129
130

131
132
133
134
135








136
137
138
139
140
141
142
                else:
                    aRes = [ (sMorph, self.lexicographer.readableMorph(sMorph)) for sMorph in lMorph ]
                if aRes:
                    lWordAndMorph.append((sElem, aRes))
        return lWordAndMorph

    def readableMorph (self, sMorph):

        if not self.lexicographer:
            return ""
        return self.lexicographer.readableMorph(sMorph)

    def setLabelsOnToken (self, dToken):








        if not self.lexicographer:
            return
        if "lMorph" not in dToken:
            dToken["lMorph"] = self.getMorph(dToken["sValue"])
        if dToken["sType"] == "WORD":
            dToken["bValidToken"] = self.isValidToken(dToken["sValue"])
            sPrefix, sStem, sSuffix = self.lexicographer.split(dToken["sValue"])







>





>
>
>
>
>
>
>
>







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
                else:
                    aRes = [ (sMorph, self.lexicographer.readableMorph(sMorph)) for sMorph in lMorph ]
                if aRes:
                    lWordAndMorph.append((sElem, aRes))
        return lWordAndMorph

    def readableMorph (self, sMorph):
        "returns a human readable meaning of tags of <sMorph>"
        if not self.lexicographer:
            return ""
        return self.lexicographer.readableMorph(sMorph)

    def setLabelsOnToken (self, dToken):
        """on <dToken>,
            adds:
                - lMorph: list of morphologies
                - aLabels: list of labels (human readable meaning of tags)
            for WORD tokens:
                - bValidToken: True if the token is valid for the spellchecker
                - lSubTokens for each parts of the split token
        """
        if not self.lexicographer:
            return
        if "lMorph" not in dToken:
            dToken["lMorph"] = self.getMorph(dToken["sValue"])
        if dToken["sType"] == "WORD":
            dToken["bValidToken"] = self.isValidToken(dToken["sValue"])
            sPrefix, sStem, sSuffix = self.lexicographer.split(dToken["sValue"])