summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorprasant.kolachina <prasant.kolachina@cse.gu.se>2015-04-26 11:00:17 +0000
committerprasant.kolachina <prasant.kolachina@cse.gu.se>2015-04-26 11:00:17 +0000
commit25558916546e51516ed6791971a31d957d0e9292 (patch)
treef79d7996474628d32730bc7ba905287b02babcc3 /src/runtime
parent3ec571b03d99ca2ff6f56ff0fb4ae02ce4158a65 (diff)
bug fix in python examples
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/python/examples/gf_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/python/examples/gf_utils.py b/src/runtime/python/examples/gf_utils.py
index d6d3421ac..b097cb118 100644
--- a/src/runtime/python/examples/gf_utils.py
+++ b/src/runtime/python/examples/gf_utils.py
@@ -154,7 +154,7 @@ def pgf_parse(args):
import translation_pipeline;
preprocessor = lexer();
- inputSet = translation_pipeline.web_lexer(grammar, args.srclang, preprocessor(args.inputstream) );
+ inputSet = translation_pipeline.web_lexer(grammar, args.srclang, imap(preprocessor, args.inputstream) );
outputPrinter = lambda X: "%f\t%s" %(X[0], str(X[1])); #operator.itemgetter(1);
callbacks = [('PN', translation_pipeline.parseNames(grammar, args.srclang)), ('Symb', translation_pipeline.parseUnknown(grammar, args.srclang))];
parser = getKBestParses(grammar, args.srclang, 1, callbacks);
@@ -170,7 +170,7 @@ def pgf_kparse(args):
import translation_pipeline;
preprocessor = lexer();
- inputSet = translation_pipeline.web_lexer(grammar, args.srclang, preprocessor(args.inputstream) );
+ inputSet = translation_pipeline.web_lexer(grammar, args.srclang, imap(preprocessor, args.inputstream) );
outputPrinter = printJohnsonRerankerFormat;
callbacks = [('PN', translation_pipeline.parseNames(grammar, args.srclang)), ('Symb', translation_pipeline.parseUnknown(grammar, args.srclang))];
parser = getKBestParses(grammar, args.srclang, args.K, callbacks=callbacks);