From b738e349be490c24d3604c224f44fc54e16d3d7b Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Sat, 23 Jun 2012 11:59:48 -0400 Subject: Support for sparse/dense vectors in the python extension - SparseVector, DenseVector - improved Lattice - Lattice translation - Hypergraph reweighting, pruning --- python/src/lattice.pxd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'python/src/lattice.pxd') diff --git a/python/src/lattice.pxd b/python/src/lattice.pxd index bdfaba80..3a4bc22f 100644 --- a/python/src/lattice.pxd +++ b/python/src/lattice.pxd @@ -1,4 +1,5 @@ from libcpp.vector cimport vector +from libcpp.string cimport string from utils cimport WordID cdef extern from "decoder/lattice.h": @@ -9,8 +10,12 @@ cdef extern from "decoder/lattice.h": LatticeArc() LatticeArc(WordID w, double c, int i) - cdef cppclass Lattice: # (vector[vector[LatticeArc]]) + cdef cppclass Lattice(vector): # (vector[vector[LatticeArc]]) Lattice() Lattice(unsigned t) - Lattice(unsigned t, vector[LatticeArc] v) + Lattice(unsigned t, vector[LatticeArc]& v) bint IsSentence() + vector[LatticeArc]& operator[](unsigned) + +cdef extern from "decoder/lattice.h" namespace "LatticeTools": + void ConvertTextToLattice(string& text, Lattice* pl) -- cgit v1.2.3