Closed rinigus closed 6 years ago
@ljo or @martonmiklos : please review. I'll wait for 24h, if there are no objections, I'll merge the commit. I presume that one review should be sufficient, if we get it done.
Its possible to test forget
branch on device using the build from my devel version of keyboard OBS: https://build.merproject.org/project/show/home:rinigus:keyboard:devel . To trigger forget action, just press and hold the word in Maliit keyboard.
Note that if you try to forget a word by typing it, pressing space, trying to type again and then forgetting it while its available in the history, it will be relearned immediately. So, delete the word first, before trying to forget it.
PS: @ljo or @martonmiklos: If you want to review, but cannot in time, let me know. I just want to keep momentum and move with the development...
:D Haha I have seen that you have figured out how to handle the lack of response. I agree with deadlines, and I would like to keep the release at the weekend schedule. Our weekend will start on Thursday because of national holiday so the free time related things looks better than they used to be.
@rinigus Yes, sorry was occupied with meeting other deadlines. But agree deadlines are good. :)
Thanks guys! I'll fix the printout and then will merge it tonight, assuming that there are no other outstanding issues. For testing, please use devel OBS. As soon as hunspell is in SFOS plugin, I'll submit the 'forget' branch for review as well.
Thank you for reviews, merged.
Fixes: https://github.com/sailfish-keyboard/presage/issues/19
Through method
forget
, a word can be given that will be forgotten by all actively learning predictors. In practice, its implemented for smoothedNgramPredictor only since the other predictors are either not learning or hard to use in practice (DejavuPredictor
) on mobile devices due to the heavy resource consumption.In the implementation, the given word is searched for in all n-grams (any of the words) and the corresponding n-grams are removed. This is done for word as given (case sensitive) as well as normalized version (at present we use lowercasing, this will change with Unicode, will have adjust
forget
method of the predictor).As a limitation, word is not deleted from predictors that have learning disabled (files are either readonly or predictor doesn't support write operations, as for Marisa).