Lines Matching defs:Fst

62   const FstHeader *header;      // Pointer to Fst header. If non-zero, use
99 // Fst HEADER CLASS
101 // This is the recommended Fst file header representation.
155 // Fst INTERFACE CLASS DEFINITION
162 class Fst {
168 virtual ~Fst() {}
187 virtual const string& Type() const = 0; // Fst type name
189 // Get a copy of this Fst. The copying behaves as follows:
192 // and is on an otherwise unaccessed Fst.
196 // separate threads. For some Fst types, 'Copy(true)' should only be
197 // called on an Fst that has not otherwise been accessed. Its behavior
203 virtual Fst<A> *Copy(bool safe = false) const = 0;
205 // Read an Fst from an input stream; returns NULL on error
206 static Fst<A> *Read(istream &strm, const FstReadOptions &opts) {
220 LOG(ERROR) << "Fst::Read: Unknown FST type \"" << hdr.FstType()
228 // Read an Fst from a file; return NULL on error
230 static Fst<A> *Read(const string &filename) {
234 LOG(ERROR) << "Fst::Read: Can't open file: " << filename;
243 // Write an Fst to an output stream; return false on error
245 LOG(ERROR) << "Fst::Write: No write stream method for " << Type()
246 << " Fst type";
250 // Write an Fst to a file; return false on error
253 LOG(ERROR) << "Fst::Write: No write filename method for " << Type()
254 << " Fst type";
281 LOG(ERROR) << "Fst::Write: Can't open file: " << filename;
298 // Fst method.
397 // Fst method.
529 MatcherBase<A> *Fst<A>::InitMatcher(MatchType match_type) const {
562 // Fst<A> case - abstract methods.
564 typename A::Weight Final(const Fst<A> &fst, typename A::StateId s) {
569 ssize_t NumArcs(const Fst<A> &fst, typename A::StateId s) {
574 ssize_t NumInputEpsilons(const Fst<A> &fst, typename A::StateId s) {
579 ssize_t NumOutputEpsilons(const Fst<A> &fst, typename A::StateId s) {
586 typedef Fst<StdArc> StdFst;
597 // Fst IMPLEMENTATION BASE
599 // This is the recommended Fst implementation base class. It will
676 // Read-in header and symbols from input stream, initialize Fst, and
711 // type is the Fst type being written.
712 // This method is used in the cross-type serialization methods Fst::WriteFst.
713 static void WriteFstHeader(const Fst<A> &fst, ostream &strm,
745 static bool UpdateFstHeader(const Fst<A> &fst, ostream &strm,
751 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
756 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
761 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
771 string type_; // Unique name of Fst class
796 LOG(ERROR) << "FstImpl::ReadHeader: Fst not of type \"" << type_
807 << " Fst version: " << opts.source;
829 uint64 TestProperties(const Fst<Arc> &fst, uint64 mask, uint64 *known);
832 // This is a helper class template useful for attaching an Fst interface to
834 template < class I, class F = Fst<typename I::Arc> >
900 // Change Fst implementation pointer. If 'own_impl' is true,
915 ImplToFst<I, F> &operator=(const Fst<Arc> &fst) {
927 // methods). Must be a friend of the Fst classes involved (currently
933 // Fst Serialization
935 void FstToString(const Fst<A> &fst, string *result) {
942 Fst<A> *StringToFst(const string &s) {
944 return Fst<A>::Read(istrm, FstReadOptions("StringToFst"));