summaryrefslogtreecommitdiff
path: root/python/cdec/kbest.pxd
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2013-08-26 20:12:32 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2013-08-26 20:12:32 -0400
commitca9b58716214148eeaeaa3076e1a1dc8f8bb5892 (patch)
treebfa2fd84c86e0fdd499110e86fd464b391379df1 /python/cdec/kbest.pxd
parent9d5071692ceab8d09c2bfdba24f6b927ec84b7f9 (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/kbest.pxd')
-rw-r--r--python/cdec/kbest.pxd20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/cdec/kbest.pxd b/python/cdec/kbest.pxd
new file mode 100644
index 00000000..44ecfbab
--- /dev/null
+++ b/python/cdec/kbest.pxd
@@ -0,0 +1,20 @@
+from libcpp.vector cimport vector
+from utils cimport WordID
+from hypergraph cimport Hypergraph
+
+cdef extern from "decoder/viterbi.h":
+ cdef cppclass ESentenceTraversal:
+ pass
+ cdef cppclass ETreeTraversal:
+ pass
+ cdef cppclass FTreeTraversal:
+ pass
+ cdef cppclass FeatureVectorTraversal:
+ pass
+
+cdef extern from "decoder/kbest.h" namespace "KBest":
+ cdef cppclass KBestDerivations[T, Traversal]:
+ cppclass Derivation:
+ T _yield "yield"
+ KBestDerivations(Hypergraph& hg, unsigned k) nogil
+ Derivation* LazyKthBest(unsigned v, unsigned k) nogil