Is there an efficient way to perform hundreds of text substitutions in Ruby?

An alternative approach, if your input data is separated words, would simply be to build a hash table of {error => correction}.

Hash table lookup is fast, so if you can bend your input data to this format, it will almost certainly be fast enough.

Leave a Comment