Grammalecte  Check-in [2117c11a74]

Overview
Comment:[graphspell] char_player: word simplification, that was finally a bad idea -> back to previous behavior (almost)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 2117c11a7466938aa0d91617c5821c5f7abc50f205f0dcf4678eeca4bedc0639
User & Date: olr on 2018-11-24 15:58:56
Other Links: manifest | tags
Context
2018-11-24
18:28
[fr] faux positifs check-in: 240f417ec9 user: olr tags: fr, trunk
15:58
[graphspell] char_player: word simplification, that was finally a bad idea -> back to previous behavior (almost) check-in: 2117c11a74 user: olr tags: graphspell, trunk
15:36
[fr] màj: suj +avoir l’air, +nr: confusions, +ajustements check-in: bcdc5cdc8d user: olr tags: fr, trunk
Changes

Modified graphspell-js/char_player.js from [f96c981877] to [aaed91ab4d].

    18     18           for (let c of sWord) {
    19     19               sNewWord += this._xTransCharsForSpelling.gl_get(c, c);
    20     20           }
    21     21           return sNewWord.normalize("NFC");
    22     22       },
    23     23   
    24     24       _xTransCharsForSimplification: new Map([
    25         -        ['à', 'a'],  ['é', 'é'],  ['î', 'i'],  ['ô', 'o'],  ['û', 'u'],  ['ÿ', 'i'],  ['y', 'i'],
    26         -        ['â', 'a'],  ['è', 'é'],  ['ï', 'i'],  ['ö', 'o'],  ['ù', 'u'],  ['ŷ', 'i'],
    27         -        ['ä', 'a'],  ['ê', 'é'],  ['í', 'i'],  ['ó', 'o'],  ['ü', 'u'],  ['ý', 'i'],
    28         -        ['á', 'a'],  ['ë', 'é'],  ['ì', 'i'],  ['ò', 'o'],  ['ú', 'u'],  ['ỳ', 'i'],
    29         -        ['ā', 'a'],  ['ē', 'é'],  ['ī', 'i'],  ['ō', 'o'],  ['ū', 'u'],  ['ȳ', 'i'],
           25  +        ['à', 'a'],  ['é', 'e'],  ['î', 'i'],  ['ô', 'o'],  ['û', 'u'],  ['ÿ', 'i'],  ['y', 'i'],
           26  +        ['â', 'a'],  ['è', 'e'],  ['ï', 'i'],  ['ö', 'o'],  ['ù', 'u'],  ['ŷ', 'i'],
           27  +        ['ä', 'a'],  ['ê', 'e'],  ['í', 'i'],  ['ó', 'o'],  ['ü', 'u'],  ['ý', 'i'],
           28  +        ['á', 'a'],  ['ë', 'e'],  ['ì', 'i'],  ['ò', 'o'],  ['ú', 'u'],  ['ỳ', 'i'],
           29  +        ['ā', 'a'],  ['ē', 'e'],  ['ī', 'i'],  ['ō', 'o'],  ['ū', 'u'],  ['ȳ', 'i'],
    30     30           ['ç', 'c'],  ['ñ', 'n'],  ['k', 'q'],  ['w', 'v'],
    31     31           ['œ', 'oe'], ['æ', 'ae'],
    32     32           ['ſ', 's'],  ['ffi', 'ffi'],  ['ffl', 'ffl'],  ['ff', 'ff'],  ['ſt', 'ft'],  ['fi', 'fi'],  ['fl', 'fl'],  ['st', 'st']
    33     33       ]),
    34     34   
    35     35       simplifyWord: function (sWord) {
    36     36           // word simplication before calculating distance between words

Modified graphspell/char_player.py from [702cb9b352] to [64714404fb].

    13     13   
    14     14   def spellingNormalization (sWord):
    15     15       "nomalization NFC and removing ligatures"
    16     16       return unicodedata.normalize("NFC", sWord.translate(_xTransCharsForSpelling))
    17     17   
    18     18   
    19     19   _xTransCharsForSimplification = str.maketrans({
    20         -    'à': 'a',  'é': 'é',  'î': 'i',  'ô': 'o',  'û': 'u',  'ÿ': 'i',  "y": "i",
    21         -    'â': 'a',  'è': 'é',  'ï': 'i',  'ö': 'o',  'ù': 'u',  'ŷ': 'i',
    22         -    'ä': 'a',  'ê': 'é',  'í': 'i',  'ó': 'o',  'ü': 'u',  'ý': 'i',
    23         -    'á': 'a',  'ë': 'é',  'ì': 'i',  'ò': 'o',  'ú': 'u',  'ỳ': 'i',
    24         -    'ā': 'a',  'ē': 'é',  'ī': 'i',  'ō': 'o',  'ū': 'u',  'ȳ': 'i',
           20  +    'à': 'a',  'é': 'e',  'î': 'i',  'ô': 'o',  'û': 'u',  'ÿ': 'i',  "y": "i",
           21  +    'â': 'a',  'è': 'e',  'ï': 'i',  'ö': 'o',  'ù': 'u',  'ŷ': 'i',
           22  +    'ä': 'a',  'ê': 'e',  'í': 'i',  'ó': 'o',  'ü': 'u',  'ý': 'i',
           23  +    'á': 'a',  'ë': 'e',  'ì': 'i',  'ò': 'o',  'ú': 'u',  'ỳ': 'i',
           24  +    'ā': 'a',  'ē': 'e',  'ī': 'i',  'ō': 'o',  'ū': 'u',  'ȳ': 'i',
    25     25       'ç': 'c',  'ñ': 'n',  'k': 'q',  'w': 'v',
    26     26       'œ': 'oe',  'æ': 'ae',
    27     27       'ſ': 's',  'ffi': 'ffi',  'ffl': 'ffl',  'ff': 'ff',  'ſt': 'ft',  'fi': 'fi',  'fl': 'fl',  'st': 'st',
    28     28   })
    29     29   
    30     30   def simplifyWord (sWord):
    31     31       "word simplication before calculating distance between words"