#ifndef __LATTICE_H_ #define __LATTICE_H_ #include #include #include "wordid.h" struct LatticeArc { WordID label; double cost; int dist2next; LatticeArc() : label(), cost(), dist2next() {} LatticeArc(WordID w, double c, int i) : label(w), cost(c), dist2next(i) {} }; class Lattice : public std::vector > { public: Lattice() {} explicit Lattice(size_t t, const std::vector& v = std::vector()) : std::vector >(t, v) {} // TODO add distance functions }; struct LatticeTools { static bool LooksLikePLF(const std::string &line); static void ConvertTextToLattice(const std::string& text, Lattice* pl); static void ConvertTextOrPLF(const std::string& text_or_plf, Lattice* pl); }; #endif