diff options
author | Alexander Gutkin <agutkin@google.com> | 2013-02-28 00:24:20 +0000 |
---|---|---|
committer | Alexander Gutkin <agutkin@google.com> | 2013-02-28 00:24:20 +0000 |
commit | 5b6dc79427b8f7eeb6a7ff68034ab8548ce670ea (patch) | |
tree | 19e17fc79b8873e66f211276d4dd169c480cede1 /src/include/fst/fst.h | |
parent | 3da1eb108d36da35333b2d655202791af854996b (diff) | |
download | openfst-5b6dc79427b8f7eeb6a7ff68034ab8548ce670ea.tar.gz |
Bumped OpenFST implementation to openfst-1.3.3-CL41851770.
Updated OpenFST implementation to the most recent version
used by Greco3 (corresponds to nlp::fst exported at Perforce
CL 41851770).
In particular this version has an improved PDT support.
Change-Id: I5aadfc962297eef73922c67e7d57866f11ee7d81
Diffstat (limited to 'src/include/fst/fst.h')
-rw-r--r-- | src/include/fst/fst.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/include/fst/fst.h b/src/include/fst/fst.h index dd11e4f..150fc4e 100644 --- a/src/include/fst/fst.h +++ b/src/include/fst/fst.h @@ -53,6 +53,11 @@ template <class A> class ArcIteratorData; template <class A> class MatcherBase; struct FstReadOptions { + // FileReadMode(s) are advisory, there are many conditions than prevent a + // file from being mapped, READ mode will be selected in these cases with + // a warning indicating why it was chosen. + enum FileReadMode { READ, MAP }; + string source; // Where you're reading from const FstHeader *header; // Pointer to Fst header. If non-zero, use // this info (don't read a stream header) @@ -60,19 +65,20 @@ struct FstReadOptions { // this info (read and skip stream isymbols) const SymbolTable* osymbols; // Pointer to output symbols. If non-zero, use // this info (read and skip stream osymbols) + FileReadMode mode; // Read or map files (advisory, if possible) - explicit FstReadOptions(const string& src = "<unspecfied>", + explicit FstReadOptions(const string& src = "<unspecified>", const FstHeader *hdr = 0, const SymbolTable* isym = 0, - const SymbolTable* osym = 0) - : source(src), header(hdr), isymbols(isym), osymbols(osym) {} + const SymbolTable* osym = 0); explicit FstReadOptions(const string& src, const SymbolTable* isym, - const SymbolTable* osym = 0) - : source(src), header(0), isymbols(isym), osymbols(osym) {} -}; + const SymbolTable* osym = 0); + // Helper function to convert strings FileReadModes into their enum value. + static FileReadMode ReadMode(const string &mode); +}; struct FstWriteOptions { string source; // Where you're writing to |