Thread:Talk:Universal Language Selector/m x n language names/reply (5)

I'm glad that you're doing this... a few comments from the peanut gallery:

The idea of Unicode code point mod 1000 is interesting. I've never heard of anything like that. I would have assumed a Trie for this. That would give you more efficient results for the common cases which are all in code page 1 or 2. But, Tries and PHP and the current deployment process don't play nice together. So maybe your way is best.

(You should be caching query results for 1-3 characters anyway, so it barely matters what you do on the backend.)

It's not clear to me that levenshtein distance is appropriate... we are talking about one or two characters typed before the best result is shown, 99% of the time. Nobody is going to get to type 'finish', they are going to type 'fi' at most and then arrow down to 'Finnish'. There is immediate feedback that you made a mistake when the auto-completions disappear, showing that you must have screwed something up. I understand you want to deal with typos, but i'm not sure what the right strategy is for autocomplete plus typo-forgiveness.