summaryrefslogtreecommitdiff
path: root/python/pkg
diff options
context:
space:
mode:
authorChris Dyer <cdyer@Chriss-MacBook-Air.local>2013-04-19 17:06:46 -0400
committerChris Dyer <cdyer@Chriss-MacBook-Air.local>2013-04-19 17:06:46 -0400
commit03a9ee4bcf1d96ffb808de3d20dbb0e70cdb5e56 (patch)
treefba8ff40ca2a42bfe1ea45c77d7389f7428da0be /python/pkg
parentf729d92ab891a714ced95bd0d4cd8e5d8470a52d (diff)
parent808974eddb0481c4c3cee6adc7f6db852be83ff9 (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'python/pkg')
-rw-r--r--python/pkg/cdec/sa/extract.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/pkg/cdec/sa/extract.py b/python/pkg/cdec/sa/extract.py
index 782bed8b..bf39d080 100644
--- a/python/pkg/cdec/sa/extract.py
+++ b/python/pkg/cdec/sa/extract.py
@@ -62,6 +62,7 @@ def extract(inp):
return '<seg grammar="{}" id="{}">{}</seg>{}'.format(grammar_file, i, sentence, suffix)
def main():
+ global online
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser(description='Extract grammars from a compiled corpus.')
parser.add_argument('-c', '--config', required=True,
@@ -88,6 +89,8 @@ def main():
' should be a python module\n'.format(featdef))
sys.exit(1)
+ online = args.online
+
if args.jobs > 1:
logging.info('Starting %d workers; chunk size: %d', args.jobs, args.chunksize)
pool = mp.Pool(args.jobs, make_extractor, (args,))