summaryrefslogtreecommitdiff
path: root/python/cdec/lattice.pxd
blob: ed290d5a89059830352f04109abfc73c2d7f216b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from libcpp.vector cimport vector
from libcpp.string cimport string
from utils cimport *

cdef extern from "decoder/lattice.h":
    cdef cppclass LatticeArc:
        WordID label
        FastSparseVector[double] features
        int dist2next
        LatticeArc()
        LatticeArc(WordID w, FastSparseVector[double]& features, int i)

    cdef cppclass Lattice(vector): # (vector[vector[LatticeArc]])
        Lattice()
        bint IsSentence()
        vector[LatticeArc]& operator[](unsigned)
        void resize(unsigned)

cdef extern from "decoder/lattice.h" namespace "LatticeTools":
    void ConvertTextOrPLF(string& text, Lattice* pl)