Grammalecte  Check-in [3a15f6b206]

Overview
Comment:[lo] lexical editor: wait pointers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lo | multid
Files: files | file ages | folders
SHA3-256: 3a15f6b206522d6f4d8e85e856dc9b1f8e17afc5243b90fe46c4b2d3bc12a395
User & Date: olr on 2018-03-27 13:01:14
Other Links: branch diff | manifest | tags
Context
2018-03-27
14:48
[lo] lexicon editor: export dictionary (sigh: file picker doesn’t work at all) check-in: d03e3c0ed1 user: olr tags: lo, multid
13:01
[lo] lexical editor: wait pointers check-in: 3a15f6b206 user: olr tags: lo, multid
09:02
[lo] lexicon editor: search check-in: 73ecf7a6c0 user: olr tags: lo, multid
Changes

Modified gc_lang/fr/oxt/DictOptions/SearchWords.py from [19b4306ad7] to [cd7d6b9804].

1
2
3
4
5
6
7
8
# Search and informations about tags
# by Olivier R.
# License: MPL 2

import unohelper
import uno
import traceback

|







1
2
3
4
5
6
7
8
# Search
# by Olivier R.
# License: MPL 2

import unohelper
import uno
import traceback

169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
194
195
196
        except:
            traceback.print_exc()

    def initSpellChecker (self):
        if not self.oSpellChecker:
            self.oSpellChecker = sc.SpellChecker("fr", "fr.bdic", "", "", "")


    def searchSimilar (self):
        self.initSpellChecker()
        sWord = self.xWord.Text.strip()
        if sWord:
            xGridDataModel = self.xGridModel.GridDataModel
            xGridDataModel.removeAllRows()
            lResult = self.oSpellChecker.getSimilarEntries(sWord, 20);
            for i, aEntry in enumerate(lResult):
                xGridDataModel.addRow(i, aEntry)


    def searchRegex (self):
        self.initSpellChecker()
        sFlexPattern = self.xFlexion.Text.strip()
        sTagsPattern = self.xTags.Text.strip()
        xGridDataModel = self.xGridModel.GridDataModel
        xGridDataModel.removeAllRows()
        for i, aEntry in enumerate(self.oSpellChecker.select(sFlexPattern, sTagsPattern)):
            xGridDataModel.addRow(i, aEntry)
            i += 1
            if i >= 2000:
                break







>










>











169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
        except:
            traceback.print_exc()

    def initSpellChecker (self):
        if not self.oSpellChecker:
            self.oSpellChecker = sc.SpellChecker("fr", "fr.bdic", "", "", "")

    @_waitPointer
    def searchSimilar (self):
        self.initSpellChecker()
        sWord = self.xWord.Text.strip()
        if sWord:
            xGridDataModel = self.xGridModel.GridDataModel
            xGridDataModel.removeAllRows()
            lResult = self.oSpellChecker.getSimilarEntries(sWord, 20);
            for i, aEntry in enumerate(lResult):
                xGridDataModel.addRow(i, aEntry)

    @_waitPointer
    def searchRegex (self):
        self.initSpellChecker()
        sFlexPattern = self.xFlexion.Text.strip()
        sTagsPattern = self.xTags.Text.strip()
        xGridDataModel = self.xGridModel.GridDataModel
        xGridDataModel.removeAllRows()
        for i, aEntry in enumerate(self.oSpellChecker.select(sFlexPattern, sTagsPattern)):
            xGridDataModel.addRow(i, aEntry)
            i += 1
            if i >= 2000:
                break