Grammalecte  Check-in [635140d716]

Overview
Comment:[graphspell][py] rename lexicographer file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | gcerw
Files: files | file ages | folders
SHA3-256: 635140d7163d234038e9b1a2d90cc1beee4a2d327316ce8e029452a012c4b31a
User & Date: olr on 2020-04-08 15:00:21
Other Links: branch diff | manifest | tags
Context
2020-04-08
18:29
[core][graphspell] move lexicographer to graphspell check-in: 66fb137996 user: olr tags: core, graphspell, gcerw
15:00
[graphspell][py] rename lexicographer file check-in: 635140d716 user: olr tags: graphspell, gcerw
14:07
merge trunk check-in: 5c14b1c9e0 user: olr tags: gcerw
Changes

Name change from graphspell/fr.py to graphspell/lexgraph_fr.py.

Modified graphspell/spellchecker.py from [a290bf205a] to [b9cca64fbd].

33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47







-
+







        self.oCommunityDic = self._loadDictionary(sfCommunityDic)
        self.oPersonalDic = self._loadDictionary(sfPersonalDic)
        self.bCommunityDic = bool(self.oCommunityDic)
        self.bPersonalDic = bool(self.oPersonalDic)
        self.oTokenizer = None
        # Default suggestions
        self.lexicographer = None
        self.loadLang(sLangCode)
        self.loadLexicographer(sLangCode)
        # storage
        self.bStorage = False
        self._dMorphologies = {}        # key: flexion, value: list of morphologies
        self._dLemmas = {}              # key: flexion, value: list of lemmas

    def _loadDictionary (self, source, bNecessary=False):
        "returns an IBDAWG object"
98
99
100
101
102
103
104
105

106
107
108

109
110
111
112
113
114
115
98
99
100
101
102
103
104

105
106
107

108
109
110
111
112
113
114
115







-
+


-
+







    def deactivatePersonalDictionary (self):
        "deactivate personal dictionary"
        self.bPersonalDic = False


    # Default suggestions

    def loadLang (self, sLangCode):
    def loadLexicographer (self, sLangCode):
        "load default suggestion module for <sLangCode>"
        try:
            self.lexicographer = importlib.import_module("."+sLangCode, "grammalecte.graphspell")
            self.lexicographer = importlib.import_module(".lexgraph_"+sLangCode, "grammalecte.graphspell")
        except ImportError:
            print("No suggestion module for language <"+sLangCode+">")
            return

    def analyze (self, sWord):
        "returns a list of words and their morphologies"
        if not self.lexicographer: