blob: 3a4bc22f2d1a04481f7510af5f335b8df3b571e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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()
Lattice(unsigned t)
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)
|