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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…