From b363ea7e2f7b79d2b7237c987e2b1acc54b9e4b5 Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Sat, 30 Nov 2013 19:18:44 -0800 Subject: [PATCH] Clean up --- 23-passive-aggressive/tf-23.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/23-passive-aggressive/tf-23.py b/23-passive-aggressive/tf-23.py index e5f5447..9188491 100644 --- a/23-passive-aggressive/tf-23.py +++ b/23-passive-aggressive/tf-23.py @@ -4,10 +4,6 @@ import sys, re, operator, string # # The functions # -def get_input(arg): - assert(len(sys.argv) > 1), "You idiot! I need an input file! I quit!" - return sys.argv[1] - def extract_words(path_to_file): assert(type(path_to_file) is str), "I need a string! I quit!" assert(path_to_file), "I need a non-empty string! I quit!" @@ -59,7 +55,7 @@ def top25_freqs(word_freqs): # try: assert(len(sys.argv) > 1), "You idiot! I need an input file! I quit!" - word_freqs = sort(frequencies(extract_words(sys.argv[1]))) + word_freqs = sort(frequencies(remove_stop_words(extract_words(sys.argv[1])))) assert(len(word_freqs) > 25), "OMG! Less than 25 words! I QUIT!" for tf in word_freqs[0:25]: