Here is something I would like to do, I have a file, which something like this:
“key”-“content”, each “key” is not unique for the content, one key can have zero or more content that much….
The file is about 200Kb, I convert it in array, and put it all in the javascript. When user type, I loop the array once to find out the result, but it is slow…
Any suggestions on how to doing this? Thank you.
(Only client side javascript implementation is allowed, not allow to use server to analysis the result and send back.)
If I understood you right, these links to articles of John Resig may help you. His problem was the poor performance, when looking for valid words in a big text file while typing them.
Part 1: Dictionary Lookups in JavaScript
Part 2: JavaScript Trie Performance Analysis