diff options
author | Michael Denkowski <michael.j.denkowski@gmail.com> | 2012-12-27 19:38:56 -0500 |
---|---|---|
committer | Michael Denkowski <michael.j.denkowski@gmail.com> | 2012-12-27 19:38:56 -0500 |
commit | d4cb5aac6e7e083572dfb4d3393ceceb0dbad99c (patch) | |
tree | 4e492573497741aac37b1607be2c37458525aa68 /python/src/sa/sym.pxi | |
parent | dd708f2931ff416eae781e29f27ddb61c1632c9e (diff) |
Hooks for online grammar extraction
Diffstat (limited to 'python/src/sa/sym.pxi')
-rw-r--r-- | python/src/sa/sym.pxi | 6 |
1 files changed, 6 insertions, 0 deletions
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 |