Closed
Bug 858158
Opened 12 years ago
Closed 12 years ago
[keyboard] document prediction algorithm
Categories
(Firefox OS Graveyard :: Gaia::Keyboard, defect)
Tracking
(b2g18 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
b2g18 | --- | fixed |
People
(Reporter: djf, Assigned: ckerschb)
References
Details
Attachments
(1 file, 1 obsolete file)
The word prediction code in apps/keyboard/imes/latin/predictions.js is hard to understand. For maintainability, I'd like to see an explanation, in English, of how the algorithm works.
Also, I think this is an algorithm that we're going to want to tune, especially as we introduce auto-correction. We might want to tweak the multipliers for transpositions, insertions, deletions, for example. Similarly, there are presumably constants we need for weighting results that involve nearby keys and the length of the result words relative to the input text. It would be nice to have these constants all in one spot in the file.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #735391 -
Flags: review?(dflanagan)
Attachment #735391 -
Flags: review?(anygregor)
Assignee | ||
Comment 2•12 years ago
|
||
Sorry, I guess it's easier if I just paste the link to the pull request here:
https://github.com/mozilla-b2g/gaia/pull/9071
Reporter | ||
Comment 3•12 years ago
|
||
Comment on attachment 735391 [details] [review]
pull request
Christoph,
Thank you, the comment is very helpful. I still have questions though (see github) and I hope you'll write more.
Please just ask for review again when you've got more documentation.
Attachment #735391 -
Flags: review?(dflanagan)
Reporter | ||
Comment 4•12 years ago
|
||
Here's another question that you might address in the documentation:
Looking at the predictSuffixes() code, it looks as if the frequency field of any node is being used to save the highest frequency of any word stored under that node, and if I'm understanding the code correctly, it looks like the tree is structured so that that highest-frequency word is found by traversing the center pointer.
That seems like a very important feature of the data structure that needs to be documented, especially since it implies that the tree is balanced in a non-traditional way.
Assignee | ||
Comment 5•12 years ago
|
||
David, can you have a look at the documentation again - hopefully this description highlights the important parts of the algorithm and makes things clearer.
https://github.com/mozilla-b2g/gaia/pull/9071
Reporter | ||
Comment 6•12 years ago
|
||
Christoph,
Thanks. I understand the nptr now. I've added more comments on github, but as far as I'm concerned you can land this whenever you're ready. Unless you plan to work on the tuneability part of it under this bug.
Assignee | ||
Comment 7•12 years ago
|
||
David,
I guess I addressed all your comments on the bug, please find a new pull request here:
https://github.com/mozilla-b2g/gaia/pull/9106
Attachment #735391 -
Attachment is obsolete: true
Attachment #735391 -
Flags: review?(anygregor)
Attachment #736128 -
Flags: review?(dflanagan)
Attachment #736128 -
Flags: review?(anygregor)
Reporter | ||
Comment 8•12 years ago
|
||
Comment on attachment 736128 [details] [review]
link to pull request
Christoph,
This looks fine to me. I'm not sure if you have commit rights, and since this is just a comment, we don't need gregor's r+ also, so I'll just go ahead and land it.
We can add tuneable weightings in another bug.
Attachment #736128 -
Flags: review?(dflanagan) → review+
Reporter | ||
Comment 9•12 years ago
|
||
Comment on attachment 736128 [details] [review]
link to pull request
Sorry, actually, I can't merge because the comment makes the Travis build fail with lint errors (spaces and the end of lines, I think). So you need to run fixjsstyle over the commit before we can land it.
If you've got commit rights, though, feel free to land it yourself when you're fixed the lint.
Attachment #736128 -
Flags: review+ → review-
Updated•12 years ago
|
Assignee: nobody → mozilla
Comment 10•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Summary: [keyboard] document prediction algorithm and make it tuneable → [keyboard] document prediction algorithm
Updated•12 years ago
|
Attachment #736128 -
Flags: review?(anygregor) → review+
Comment 11•12 years ago
|
||
Please add a testcase for this bug to moztrap for 1.1 testsuite. If yes, mark this in-moztrap+ when completed. If not, mark this in-moztrap-.
Updated•12 years ago
|
Flags: in-moztrap?
Comment 13•12 years ago
|
||
This fix should be covered by auto correct work
Flags: in-moztrap? → in-moztrap-
Updated•11 years ago
|
Attachment mime type: text/plain text/plain → text/x-github-pull-request text/x-github-pull-request
You need to log in
before you can comment on or make changes to this bug.
Description
•