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/sa/_sa.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/sa/_sa.pxd')
-rw-r--r-- | python/cdec/sa/_sa.pxd | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/python/cdec/sa/_sa.pxd b/python/cdec/sa/_sa.pxd new file mode 100644 index 00000000..f1cd8e29 --- /dev/null +++ b/python/cdec/sa/_sa.pxd @@ -0,0 +1,45 @@ +from libc.stdio cimport FILE + +cdef class FloatList: + cdef int size + cdef int increment + cdef int len + cdef float* arr + cdef void set(self, int i, float v) + cdef void write_handle(self, FILE* f) + cdef void read_handle(self, FILE* f) + +cdef class IntList: + cdef int size + cdef int increment + cdef int len + cdef int* arr + cdef void set(self, int i, int val) + cdef void _append(self, int val) + cdef void _extend(self, IntList other) + cdef void _extend_arr(self, int* other, int other_len) + cdef void _clear(self) + cdef void write_handle(self, FILE* f) + cdef void read_handle(self, FILE* f) + +cdef class FeatureVector: + cdef IntList names + cdef FloatList values + +cdef class Phrase: + cdef int *syms + cdef int n, *varpos, n_vars + cdef public int chunkpos(self, int k) + cdef public int chunklen(self, int k) + +cdef class Rule: + cdef int lhs + cdef readonly Phrase f, e + cdef FeatureVector scores + cdef int n_scores + cdef word_alignments + +cdef char* sym_tostring(int sym) +cdef char* sym_tocat(int sym) +cdef int sym_isvar(int sym) +cdef int sym_getindex(int sym) |