aboutsummaryrefslogtreecommitdiff
path: root/src/bin/fstrelabel.cc
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/bin/fstrelabel.cc
parentf4c12fce1ee58e670f9c3fce46c40296ba9ee8a2 (diff)
downloadopenfst-dfd8b8327b93660601d016cdc6f29f433b45a8d8.tar.gz
Updated OpenFST version to openfst-1.3.2-CL32004048 from Greco3.
Change-Id: I19b0db718256b35c0e3e5a7315f1ed6335e6dcac
Diffstat (limited to 'src/bin/fstrelabel.cc')
-rw-r--r--src/bin/fstrelabel.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bin/fstrelabel.cc b/src/bin/fstrelabel.cc
index cc86450..e75db99 100644
--- a/src/bin/fstrelabel.cc
+++ b/src/bin/fstrelabel.cc
@@ -43,6 +43,7 @@ DEFINE_bool(allow_negative_labels, false,
int main(int argc, char **argv) {
namespace s = fst::script;
using fst::SymbolTable;
+ using fst::SymbolTableTextOptions;
using fst::script::FstClass;
using fst::script::MutableFstClass;
@@ -58,7 +59,7 @@ int main(int argc, char **argv) {
usage += " -relabel_opairs opairs.txts\n";
std::set_new_handler(FailedNewHandler);
- SetFlags(usage.c_str(), &argc, &argv, true);
+ SET_FLAGS(usage.c_str(), &argc, &argv, true);
if (argc > 3) {
ShowUsage();
return 1;
@@ -71,24 +72,24 @@ int main(int argc, char **argv) {
if (!fst) return 1;
// Relabel with symbol tables
+ SymbolTableTextOptions opts;
+ opts.allow_negative = FLAGS_allow_negative_labels;
if (!FLAGS_relabel_isymbols.empty() || !FLAGS_relabel_osymbols.empty()) {
bool attach_new_isymbols = (fst->InputSymbols() != 0);
const SymbolTable* old_isymbols = FLAGS_isymbols.empty()
? fst->InputSymbols()
- : SymbolTable::ReadText(FLAGS_isymbols, FLAGS_allow_negative_labels);
+ : SymbolTable::ReadText(FLAGS_isymbols, opts);
const SymbolTable* relabel_isymbols = FLAGS_relabel_isymbols.empty()
? NULL
- : SymbolTable::ReadText(FLAGS_relabel_isymbols,
- FLAGS_allow_negative_labels);
+ : SymbolTable::ReadText(FLAGS_relabel_isymbols, opts);
bool attach_new_osymbols = (fst->OutputSymbols() != 0);
const SymbolTable* old_osymbols = FLAGS_osymbols.empty()
? fst->OutputSymbols()
- : SymbolTable::ReadText(FLAGS_osymbols, FLAGS_allow_negative_labels);
+ : SymbolTable::ReadText(FLAGS_osymbols, opts);
const SymbolTable* relabel_osymbols = FLAGS_relabel_osymbols.empty()
? NULL
- : SymbolTable::ReadText(FLAGS_relabel_osymbols,
- FLAGS_allow_negative_labels);
+ : SymbolTable::ReadText(FLAGS_relabel_osymbols, opts);
s::Relabel(fst,
old_isymbols, relabel_isymbols, attach_new_isymbols,