17 #ifndef NLP_GRM2_SFST_NGRAMAPPROX_H_ 18 #define NLP_GRM2_SFST_NGRAMAPPROX_H_ 41 fst::MutableFst<Arc> *ofst,
int order,
42 typename Arc::Label phi_label = 0,
46 using Label =
typename Arc::Label;
51 if (ofst->Properties(f::kError,
false))
return false;
54 return Approx(ifst, ofst, phi_label, delta, norm_type);
59 #endif // NLP_GRM2_SFST_NGRAMAPPROX_H_
void FindNGrams(const fst::Fst< Arc > &ifst)
constexpr float kApproxDelta
bool Approx(const fst::Fst< Arc > &ifst, fst::MutableFst< Arc > *ofst, typename Arc::Label phi_label=fst::kNoLabel, float delta=kApproxDelta, CountNormType norm_type=NORM_KL_MIN)
bool NGramApprox(const fst::Fst< Arc > &ifst, fst::MutableFst< Arc > *ofst, int order, typename Arc::Label phi_label=0, float delta=sfst::kApproxDelta, CountNormType norm_type=NORM_KL_MIN)