diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2013-08-26 20:12:32 -0400 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2013-08-26 20:12:32 -0400 |
commit | ca9b58716214148eeaeaa3076e1a1dc8f8bb5892 (patch) | |
tree | bfa2fd84c86e0fdd499110e86fd464b391379df1 /python/cdec/lattice.pxd | |
parent | 9d5071692ceab8d09c2bfdba24f6b927ec84b7f9 (diff) |
Improve the package structure of pycdec
This change should not break anything, but now you can run:
python setup.py build_ext --inplace
and use the cleaner:
PYTHONPATH=/path/to/cdec/python python -m ...
Diffstat (limited to 'python/cdec/lattice.pxd')
-rw-r--r-- | python/cdec/lattice.pxd | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/python/cdec/lattice.pxd b/python/cdec/lattice.pxd new file mode 100644 index 00000000..8ad710e5 --- /dev/null +++ b/python/cdec/lattice.pxd @@ -0,0 +1,20 @@ +from libcpp.vector cimport vector +from libcpp.string cimport string +from utils cimport WordID + +cdef extern from "decoder/lattice.h": + cdef cppclass LatticeArc: + WordID label + double cost + int dist2next + LatticeArc() + LatticeArc(WordID w, double c, int i) + + cdef cppclass Lattice(vector): # (vector[vector[LatticeArc]]) + Lattice() + bint IsSentence() + vector[LatticeArc]& operator[](unsigned) + void resize(unsigned) + +cdef extern from "decoder/lattice.h" namespace "LatticeTools": + void ConvertTextOrPLF(string& text, Lattice* pl) |