Clojure Programming/Examples/Norvig Spelling Corrector

Peter Norvig wrote an excellent example of a spelling corrector in Python. You can see How to Write a Spelling Corrector for a more detailed explanation.

This code, translated into Clojure by language creator Rich Hickey, demonstrates the Python-like brevity of Clojure:

To use:

Note: training with big.txt may require the jvm to be started with a heap bigger than its default. You can increase the heap size either by starting java with the "-server" option or setting the maximum heap size explicitly: "java -Xmx128m ..."