summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/runtime/python/examples/gf_utils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/python/examples/gf_utils.py b/src/runtime/python/examples/gf_utils.py
index bbb8d1766..3f23f7744 100644
--- a/src/runtime/python/examples/gf_utils.py
+++ b/src/runtime/python/examples/gf_utils.py
@@ -151,10 +151,10 @@ def getKBestParses(grammar, language, K, callbacks=[], serializable=False, senti
def pgf_parse(args):
grammar = pgf.readPGF(args.pgfgrammar);
- inputSet = web_lexer(grammar, args.srclang, args.inputstream);
- outputPrinter = lambda X: "%f\t%s" %(X[0], str(X[1])); #operator.itemgetter(1);
-
import translation_pipeline;
+
+ inputSet = translation_pipeline.web_lexer(grammar, args.srclang, 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);
@@ -166,10 +166,10 @@ def pgf_parse(args):
def pgf_kparse(args):
grammar = pgf.readPGF(args.pgfgrammar);
- inputSet = web_lexer(grammar, args.srclang, args.inputstream);
- outputPrinter = printJohnsonRerankerFormat;
-
import translation_pipeline;
+
+ inputSet = translation_pipeline.web_lexer(grammar, args.srclang, 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);