Overview
Comment: | [graphspell] use nDistLimit to truncate number of suggestions |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | graphspell |
Files: | files | file ages | folders |
SHA3-256: |
f3a3ed9041d66e75a8c73a5a66daa068 |
User & Date: | olr on 2018-05-02 11:22:50 |
Original Comment: | [graphspell] use nDistLimit to trancate number of suggestions |
Other Links: | manifest | tags |
Context
2018-05-02
| ||
12:33 | [graphspell] spelling suggestion speed up: calculate approximate distance while exploring the word graph check-in: 2be7acdcad user: olr tags: trunk, graphspell | |
11:22 | [graphspell] use nDistLimit to truncate number of suggestions check-in: f3a3ed9041 user: olr tags: trunk, graphspell | |
10:29 | [graphspell] char_player: cut also prefixes for better suggestions check-in: 3955fe8676 user: olr tags: trunk, graphspell | |
Changes
Modified graphspell-js/ibdawg.js from [f093112b5c] to [83b959776d].
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - + + + + + | if (this.dSugg.get(0).length) { // we sort the better results with the original word let dDistTemp = new Map(); lRes.forEach((sSugg) => { dDistTemp.set(sSugg, str_transform.distanceDamerauLevenshtein(this.sWord, sSugg)); }); lRes = lRes.sort((sA, sB) => { return dDistTemp.get(sA) - dDistTemp.get(sB); }); dDistTemp.clear(); } |
︙ |
Modified graphspell/ibdawg.py from [d9511f25e6] to [9c9c4c03aa].
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - + - - - - + + + + + | self.aSugg.add(sSugg) if nDist < self.nMinDist: self.nMinDist = nDist self.nDistLimit = min(self.nDistLimit, self.nMinDist+2) def getSuggestions (self, nSuggLimit=10, nDistLimit=-1): "return a list of suggestions" |
︙ |