Grammalecte  Check-in [291494dd43]

Overview
Comment:[graphspell] ibdawg: isValid -> True if word is digit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 291494dd43dedc3e207d73debb2efebf3dd9a5c387096546aa6474da9b69853c
User & Date: olr on 2018-04-04 15:10:54
Original Comment: [graphspell] ibdawg: isValid -> True if word is diqit
Other Links: manifest | tags
Context
2018-04-04
15:31
[lo] use LibreOffice API to implement a spellchecker check-in: a25b510c2c user: olr tags: trunk, lo
15:10
[graphspell] ibdawg: isValid -> True if word is digit check-in: 291494dd43 user: olr tags: trunk, graphspell
2018-04-03
13:47
[fr] trait d’union: bouche-à-bouche check-in: 1c99700665 user: olr tags: trunk, fr
Changes

Modified graphspell-js/ibdawg.js from [ab8a6cc9bc] to [1351b5e397].

229
230
231
232
233
234
235



236
237
238
239
240
241
242
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245







+
+
+







            return null;
        }
        if (sWord.includes("’")) { // ugly hack
            sWord = sWord.replace("’", "'");
        }
        if (this.lookup(sWord)) {
            return true;
        }
        if (sWord.gl_isDigit()) {
            return true;
        }
        if (sWord.charAt(0).gl_isUpperCase()) {
            if (sWord.length > 1) {
                if (sWord.gl_isTitle()) {
                    return !!this.lookup(sWord.toLowerCase());
                }
                if (sWord.gl_isUpperCase()) {

Modified graphspell/ibdawg.py from [f523996e8f] to [9dd4726d13].

233
234
235
236
237
238
239


240
241
242
243
244
245
246
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248







+
+







    def isValid (self, sWord):
        "checks if <sWord> is valid (different casing tested if the first letter is a capital)"
        if not sWord:
            return None
        if "’" in sWord: # ugly hack
            sWord = sWord.replace("’", "'")
        if self.lookup(sWord):
            return True
        if sWord.isdigit():
            return True
        if sWord[0:1].isupper():
            if len(sWord) > 1:
                if sWord.istitle():
                    return self.lookup(sWord.lower())
                if sWord.isupper():
                    if self.bOptNumSigle: