summaryrefslogtreecommitdiffstats
path: root/segment.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-20 18:28:20 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-20 18:28:20 +0800
commitad8c7df93d6735742b675a99b0c9ab412e77c317 (patch)
tree7e05b8a44c6b36881e5fe2296f951cf74eecccee /segment.py
parentae9939dd142d4e365dd26ea8b66064a7ee8bd003 (diff)
downloadtrainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.tar.gz
trainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.tar.xz
trainer-ad8c7df93d6735742b675a99b0c9ab412e77c317.zip
add default value to segment.py
Diffstat (limited to 'segment.py')
-rwxr-xr-xsegment.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/segment.py b/segment.py
index 09cc1c2..45d4f93 100755
--- a/segment.py
+++ b/segment.py
@@ -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)