unique strings

Solutions on MaxInterview for unique strings by the best coders in the world

showing results for - "unique strings"
Naim
16 Jun 2017
1from nltk.corpus import stopwords
2
3stop_words = stopwords.words('english')
4
5sentence = [('the', 2112), ('and', 1914), ('to', 1505), ('of', 1086), ('a', 986), ('you', 912), 
6     ('in', 754), ('with', 549), ('is', 536), ('for', 473), ('it', 461), ('book', 427), 
7     ('how', 368), ('that', 347), ('as', 304), ('on', 301), ('this', 290), ('java', 289), 
8     ('s', 267), ('your', 263), ('applications', 248), ('web', 231), ('can', 219), 
9     ('new', 218), ('an', 206), ('are', 197), ('will', 187), ('from', 185), ('use', 185), ('ll', 183), 
10     ('development', 182), ('code', 180), ('by', 177), ('programming', 172), ('application', 170), ('or', 169), 
11     ('action', 163), ('developers', 150), ('features', 141), ('examples', 139), ('learn', 135), ('using', 132), 
12     ('be', 132), ('data', 131), ('more', 118), ('like', 115), ('build', 110), ('into', 109), ('net', 106), ('language', 105)]
13
14sentence = [(word, count) for word, count in sentence if word not in stop_words]     
15
16print sentence