summaryrefslogtreecommitdiff
path: root/decoder/scfg_translator.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-05 16:01:51 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-05 16:01:51 +0000
commit9966c9c3bed1707fa5dbe48e8cb73c90db60cef2 (patch)
tree5f21b0f27068b5a0200a7602f72e1380e60c4c36 /decoder/scfg_translator.cc
parentd9d370c66ccf3e16b2428021bf9e8cb42538990c (diff)
TODO (mostly low priority) notes
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@128 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/scfg_translator.cc')
-rw-r--r--decoder/scfg_translator.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/decoder/scfg_translator.cc b/decoder/scfg_translator.cc
index c215eea6..866c2721 100644
--- a/decoder/scfg_translator.cc
+++ b/decoder/scfg_translator.cc
@@ -1,3 +1,7 @@
+//TODO: bottom-up pruning, with actual final models' (appropriately weighted) heuristics and local scores.
+
+//TODO: grammar heuristic (min cost of reachable rule set) for binarizations (active edges) if we wish to prune those also
+
#include "translator.h"
#include <vector>
@@ -26,11 +30,11 @@ struct SCFGTranslatorImpl {
g->SetMaxSpan(max_span_limit);
g->SetGrammarName(gfiles[i]);
grammars.push_back(GrammarPtr(g));
-
+
}
}
if (!conf.count("scfg_no_hiero_glue_grammar"))
- {
+ {
GlueGrammar* g = new GlueGrammar(goal, default_nt);
g->SetGrammarName("GlueGrammar");
grammars.push_back(GrammarPtr(g));
@@ -39,7 +43,7 @@ struct SCFGTranslatorImpl {
if (conf.count("scfg_extra_glue_grammar"))
{
GlueGrammar* g = new GlueGrammar(conf["scfg_extra_glue_grammar"].as<string>());
- g->SetGrammarName("ExtraGlueGrammar");
+ g->SetGrammarName("ExtraGlueGrammar");
grammars.push_back(GrammarPtr(g));
cerr << "Adding extra glue grammar" << endl;
}
@@ -69,7 +73,7 @@ struct SCFGTranslatorImpl {
if(printGrammarsUsed){ //Iterate trough grammars we have for this sentence and list them
- for (int gi = 0; gi < glist.size(); ++gi)
+ for (int gi = 0; gi < glist.size(); ++gi)
{
cerr << "Using grammar::" << glist[gi]->GetGrammarName() << endl;
}
@@ -96,7 +100,7 @@ bool SCFGTranslator::TranslateImpl(const string& input,
SentenceMetadata* smeta,
const vector<double>& weights,
Hypergraph* minus_lm_forest) {
-
+
return pimpl_->Translate(input, smeta, weights, minus_lm_forest);
}
@@ -105,10 +109,10 @@ Check for grammar pointer in the sentence markup, for use with sentence specific
*/
void SCFGTranslator::ProcessMarkupHintsImpl(const map<string, string>& kv) {
map<string,string>::const_iterator it = kv.find("grammar");
-
-
+
+
if (it == kv.end()) {
- usingSentenceGrammar= false;
+ usingSentenceGrammar= false;
return;
}
//Create sentence specific grammar from specified file name and load grammar into list of grammars