Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def get_only_wti(doc,includew=None):
  2. words = set()
  3. wordstoret=set()
  4. for word in re.split('\\W+', doc):
  5. if 2 < len(word) < 20:
  6. words.add(word.lower())
  7. for word in words:
  8. if word in includew:
  9. wordstoret.add(word.lower())
  10. return wordstoret
  11. def helper_fun(doc):
  12. return get_only_wti(doc,words_to_include)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement