Grammalecte  Check-in [d2cc0989db]

Overview
Comment:[graphspell] suggestion mechanism: extend search further
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: d2cc0989dbcc2e148f51f88b9365ccc24611135c5e806935f8e2e436cf29c005
User & Date: olr on 2021-02-09 16:23:51
Other Links: manifest | tags
Context
2021-02-10
08:45
[graphspell] JaroWinkler: modify variable names check-in: 6ee195e8d3 user: olr tags: graphspell, trunk
2021-02-09
16:23
[graphspell] suggestion mechanism: extend search further check-in: d2cc0989db user: olr tags: graphspell, trunk
10:17
[fr] dictionnaire: suppression du drapeau iM. Verbe “s’enquérir” -> iK check-in: 1c781094d2 user: olr tags: fr, trunk
Changes

Modified graphspell-js/ibdawg.js from [73dd04c644] to [34ce7a8182].

    30     30           // Temporary sets
    31     31           this.aAllSugg = new Set();  // All suggestions, even the one rejected
    32     32           this.dGoodSugg = new Map(); // Acceptable suggestions
    33     33           this.dBestSugg = new Map(); // Best suggestions
    34     34           // Parameters
    35     35           this.nSuggLimit = nSuggLimit;
    36     36           this.nSuggLimitExt = nSuggLimit + 2;                // we add few entries in case suggestions merge after casing modifications
    37         -        this.nBestSuggLimit = Math.floor(nSuggLimit * 1.5); // n times the requested limit
           37  +        this.nBestSuggLimit = Math.floor(nSuggLimit * 2);   // n times the requested limit
    38     38           this.nGoodSuggLimit = nSuggLimit * 15;              // n times the requested limit
    39     39       }
    40     40   
    41     41       addSugg (sSugg) {
    42     42           // add a suggestion
    43     43           if (this.aAllSugg.has(sSugg)) {
    44     44               return;

Modified graphspell/ibdawg.py from [15700e29f3] to [bd93f6353b].

    49     49           # Temporary sets
    50     50           self.aAllSugg = set()   # All suggestions, even the one rejected
    51     51           self.dGoodSugg = {}     # Acceptable suggestions
    52     52           self.dBestSugg = {}     # Best suggestions
    53     53           # Parameters
    54     54           self.nSuggLimit = nSuggLimit
    55     55           self.nSuggLimitExt = nSuggLimit + 2             # we add few entries in case suggestions merge after casing modifications
    56         -        self.nBestSuggLimit = floor(nSuggLimit * 1.5)   # n times the requested limit
           56  +        self.nBestSuggLimit = floor(nSuggLimit * 2)     # n times the requested limit
    57     57           self.nGoodSuggLimit = nSuggLimit * 15           # n times the requested limit
    58     58   
    59     59       def addSugg (self, sSugg, nDeep=0):
    60     60           "add a suggestion"
    61         -        #logging.info((nDeep * "  ") + "__" + sSugg + "__")
    62     61           if sSugg in self.aAllSugg:
    63     62               return
    64     63           self.aAllSugg.add(sSugg)
    65     64           nDistJaro = 1 - st.distanceJaroWinkler(self.sSimplifiedWord, st.simplifyWord(sSugg))
    66     65           nDist = floor(nDistJaro * 10)
           66  +        #logging.info((nDeep * "  ") + "__" + sSugg + "__ " + str(round(nDistJaro*1000)))
    67     67           if nDistJaro < .11:     # Best suggestions
    68     68               self.dBestSugg[sSugg] = round(nDistJaro*1000)
    69     69               if len(self.dBestSugg) > self.nBestSuggLimit:
    70     70                   self.nDistLimit = -1  # make suggest() to end search
    71     71           elif nDistJaro < .33:   # Good suggestions
    72     72               self.dGoodSugg[sSugg] = round(nDistJaro*1000)
    73     73               if len(self.dGoodSugg) > self.nGoodSuggLimit: