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/extensions/pdt/pdtcompose.cc | |
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/extensions/pdt/pdtcompose.cc')
-rw-r--r-- | src/extensions/pdt/pdtcompose.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/extensions/pdt/pdtcompose.cc b/src/extensions/pdt/pdtcompose.cc index 0076e1d..b33862f 100644 --- a/src/extensions/pdt/pdtcompose.cc +++ b/src/extensions/pdt/pdtcompose.cc @@ -31,6 +31,9 @@ using std::pair; using std::make_pair; DEFINE_string(pdt_parentheses, "", "PDT parenthesis label pairs."); DEFINE_bool(left_pdt, true, "1st arg is PDT (o.w. 2nd arg)."); DEFINE_bool(connect, true, "Trim output"); +DEFINE_string(compose_filter, "paren", + "Composition filter, one of: \"expand\", \"expand_paren\", " + "\"paren\""); int main(int argc, char **argv) { namespace s = fst::script; @@ -70,7 +73,22 @@ int main(int argc, char **argv) { fst::ReadLabelPairs(FLAGS_pdt_parentheses, &parens, false); s::VectorFstClass ofst(ifst1->ArcType()); - fst::ComposeOptions copts(false); + + fst::PdtComposeFilter compose_filter; + + if (FLAGS_compose_filter == "expand") { + compose_filter = fst::EXPAND_FILTER; + } else if (FLAGS_compose_filter == "expand_paren") { + compose_filter = fst::EXPAND_PAREN_FILTER; + } else if (FLAGS_compose_filter == "paren") { + compose_filter = fst::PAREN_FILTER; + } else { + LOG(ERROR) << argv[0] << "Unknown compose filter type: " + << FLAGS_compose_filter; + return 1; + } + + fst::PdtComposeOptions copts(false, compose_filter); s::PdtCompose(*ifst1, *ifst2, parens, &ofst, copts, FLAGS_left_pdt); |