How to write a spelling corrector (2016)
norvig.com
How to write a spelling corrector (2016)
1–10 of 87 posts
Re: How to write a spelling corrector (2016)
#2- Couldn't determine the exact date of that article
- Previous discussion here: https://news.ycombinator.com/item?id=12453535
I really enjoyed the code, it is incredibly clever and idiomatic.
Re: How to write a spelling corrector (2016)
#3Disclaimer: - Couldn't determine the exact date of that article - Previous discussion here: https://news.ycombinator.com/item?id=12453535 I really enjoyed the code, it is incredibly clever and idiomatic.
Re: How to write a spelling corrector (2016)
#4Just as a curiosity: I once did some text correction applied to tweets, using word embeddings (word vectors, word2vec), which are a language model too. In real life contexts, where you don't limit yourself to a dictionary, it's really interesting because word vectors can include many foreignisms and other "incorrect" words that you might want to keep in the text.
The article also mentions edit distances, the distances between words (in this case, the "incorrect" word and its possible corrections). In general, algorithms are based on common errors at the keyboard. Missing or adding a letter, transposing two of them, etc. Algorithms like Damerau-Levenshtein (pretty much the one applied in the article, even though it's not explicitly mentioned I think, and there are many variations) keep it simple by doing this, but it's interesting to notice that you can also fine-tune distances by considering which keys are closer to other keys in the keyboard (it's easier to accidentally type "a" instead of "s" in qwerty than "u"), but when doing more general text correction you can also use phonetic distances or even more sophisticated techniques like finite-state transducers that apply language-specific rules to suggest corrections. (I know the article is only meant as an introduction, but thought someone might find it interesting)
Re: How to write a spelling corrector (2016)
#5Re: How to write a spelling corrector (2016)
#6Re: How to write a spelling corrector (2016)
#7i.e. the amount of times I cant spell a word, and MS Word has no idea what I'm trying to say, so I "copy and paste" the wrong word into Google and it instantly knows what I meant and shows me the correct spelling.
I appreciate part of that is probably related to my previous searches on Google and it guesses based upon my history - but I'd be ok with using this for "good" like my spell checking.
Re: How to write a spelling corrector (2016)
#8I always wish I could just plugin a Google spelling check API into things like Microsoft Word instead of using the inbuilt ones. i.e. the amount of times I cant spell a word, and MS Word has no idea what I'm trying to say, so I "copy and paste" the wrong word into Google and it instantly knows what I meant and shows me the correct spelling. I appreciate part of that is probably related to my previous searches on Goog…
Re: How to write a spelling corrector (2016)
#9Had a pleasant surprise when Matthias Felleisen responded to a request on the Racket mailing list and practically rewrote the Racket version.
Also got to learn about the HAT-trie[1] data structure.