diff options
author | Patrick Simianer <p@simianer.de> | 2011-08-29 22:02:45 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2011-09-23 19:13:58 +0200 |
commit | aa5f96417ff81408b15b54aab35a3c16b845adf8 (patch) | |
tree | cb9715696bf11d095215a97e299e22fed940ec02 /decoder/scfg_translator.cc | |
parent | 7a562c98d69abfe9ec921f37828f827f44d5dc82 (diff) |
big update: working iterating, pretty output, test scripts and more
Diffstat (limited to 'decoder/scfg_translator.cc')
-rw-r--r-- | decoder/scfg_translator.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/decoder/scfg_translator.cc b/decoder/scfg_translator.cc index 9fdddfdb..646d67fa 100644 --- a/decoder/scfg_translator.cc +++ b/decoder/scfg_translator.cc @@ -106,18 +106,16 @@ struct SCFGTranslatorImpl { struct NameEquals { NameEquals(const string name) : name_(name) {} bool operator()(const GrammarPtr& x) const { return x->GetGrammarName() == name_; } const string name_; }; - void SetSentenceGrammar(const std::string& grammar_string) { - assert( grammar_string != "" ); + void SetSentenceGrammarFromString(const std::string& grammar_str) { + assert( grammar_str != "" ); if (!SILENT) cerr << "Setting sentence grammar" << endl; usingSentenceGrammar = true; - //FD::Freeze(); - istringstream in( grammar_string ); + istringstream in( grammar_str ); TextGrammar* sent_grammar = new TextGrammar( &in ); sent_grammar->SetMaxSpan( max_span_limit ); sent_grammar->SetGrammarName( "__psg" ); grammars.erase ( remove_if(grammars.begin(), grammars.end(), NameEquals("__psg")), grammars.end() ); grammars.push_back( GrammarPtr(sent_grammar) ); - //FD::UnFreeze(); } bool Translate(const string& input, @@ -321,8 +319,8 @@ void SCFGTranslator::SetSupplementalGrammar(const std::string& grammar) { pimpl_->SetSupplementalGrammar(grammar); } -void SCFGTranslator::SetSentenceGrammar(const std::string& grammar) { - pimpl_->SetSentenceGrammar(grammar); +void SCFGTranslator::SetSentenceGrammarFromString(const std::string& grammar_str) { + pimpl_->SetSentenceGrammarFromString(grammar_str); } void SCFGTranslator::SentenceCompleteImpl() { |