Trie in JavaScript: The data structure behind autocomplete
1–10 of 59 posts
Re: Trie in JavaScript: The data structure behind autocomplete
#2However, for autocomplete you often want a weighted Trie because you have extra information you want to weight nodes by. An example with contacts is that you often want recent and frequent contacts.
My company has an open source trie implementation here for a client to do weighted contact auto complete: https://github.com/shortwave/trie
Re: Trie in JavaScript: The data structure behind autocomplete
#3Re: Trie in JavaScript: The data structure behind autocomplete
#4https://github.com/mgraczyk/fast-trie-js/blob/master/index.j...
I used it for this little demo:
Re: Trie in JavaScript: The data structure behind autocomplete
#5Tries are fun structures! However, for autocomplete you often want a weighted Trie because you have extra information you want to weight nodes by. An example with contacts is that you often want recent and frequent contacts. My company has an open source trie implementation here for a client to do weighted contact auto complete: https://github.com/shortwave/trie
Re: Trie in JavaScript: The data structure behind autocomplete
#6I wrote a little Trie in Javascript for practice a while back. It flattens the data into a single array for better locality. I think it ends up being pretty quick for lookups (but not insertions). https://github.com/mgraczyk/fast-trie-js/blob/master/index.j... I used it for this little demo: https://assets.opentoken.com/demos/search/index.html
Re: Trie in JavaScript: The data structure behind autocomplete
#7Re: Trie in JavaScript: The data structure behind autocomplete
#8 e.g. ABD matches A Brown Dog
^ ^ ^Re: Trie in JavaScript: The data structure behind autocomplete
#9The basic trie only matches exact consecutive characters. Does anyone know the data structure/trie variant for matching partial sequential characters? e.g. ABD matches A Brown Dog ^ ^ ^
Re: Trie in JavaScript: The data structure behind autocomplete
#10The basic trie only matches exact consecutive characters. Does anyone know the data structure/trie variant for matching partial sequential characters? e.g. ABD matches A Brown Dog ^ ^ ^