Grammalecte  Check-in [764811b5f1]

Overview
Comment:[graphspell] handling apostrophes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | rg
Files: files | file ages | folders
SHA3-256: 764811b5f19783c83bcb50bfd13541519375d39e87f5da56303360e3965260d3
User & Date: olr on 2018-08-26 14:44:48
Other Links: branch diff | manifest | tags
Context
2018-08-26
15:02
[fr] gendicfr: plus de copie des dictionnaires Hunspell dans les extensions Mozilla check-in: 8d3060486d user: olr tags: fr, rg
14:44
[graphspell] handling apostrophes check-in: 764811b5f1 user: olr tags: graphspell, rg
13:41
[fr] gendicfr: utilise le lemme alternatif s’il existe check-in: a9d1f17b1f user: olr tags: fr, rg
Changes

Modified graphspell-js/ibdawg.js from [068f06a16d] to [bd4ff8b3de].

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    }

    isValid (sWord) {
        // checks if sWord is valid (different casing tested if the first letter is a capital)
        if (!sWord) {
            return null;
        }
        if (sWord.includes("")) { // ugly hack
            sWord = sWord.replace("", "'");
        }
        if (this.lookup(sWord)) {
            return true;
        }
        if (sWord.charAt(0).gl_isUpperCase()) {
            if (sWord.length > 1) {
                if (sWord.gl_isTitle()) {







|
|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    }

    isValid (sWord) {
        // checks if sWord is valid (different casing tested if the first letter is a capital)
        if (!sWord) {
            return null;
        }
        if (sWord.includes("'")) { // ugly hack
            sWord = sWord.replace("'", "");
        }
        if (this.lookup(sWord)) {
            return true;
        }
        if (sWord.charAt(0).gl_isUpperCase()) {
            if (sWord.length > 1) {
                if (sWord.gl_isTitle()) {

Modified graphspell/ibdawg.py from [0f1b5456be] to [15b71c861b].

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
            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
        if "" in sWord: # ugly hack
            sWord = sWord.replace("", "'")
        if self.lookup(sWord):
            return True
        if sWord[0:1].isupper():
            if len(sWord) > 1:
                if sWord.istitle():
                    return self.lookup(sWord.lower())
                if sWord.isupper():







|
|







245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
            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
        if "'" in sWord: # ugly hack
            sWord = sWord.replace("'", "")
        if self.lookup(sWord):
            return True
        if sWord[0:1].isupper():
            if len(sWord) > 1:
                if sWord.istitle():
                    return self.lookup(sWord.lower())
                if sWord.isupper():