I dont have the time to write the function for you, but it would go something like this:
Code:
words = text.split()
i = 0
while i < len(words) - 1:
w1, w2 = words[i:i+2]
if not dictionaries.recognized(w1) and not dictionaries.recognized(w2) and dictionaries.recognized(w1 + w2):
words[i] = w1 + w2
words[i+1] = ''
i += 1
i += 1
return ' '.join(words)