tried:
typosRegex = re.compile(r'(\w* ){2,}')
mo2 = typosRegex.sub(r'\1', 'ram is a good good personalities.')
print(mo2)
result:
good personalities.
expect:
ram is a good personalities.
how to get the expected substituted string using regex? how to replace accidently repeated word with the single of that?