Revised JavaScript Dictionary Search
ejohn.org
ejohn.org
Source and format documentation here:
since your covering all the bases. you should look at the bloom filters.
something like this could work and be created on the server.
http://dren.ch/js-bloom-filter/
(not the newest post has a compatible perl and ruby impl)
Ilya Grigorik has a couple of relevant posts
http://www.igvita.com/2008/12/27/scalable-datasets-bloom-fil...
and
a ruby + redis backend.
https://github.com/igrigorik/bloomfilter
here are some of the memory footprints that Ilya got
* 1.0% error rate for 1M items, 10 bits/item: 2.5 mb
* 1.0% error rate for 150M items, 10 bits per item: 358.52 mb
* 0.1% error rate for 150M items, 15 bits per item: 537.33 mbLet's assume that the bloom filter is as fast as a hash lookup (unlikely, but anyway) - at most it'll be saving me about 5-46ms of lookup time, with some non-trivial additional memory usage and data transfer. I'm 100% OK with having 5-46ms of lookup time if it means that I can have such an incredibly low memory profile. If lookups took somewhere around 200ms then yeah, I'd definitely look at layering a bloom filter on top of this. As it stands though using a bloom filter will only add additional code and memory usage for a negligible amount of benefit.
the first link would do the lookup in javascript so it would run in the client.
and the storage is just a string so wouldn't have the javascript parsing on load.
John, do you have a link to the corpus you’re using, so that we can use it for tests? Or should people just send in code for you to test?
Edit: nevermind, it's here: https://github.com/jeresig/trie-js/raw/master/dict/string.tx...
Ouch! A succinct trie I implemented in C++ took 2-3 microseconds for lookups. I guess Javascript is not the best language for low-level data structures engineering.