From d4cb5aac6e7e083572dfb4d3393ceceb0dbad99c Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Thu, 27 Dec 2012 19:38:56 -0500 Subject: Hooks for online grammar extraction --- python/src/sa/sym.pxi | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/src/sa/sym.pxi') diff --git a/python/src/sa/sym.pxi b/python/src/sa/sym.pxi index f47599cf..81f19ef1 100644 --- a/python/src/sa/sym.pxi +++ b/python/src/sa/sym.pxi @@ -114,3 +114,9 @@ def decode_lattice(lattice): def decode_sentence(lattice): return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) + +def encode_words(words): + return tuple(sym_fromstring(word, True) for word in words) + +def decode_words(syms): + return tuple(sym_tostring(sym) for sym in syms) \ No newline at end of file -- cgit v1.2.3