hmmm... 1000x? how does it scale though?
Actually even reading the article I'm not completely certain where that 1000x comes from, I suppose it's when compared to the naive approach.
11–20 of 22 posts
hmmm... 1000x? how does it scale though?
Actually even reading the article I'm not completely certain where that 1000x comes from, I suppose it's when compared to the naive approach.
They don't mention the approach I'd take for a naive spellcheck:
Generate a (giant) trie from the dictionary. Then perform a DFS on the trie allowing only edits from the input word, keeping track of the edits done so far - try no changes at each node first, then a deletion, then a change, then an insertion. This works better with a smaller alphabet size.
An optimization: a DAWG is potentially even better space-wise than a hashmap (effectively it ends up compressing the input data), but takes a while to precompute.
1000x is still O(1000N) == N. So technically not significantly faster.
1000x is still O(1000N) == N. So technically not significantly faster.
1000x is still O(1000N) == N. So technically not significantly faster.
Except that 'spelling' is a bounded problem. There aren't going to be more words in the dictionary, at least not orders more, any time soon. 'Scaling as the word list grows' is meaningless. So the only definition of 'faster' that matters is the one they used.
Some power languages (Dutch, German) have an infinite number of words, as you can take 2 nouns (fe a and b) and concatenate them to form a new one (ab means something else than ba). Some languages also have inflection....
BTW - if anyone's interested in the Go implementation let me know, I'll try to find it and post it somewhere.
hmmm... 1000x? how does it scale though?
It's easy to say "1000x" when they don't mention the reference :) Actually even reading the article I'm not completely certain where that 1000x comes from, I suppose it's when compared to the naive approach.
> This is three orders of magnitude less expensive (36 terms for n=9 and d=2)
Three orders of magnitude is 1000. Peter Norvig's approach was described above with:
> still expensive at search time (114,324 terms for n=9, a=36, d=2)
So 114,324 / 36 = 3,175, so "three orders of magnitude", and I suppose he went conservative by saying "1000x" rather than "3000x".
Am I mistaken?