One can use a stochastic morphological parser to do spelling checking and correction, and present spelling suggestions ranked with the parser output probabilities.
the n th value of the vector in the counting semiring just counts the appearances of the n th arc of mt in a path.