summaryrefslogtreecommitdiff
path: root/python/cdec/sa/extract.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/cdec/sa/extract.py')
-rw-r--r--python/cdec/sa/extract.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/python/cdec/sa/extract.py b/python/cdec/sa/extract.py
index d8f14b11..b6502c52 100644
--- a/python/cdec/sa/extract.py
+++ b/python/cdec/sa/extract.py
@@ -12,13 +12,12 @@ from cdec.sa._sa import monitor_cpu
extractor, prefix = None, None
online, compress = False, False
-vocab = None
def make_extractor(args):
global extractor, prefix, online, compress
signal.signal(signal.SIGINT, signal.SIG_IGN) # Let parent process catch Ctrl+C
load_features(args.features)
- extractor = cdec.sa.GrammarExtractor(args.config, online, vocab)
+ extractor = cdec.sa.GrammarExtractor(args.config, online)
prefix = args.grammars
online = args.online
compress = args.compress
@@ -64,7 +63,7 @@ def extract(inp):
return '<seg grammar="{}" id="{}">{}</seg>{}'.format(grammar_file, i, sentence, suffix)
def main():
- global online, vocab
+ global online
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser(description='Extract grammars from a compiled corpus.')
parser.add_argument('-c', '--config', required=True,
@@ -79,8 +78,6 @@ def main():
help='additional feature definitions')
parser.add_argument('-o', '--online', action='store_true',
help='online grammar extraction')
- parser.add_argument('-e', '--except-vocab', default=None,
- help='add LM and Lex except features (use with -o, pass vocab.gz)')
parser.add_argument('-z', '--compress', action='store_true',
help='compress grammars with gzip')
args = parser.parse_args()
@@ -94,7 +91,6 @@ def main():
sys.exit(1)
online = args.online
- vocab = args.except_vocab
start_time = monitor_cpu()
if args.jobs > 1: