FST  openfst-1.7.2
OpenFst Library
getters.cc
Go to the documentation of this file.
1 // See www.openfst.org for extensive documentation on this weighted
2 // finite-state transducer library.
3 
5 
6 namespace fst {
7 namespace script {
8 
9 bool GetPdtComposeFilter(const string &str, PdtComposeFilter *cf) {
10  if (str == "expand") {
11  *cf = EXPAND_FILTER;
12  } else if (str == "expand_paren") {
13  *cf = EXPAND_PAREN_FILTER;
14  } else if (str == "paren") {
15  *cf = PAREN_FILTER;
16  } else {
17  return false;
18  }
19  return true;
20 }
21 
22 bool GetPdtParserType(const string &str, PdtParserType *pt) {
23  if (str == "left") {
24  *pt = PDT_LEFT_PARSER;
25  } else if (str == "left_sr") {
26  *pt = PDT_LEFT_SR_PARSER;
27  } else {
28  return false;
29  }
30  return true;
31 }
32 
33 } // namespace script
34 } // namespace fst
PdtComposeFilter
Definition: compose.h:436
bool GetPdtComposeFilter(const string &str, PdtComposeFilter *cf)
Definition: getters.cc:9
bool GetPdtParserType(const string &str, PdtParserType *pt)
Definition: getters.cc:22
PdtParserType
Definition: replace.h:43