Remove default for stop word file
This commit is contained in:
parent
44b9428685
commit
18fab1c6f9
10
wordocc.py
10
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)
|
||||
|
Loading…
Reference in New Issue
Block a user