Grammalecte  Check-in [75d0244b27]

Overview
Comment:[graphspell] valid token: ignore tokens containing dots
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 75d0244b2778f50663932315ff2edd8dfffb3cc587ee5aaa780a5222794c142b
User & Date: olr on 2018-04-21 07:20:09
Other Links: manifest | tags
Context
2018-04-21
07:40
[lo] dictionary options: update label about spelling suggestions check-in: 58bcefb7a6 user: olr tags: trunk, lo
07:20
[graphspell] valid token: ignore tokens containing dots check-in: 75d0244b27 user: olr tags: trunk, graphspell
2018-04-20
19:00
[fr] pt: sans vergogne check-in: 4735aa2358 user: olr tags: trunk, fr
Changes

Modified graphspell-js/ibdawg.js from [81f8cf0a21] to [d1f48fa224].

221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
        }
        if (sToken.includes("-")) {
            if (sToken.gl_count("-") > 4) {
                return true;
            }
            return sToken.split("-").every(sWord  =>  this.isValid(sWord)); 
        }
        if (sToken.includes("·")) {
            return true;
        }
        return false;
    }

    isValid (sWord) {
        // checks if sWord is valid (different casing tested if the first letter is a capital)







|







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
        }
        if (sToken.includes("-")) {
            if (sToken.gl_count("-") > 4) {
                return true;
            }
            return sToken.split("-").every(sWord  =>  this.isValid(sWord)); 
        }
        if (sToken.includes(".") || sToken.includes("·")) {
            return true;
        }
        return false;
    }

    isValid (sWord) {
        // checks if sWord is valid (different casing tested if the first letter is a capital)

Modified graphspell/ibdawg.py from [dcb23698b6] to [78322a7e47].

228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
        sToken = cp.spellingNormalization(sToken)
        if self.isValid(sToken):
            return True
        if "-" in sToken:
            if sToken.count("-") > 4:
                return True
            return all(self.isValid(sWord)  for sWord in sToken.split("-"))
        if "·" in sToken:
            return True
        return False

    def isValid (self, sWord):
        "checks if <sWord> is valid (different casing tested if the first letter is a capital)"
        if not sWord:
            return None







|







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
        sToken = cp.spellingNormalization(sToken)
        if self.isValid(sToken):
            return True
        if "-" in sToken:
            if sToken.count("-") > 4:
                return True
            return all(self.isValid(sWord)  for sWord in sToken.split("-"))
        if "." in sToken or "·" in sToken:
            return True
        return False

    def isValid (self, sWord):
        "checks if <sWord> is valid (different casing tested if the first letter is a capital)"
        if not sWord:
            return None