Lines Matching defs:fst

29 #include <fst/accumulator.h>
30 #include <fst/cache.h>
31 #include <fst/dfs-visit.h>
32 #include <fst/mutable-fst.h>
34 namespace fst {
54 size_t operator()(const Fst<A> &fst, StateId s) const {
56 size_t n = fst.NumArcs(s);
57 if (fst.Final(s) != Weight::Zero())
77 size_t operator()(const Fst<A> &fst, StateId s) const {
80 for (ArcIterator< Fst<A> > aiter(fst, s); !aiter.Done();
85 sum += exp(-to_log_weight_(fst.Final(s)).Value());
90 for (ArcIterator< Fst<A> > aiter(fst, s); !aiter.Done();
121 size_t operator()(const Fst<A> &fst, StateId s,
124 ArcIterator< Fst<A> > aiter(fst, s);
126 double sum = to_log_weight_(accumulator->Sum(fst.Final(s), &aiter, 0,
127 fst.NumArcs(s))).Value();
169 ArcSampler(const Fst<A> &fst, const S &arc_selector,
171 : fst_(fst),
176 ArcSampler(const ArcSampler<A, S> &sampler, const Fst<A> *fst = 0)
177 : fst_(fst ? *fst : sampler.fst_),
244 ArcSampler(const Fst<A> &fst, const S &arc_selector, int max_length = INT_MAX)
245 : fst_(fst),
249 accumulator_->Init(fst);
252 ArcSampler(const ArcSampler<A, S> &sampler, const Fst<A> *fst = 0)
253 : fst_(fst ? *fst : sampler.fst_),
256 if (fst) {
258 accumulator_->Init(*fst);
348 RandGenFstImpl(const Fst<A> &fst, const RandGenFstOptions<S> &opts)
350 fst_(fst.Copy()),
358 uint64 props = fst.Properties(kFstProperties, false);
361 SetInputSymbols(fst.InputSymbols());
362 SetOutputSymbols(fst.OutputSymbols());
521 RandGenFst(const Fst<A> &fst, const RandGenFstOptions<S> &opts)
522 : ImplToFst<Impl>(new Impl(fst, opts)) {}
525 RandGenFst(const RandGenFst<A, B, S> &fst, bool safe = false)
526 : ImplToFst<Impl>(fst, safe) {}
543 void operator=(const RandGenFst<A, B, S> &fst); // Disallow
553 explicit StateIterator(const RandGenFst<A, B, S> &fst)
554 : CacheStateIterator< RandGenFst<A, B, S> >(fst, fst.GetImpl()) {}
568 ArcIterator(const RandGenFst<A, B, S> &fst, StateId s)
569 : CacheArcIterator< RandGenFst<A, B, S> >(fst.GetImpl(), s) {
570 if (!fst.GetImpl()->HasArcs(s))
571 fst.GetImpl()->Expand(s);
710 } // namespace fst