Reputation:
If we have an unseparated word, let's say
doctorsofamerica
Is there an NLTK import that I can use to separate this into
doctors of america
Thanks!
Upvotes: 0
Views: 320
Reputation: 877
If anything other than NLTK is an option, I used to work with Word Segmentation which gave pretty good results for simple cases. Regarding your use case, it would look like this:
from wordsegment import load, segment
load()
separated = segment('doctorsofamerica')
print(' '.join(separated))
Output:
doctors of america
Upvotes: 1