Term completion

From Livetrix

Jump to: navigation, search

The idea is a pop-up box of 'these known strings start with what you currently have in this input field' , like in google suggest.


You can aid people towards good terms by completing with the top ten of the possible completing strings. It may help people in hard to spell words (enter 'chih' and it will show 'chihuahua', among other things), and subtly give feedback on which terms are good ones - when you type half a word, you will see its various forms, common ones black, less common ones ligher in grayer shades.

It should, however, be clear that the list will not be complete, and the amount of results can be used but not be directly displayed - it's an interesting indication of the string's real-world use, but also just an indication at best.


Since a simple begins-with search on an indexed field is optimizable by the database as a simple binary search (or possibly a treewalk in an index - fairly trivial, in any case), a basic LIKE 'str%' SQL query should be quite snappy.


The current client-side HTML/JS version is somewhat incomplete, because of the sometimes hard to handle JS event handling. It does not change the entered text on keypresses like tab or enter, since this is probably more likely to confuse than to help, and since that makes keypresses fairly useless, all of those are disabled. You can click suggestions with the mouse, though.



[edit] See also

Code that was looked at:

Personal tools