Advertisement
Guest User

Untitled

a guest
May 21st, 2018
78
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_triples_dict(text):
  2. triples_dict = dict()
  3. text = text.lower()
  4.  
  5. print(text)
  6.  
  7.  
  8.  
  9. for i in range(0,len(text)-2):
  10.  
  11. if text[i].isalpha() and text[i+1].isalpha() and text[i+2].isalpha():
  12. key = str(text[i]) + str(text[i+1]) + str(text[i+2])
  13. triples_dict[key] = 1
  14. print(key)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement