Spell checker/corrector

Peter Norvig wrote a great post on how to write a good spell checker. It’s hard, I suppose, if you don’t have the aha! about how to do it. And if you did, it’s ridiculously straightforward. Norvig’s version, written in Python is 21 lines

C takes 184 lines. C++ takes 98. Ruby 35. Groovy 22. The big difference is that the dynamic languages have built-ins for things like: creating hashes, creating and manipulating arrays, regular expression parsing. In C it all has to be done from scratch.

Comments

Popular Posts