Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. def limpiatextoo(texto):
  2. texto = texto.lower()
  3.  
  4. texto = re.sub(r"\n", "", texto)
  5. texto = re.sub(r"[-()]", "", texto)
  6. texto = re.sub(r"\.", " .", texto)
  7. texto = re.sub(r"\!", " !", texto)
  8. texto = re.sub(r"\?", " ?", texto)
  9. texto = re.sub(r"\,", " ,", texto)
  10. texto = re.sub(r"i'm", "i am", texto)
  11. texto = re.sub(r"he's", "he is", texto)
  12. texto = re.sub(r"she's", "she is", texto)
  13. texto = re.sub(r"it's", "it is", texto)
  14. texto = re.sub(r"that's", "that is", texto)
  15. texto = re.sub(r"what's", "that is", texto)
  16. texto = re.sub(r"\'ll", " will", texto)
  17. texto = re.sub(r"\'re", " are", texto)
  18. texto = re.sub(r"won't", "will not", texto)
  19. texto = re.sub(r"can't", "cannot", texto)
  20. texto = re.sub(r"n't", " not", texto)
  21. texto = re.sub(r"n'", "ng", texto)
  22. texto = re.sub(r"ohh", "oh", texto)
  23. return texto
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement