15 #ifndef TASK_LMBR_COMMON_HPP 16 #define TASK_LMBR_COMMON_HPP 31 std::vector<fst::NGramList>& ngramlist, uint minorder = 1, uint maxorder = 4) {
32 if (!myfst.NumStates() )
return 0;
33 std::vector<fst::NGram> tmplist;
34 fst::extractNGrams<Arc> (myfst, tmplist, maxorder);
35 if (ngramlist.size() < maxorder + 1)
36 ngramlist.resize (maxorder + 1);
37 for (std::vector<fst::NGram>::iterator it = tmplist.begin();
41 if (n >= minorder && n <= maxorder) {
42 ngramlist[n][*it] = fst::StdArc::Weight::One();
45 return tmplist.size();
51 #endif //TASK_LMBR_COMMON_HPP
uint extractNGrams(fst::VectorFst< Arc > myfst, std::vector< fst::NGramList > &ngramlist, uint minorder=1, uint maxorder=4)
Interfaces with extractNGrams and generates information in the right format for lmbr classes...