Lines Matching refs:opts
206 static Fst<A> *Read(istream &strm, const FstReadOptions &opts) {
207 FstReadOptions ropts(opts);
210 hdr = *opts.header;
212 if (!hdr.Read(strm, opts.source))
244 virtual bool Write(ostream &strm, const FstWriteOptions &opts) const {
677 // return the header. If opts.header is non-null, skip read-in and
678 // use the option value. If opts.[io]symbols is non-null, read-in
680 bool ReadHeader(istream &strm, const FstReadOptions& opts,
684 // If a opts.header is false, skip writing header.
685 // If opts.[io]symbols is false, skip writing those symbols.
687 void WriteHeader(ostream &strm, const FstWriteOptions& opts,
689 if (opts.write_header) {
695 if (isymbols_ && opts.write_isymbols)
697 if (osymbols_ && opts.write_osymbols)
699 if (opts.align)
702 hdr->Write(strm, opts.source);
704 if (isymbols_ && opts.write_isymbols) isymbols_->Write(strm);
705 if (osymbols_ && opts.write_osymbols) osymbols_->Write(strm);
709 // If a opts.header is false, skip writing header.
710 // If opts.[io]symbols is false, skip writing those symbols.
714 const FstWriteOptions& opts, int version,
717 if (opts.write_header) {
723 if (fst.InputSymbols() && opts.write_isymbols)
725 if (fst.OutputSymbols() && opts.write_osymbols)
727 if (opts.align)
730 hdr->Write(strm, opts.source);
732 if (fst.InputSymbols() && opts.write_isymbols) {
735 if (fst.OutputSymbols() && opts.write_osymbols) {
746 const FstWriteOptions& opts, int version,
751 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
754 WriteFstHeader(fst, strm, opts, version, type, properties, hdr);
756 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
761 LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
780 bool FstImpl<A>::ReadHeader(istream &strm, const FstReadOptions& opts,
782 if (opts.header)
783 *hdr = *opts.header;
784 else if (!hdr->Read(strm, opts.source))
788 LOG(INFO) << "FstImpl::ReadHeader: source: " << opts.source
797 << "\": " << opts.source;
802 << "\": " << opts.source;
807 << " Fst version: " << opts.source;
812 isymbols_ = SymbolTable::Read(strm, opts.source);
814 osymbols_ =SymbolTable::Read(strm, opts.source);
816 if (opts.isymbols) {
818 isymbols_ = opts.isymbols->Copy();
820 if (opts.osymbols) {
822 osymbols_ = opts.osymbols->Copy();