From 18fab1c6f9918e808b80586e3c1f6cf1cb3a9765 Mon Sep 17 00:00:00 2001 From: Mutah Date: Mon, 7 Dec 2015 15:33:30 +0100 Subject: [PATCH] Remove default for stop word file --- wordocc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wordocc.py b/wordocc.py index 5858901..1b4c7dc 100755 --- a/wordocc.py +++ b/wordocc.py @@ -21,11 +21,10 @@ See https://textblob.readthedocs.org/en/dev/""") # settings BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -# path stop word file -STOP_WORDS_PATH = os.path.join(BASE_DIR, 'stop_words.txt') - DEFAULT_ENCODING = "utf-8" +DEFAULT_CSV_FILE = "wordocc.csv" + ############################################################################# def load_stop_words(path, encoding): """load stop words list, handling comments with '|'""" @@ -98,13 +97,14 @@ def save_stats_csv(stats, path, encoding): ############################################################################# if __name__ == '__main__': + # Build command line option parser parser = optparse.OptionParser("usage: %prog [options] FILE") parser.add_option("-s", "--stop-words", dest="stop_words", default="", type="string", help="path to stop word file") - parser.add_option("-o", "--output", dest="output", default="wordocc.csv", - type="string", help="csv output filename") + parser.add_option("-o", "--output", dest="output", default=DEFAULT_CSV_FILE, + type="string", help="csv output filename (default: %s)" % DEFAULT_CSV_FILE) parser.add_option("-e", "--encoding", dest="encoding", default=DEFAULT_ENCODING, type="string", help="file encoding (default: %s)" % DEFAULT_ENCODING)