summaryrefslogtreecommitdiff
path: root/python/src/grammar.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
commit03799a2d330c6dbbe12154d4bcea236210b4f6ed (patch)
tree7adb0bc8dd2987fa32ee1299d8821dd8b7b06706 /python/src/grammar.pxd
parent8b491e57f8a011f4f8496e44bed7eb7a4360bc93 (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/src/grammar.pxd')
-rw-r--r--python/src/grammar.pxd43
1 files changed, 0 insertions, 43 deletions
diff --git a/python/src/grammar.pxd b/python/src/grammar.pxd
deleted file mode 100644
index 0ffe80fa..00000000
--- a/python/src/grammar.pxd
+++ /dev/null
@@ -1,43 +0,0 @@
-from libcpp.vector cimport vector
-from libcpp.string cimport string
-from utils cimport *
-
-cdef extern from "decoder/trule.h":
- cdef cppclass AlignmentPoint:
- AlignmentPoint(int s, int t)
- AlignmentPoint Inverted()
- short s_
- short t_
-
- cdef cppclass TRule:
- vector[WordID] f_
- vector[WordID] e_
- vector[AlignmentPoint] a_
- FastSparseVector[weight_t] scores_
- WordID lhs_
- int arity_
- bint IsUnary()
- bint IsGoal()
- void ComputeArity()
-
-cdef extern from "decoder/grammar.h":
- cdef cppclass RuleBin:
- int GetNumRules()
- shared_ptr[TRule] GetIthRule(int i)
- int Arity()
-
- ctypedef RuleBin const_RuleBin "const RuleBin"
-
- cdef cppclass GrammarIter:
- const_RuleBin* GetRules()
-
- ctypedef GrammarIter const_GrammarIter "const GrammarIter"
-
- cdef cppclass Grammar:
- const_GrammarIter* GetRoot()
- string GetGrammarName()
- void SetGrammarName(string)
-
- cdef cppclass TextGrammar(Grammar):
- TextGrammar()
- void AddRule(shared_ptr[TRule]& rule) nogil