Created
February 19, 2013 01:56
-
-
Save Mistobaan/4982459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def histogram(filename): | |
with open(filename) as fd: | |
return Counter(w.strip().lower() for w in fd.read().split() | |
if not (w in nltk.corpus.stopwords.words('english') )).most_common() | |
print '\n'.join("{}:{}".format(x,y) for x,y in histogram('/Users/fabrizio/Desktop/input.txt')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment