I assume that a candidate connected by a word will not be longer than forty (40) characters or so; most of the time it will be less than ten (10).
Given the small size, how about this pseudo code?
if (is_spelled_wrong (word)):
N = len (word)
list_suggestions = []
for i = 1 to N-1:
wordA = word [0: i] // Pythonic 'slice' notation
wordB = word [i + 1: N]
if (! is_spelled_wrong (wordA) &&! is_spelled_wrong (wordB))
list_suggestions.appened ((wordA, wordB))
In other words, just scan the string for all the features. They are few. In the case of "areyou" you would have to five (5) times.
source share