Grammalecte  Check-in [5f36613e44]

Overview
Comment:[graphspell] default suggestions: handle casing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | rg
Files: files | file ages | folders
SHA3-256: 5f36613e44e808dfb463aacaea1258bd4a482534fee09a539dde7049921e0f28
User & Date: olr on 2018-06-03 08:31:26
Other Links: branch diff | manifest | tags
Context
2018-06-03
08:32
[graphspell] default suggestions for French language check-in: 7290d51bd9 user: olr tags: graphspell, rg
08:31
[graphspell] default suggestions: handle casing check-in: 5f36613e44 user: olr tags: graphspell, rg
2018-06-02
20:45
[graphspell] suggestion: ca -> ça check-in: 5fdc97b597 user: olr tags: graphspell, rg
Changes

Modified graphspell/spellchecker.py from [6e35967f77] to [70326fed78].

222
223
224
225
226
227
228

229
230





231
232
233
234
235
236
237
            if sWord not in self._dLemmas:
                self.getMorph(sWord)
            return self._dLemmas[sWord]
        return set([ s[1:s.find(" ")]  for s in self.getMorph(sWord) ])

    def suggest (self, sWord, nSuggLimit=10):
        "generator: returns 1, 2 or 3 lists of suggestions"

        if self.dDefaultSugg and sWord in self.dDefaultSugg:
            yield self.dDefaultSugg[sWord].split("|")





        else:
            yield self.oMainDic.suggest(sWord, nSuggLimit)
        if self.bExtendedDic:
            yield self.oExtendedDic.suggest(sWord, nSuggLimit)
        if self.bCommunityDic:
            yield self.oCommunityDic.suggest(sWord, nSuggLimit)
        if self.bPersonalDic:







>
|
|
>
>
>
>
>







222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
            if sWord not in self._dLemmas:
                self.getMorph(sWord)
            return self._dLemmas[sWord]
        return set([ s[1:s.find(" ")]  for s in self.getMorph(sWord) ])

    def suggest (self, sWord, nSuggLimit=10):
        "generator: returns 1, 2 or 3 lists of suggestions"
        if self.dDefaultSugg:
            if sWord in self.dDefaultSugg:
                yield self.dDefaultSugg[sWord].split("|")
            elif sWord.istitle() and sWord.lower() in self.dDefaultSugg:
                lRes = self.dDefaultSugg[sWord.lower()].split("|")
                yield list(map(lambda sSugg: sSugg[0:1].upper()+sSugg[1:], lRes))
            else:
                yield self.oMainDic.suggest(sWord, nSuggLimit)
        else:
            yield self.oMainDic.suggest(sWord, nSuggLimit)
        if self.bExtendedDic:
            yield self.oExtendedDic.suggest(sWord, nSuggLimit)
        if self.bCommunityDic:
            yield self.oCommunityDic.suggest(sWord, nSuggLimit)
        if self.bPersonalDic: