diff options
author | Peng Wu <alexepico@gmail.com> | 2011-07-20 18:28:20 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-07-20 18:28:20 +0800 |
commit | ad8c7df93d6735742b675a99b0c9ab412e77c317 (patch) | |
tree | 7e05b8a44c6b36881e5fe2296f951cf74eecccee | |
parent | ae9939dd142d4e365dd26ea8b66064a7ee8bd003 (diff) | |
download | trainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.tar.gz trainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.tar.xz trainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.zip |
add default value to segment.py
-rwxr-xr-x | segment.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/python3 import os import os.path +import sys from argparse import ArgumentParser from subprocess import Popen, PIPE import utils @@ -81,8 +82,9 @@ def walkThroughIndex(path): if __name__ == '__main__': parser = ArgumentParser(description='Segment all raw corpus documents.') - parser.add_argument('indexdir', action='store', \ - help='index directory') + parser.add_argument('--indexdir', action='store', \ + help='index directory', \ + default=os.path.join(config.getTextDir(), 'index')) args = parser.parse_args() walkThroughIndex(args.indexdir) |