Grammalecte  Check-in [312cfd6793]

Overview
Comment:[graphspell] fix export and update showDistance()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 312cfd6793314bfa80d2613f9124220d1b9e2d211839567b7c60e31c41611fdc
User & Date: olr on 2020-12-03 14:44:18
Other Links: manifest | tags
Context
2020-12-03
20:59
[graphspell] spellchecker: fix function name check-in: a681336660 user: olr tags: graphspell, trunk
14:44
[graphspell] fix export and update showDistance() check-in: 312cfd6793 user: olr tags: graphspell, trunk
14:43
[fr] ajustements check-in: cd832d45da user: olr tags: fr, trunk
Changes

Modified graphspell-js/str_transform.js from [a1596e1ca3] to [2de0e81f6b].

   249    249             }
   250    250           }
   251    251   
   252    252           return weight;
   253    253       },
   254    254   
   255    255       showDistance (s1, s2) {
   256         -        console.log(`Distance: ${s1} / ${s2} = ${this.distanceDamerauLevenshtein(s1, s2)})`);
          256  +        console.log(`Distance Jaro-Winkler: ${s1} / ${s2} = ${this.distanceJaroWinkler(s1, s2)})`);
          257  +        console.log(`Distance Damerau-Levenshtein: ${s1} / ${s2} = ${this.distanceDamerauLevenshtein(s1, s2)})`);
   257    258       },
   258    259   
   259    260       // Suffix only
   260    261       defineSuffixCode: function (sFlex, sStem) {
   261    262           /*
   262    263               Returns a string defining how to get stem from flexion
   263    264                   "n(sfx)"
................................................................................
   337    338   
   338    339   if (typeof(exports) !== 'undefined') {
   339    340       exports.simplifyWord = str_transform.simplifyWord;
   340    341       exports.numbersToExponent = str_transform.numbersToExponent;
   341    342       exports.spellingNormalization = str_transform.spellingNormalization;
   342    343       exports.longestCommonSubstring = str_transform.longestCommonSubstring;
   343    344       exports.distanceDamerauLevenshtein = str_transform.distanceDamerauLevenshtein;
   344         -    exports.distanceDamerauLevenshtein2 = str_transform.distanceDamerauLevenshtein2;
          345  +    exports.distanceJaroWinkler = str_transform.distanceJaroWinkler;
   345    346       exports.showDistance = str_transform.showDistance;
   346    347       exports.changeWordWithSuffixCode = str_transform.changeWordWithSuffixCode;
   347    348       exports.changeWordWithAffixCode = str_transform.changeWordWithAffixCode;
   348    349       exports.defineAffixCode = str_transform.defineAffixCode;
   349    350       exports.defineSuffixCode = str_transform.defineSuffixCode;
   350    351   }

Modified graphspell/str_transform.py from [ee895b8347] to [3aad4bb295].

   250    250               i1 = i2 = min(i1, i2)
   251    251       nLargestCS += nLocalCS
   252    252       return round(max(nLen1, nLen2) - nLargestCS + nTrans)
   253    253   
   254    254   
   255    255   def showDistance (s1, s2):
   256    256       "display Damerau-Levenshtein distance and Sift4 distance between <s1> and <s2>"
          257  +    print("Jaro-Winkler: " + s1 + "/" + s2 + " = " + distanceJaroWinkler(s1, s2))
   257    258       print("Damerau-Levenshtein: " + s1 + "/" + s2 + " = " + distanceDamerauLevenshtein(s1, s2))
   258    259       print("Sift4:" + s1 + "/" + s2 + " = " + distanceSift4(s1, s2))
   259    260   
   260    261   
   261    262   
   262    263   
   263    264   #### STEMMING OPERATIONS