This is a ruby solution for the problem called KataBankOCR found on
http://codingdojo.org/cgi-bin/index.pl?KataBankOCR
Only user stories 1, 2 and 3 are implemented. User story 4 is left for the curious…
A test file 'test.txt" contains test cases, and a spec file is in place, so you can just run 'rspec' and see the tests pass.
Bear in mind that the input file format is whitespace sensitive, so disable any cleanups your editor might be doing upon saving.
You can run:
./account_number_spec.rb test.txt
on a shell to see the output. Debug messages for unreadable digits are on by default.