You could try taking the first n characters of a word (where n is 1 to maximum word length) and spell checking that string. When you a string that spell-checks, continue for the next n characters, and so on. If you get to a point where you can’t find a word for the remaining characters, backtrack and look for a longer word in the previous characters.