Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. hrctweet = 'RT @HillaryforIA: The #iacaucus starts in 24 hours! #ImWithHer https://t.co/bF5fyfKbFt'
  2.  
  3.  
  4. def splitter(text, stop_words, stop_prefixes):
  5.  
  6.     simpletext = []
  7.  
  8.     newlist = text.split(' ')
  9.  
  10.     for phrase in newlist:
  11.  
  12.         simpletext.append((phrase.lower()).strip(PUNCTUATION))
  13.  
  14.  
  15.  
  16.  
  17.  
  18.     auxlist1 = simpletext
  19.  
  20.     for word in auxlist1:
  21.  
  22.         for stopper in STOP_WORDS[stop_words]:
  23.  
  24.             if word == stopper:
  25.  
  26.                 del simpletext[simpletext.index(word)]
  27.  
  28.  
  29.  
  30.     print(simpletext)
  31.  
  32.  
  33.  
  34.     auxlist2 = simpletext
  35.  
  36.     for word in auxlist2:
  37.  
  38.         print(word)
  39.  
  40.  
  41.  
  42.         for stopfix in STOP_PREFIXES[stop_prefixes]:
  43.  
  44.             print(stopfix)
  45.  
  46.             if word.startswith(stopfix) == True:
  47.  
  48.                 print(word)
  49.  
  50.                 print(stopfix)
  51.  
  52.                 print(simpletext.index(word))
  53.  
  54. #                del simpletext[simpletext.index(word)]
  55.  
  56.  
  57.  
  58.     return simpletext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement