aboutsummaryrefslogtreecommitdiff
path: root/src/include/fst/fst.h
diff options
context:
space:
mode:
authorAlexander Gutkin <agutkin@google.com>2012-09-12 18:11:43 +0100
committerAlexander Gutkin <agutkin@google.com>2012-09-12 18:11:43 +0100
commitdfd8b8327b93660601d016cdc6f29f433b45a8d8 (patch)
tree968ec84b8e32ad73ec18d74334930f36b7471906 /src/include/fst/fst.h
parentf4c12fce1ee58e670f9c3fce46c40296ba9ee8a2 (diff)
downloadopenfst-dfd8b8327b93660601d016cdc6f29f433b45a8d8.tar.gz
Updated OpenFST version to openfst-1.3.2-CL32004048 from Greco3.
Change-Id: I19b0db718256b35c0e3e5a7315f1ed6335e6dcac
Diffstat (limited to 'src/include/fst/fst.h')
-rw-r--r--src/include/fst/fst.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/include/fst/fst.h b/src/include/fst/fst.h
index 9c4d0db..dd11e4f 100644
--- a/src/include/fst/fst.h
+++ b/src/include/fst/fst.h
@@ -36,6 +36,7 @@
#include <fst/register.h>
#include <iostream>
#include <fstream>
+#include <sstream>
#include <fst/symbol-table.h>
#include <fst/util.h>
@@ -229,7 +230,7 @@ class Fst {
}
return Read(strm, FstReadOptions(filename));
} else {
- return Read(std::cin, FstReadOptions("standard input"));
+ return Read(cin, FstReadOptions("standard input"));
}
}
@@ -267,7 +268,6 @@ class Fst {
virtual MatcherBase<A> *InitMatcher(MatchType match_type) const;
protected:
-
bool WriteFile(const string &filename) const {
if (!filename.empty()) {
ofstream strm(filename.c_str(), ofstream::out | ofstream::binary);
@@ -277,7 +277,7 @@ class Fst {
}
return Write(strm, FstWriteOptions(filename));
} else {
- return Write(std::cout, FstWriteOptions("standard output"));
+ return Write(cout, FstWriteOptions("standard output"));
}
}
};
@@ -706,12 +706,13 @@ template <class A> class FstImpl {
// This method is used in the cross-type serialization methods Fst::WriteFst.
static void WriteFstHeader(const Fst<A> &fst, ostream &strm,
const FstWriteOptions& opts, int version,
- const string &type, FstHeader *hdr) {
+ const string &type, uint64 properties,
+ FstHeader *hdr) {
if (opts.write_header) {
hdr->SetFstType(type);
hdr->SetArcType(A::Type());
hdr->SetVersion(version);
- hdr->SetProperties(fst.Properties(kFstProperties, false));
+ hdr->SetProperties(properties);
int32 file_flags = 0;
if (fst.InputSymbols() && opts.write_isymbols)
file_flags |= FstHeader::HAS_ISYMBOLS;
@@ -737,14 +738,14 @@ template <class A> class FstImpl {
// returns true on success, false on failure.
static bool UpdateFstHeader(const Fst<A> &fst, ostream &strm,
const FstWriteOptions& opts, int version,
- const string &type, FstHeader *hdr,
- size_t header_offset) {
+ const string &type, uint64 properties,
+ FstHeader *hdr, size_t header_offset) {
strm.seekp(header_offset);
if (!strm) {
LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
return false;
}
- WriteFstHeader(fst, strm, opts, version, type, hdr);
+ WriteFstHeader(fst, strm, opts, version, type, properties, hdr);
if (!strm) {
LOG(ERROR) << "Fst::UpdateFstHeader: write failed: " << opts.source;
return false;