self-contained word prediction and correction api