diff --git a/contrib/other-builds/search/.cproject b/contrib/other-builds/search/.cproject index 1fd7c5ba1..9ea99509a 100644 --- a/contrib/other-builds/search/.cproject +++ b/contrib/other-builds/search/.cproject @@ -1,7 +1,5 @@ - - - + @@ -9,7 +7,7 @@ - + @@ -26,11 +24,7 @@ -<<<<<<< HEAD - -======= ->>>>>>> df5f0934be559418177ffa9a68c2e561918a310f -<<<<<<< HEAD - - - -======= @@ -147,5 +136,5 @@ ->>>>>>> df5f0934be559418177ffa9a68c2e561918a310f + diff --git a/contrib/other-builds/search/.project b/contrib/other-builds/search/.project index 7a3c439d1..db756f1d4 100644 --- a/contrib/other-builds/search/.project +++ b/contrib/other-builds/search/.project @@ -23,7 +23,7 @@ org.eclipse.cdt.make.core.buildArguments - -j3 + org.eclipse.cdt.make.core.buildCommand @@ -91,11 +91,6 @@ 1 PARENT-3-PROJECT_LOC/search/applied.hh - - bin - 2 - virtual:/virtual - config.hh 1 @@ -163,61 +158,9 @@ vertex_generator.hh -<<<<<<< HEAD 1 PARENT-3-PROJECT_LOC/search/vertex_generator.hh - - bin/gcc-4.5 - 2 - virtual:/virtual - - - bin/gcc-4.5/release - 2 - virtual:/virtual - - - bin/gcc-4.5/release/debug-symbols-on - 2 - virtual:/virtual - - - bin/gcc-4.5/release/debug-symbols-on/link-static - 2 - virtual:/virtual - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi - 2 - virtual:/virtual - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/edge_generator.o -======= ->>>>>>> df5f0934be559418177ffa9a68c2e561918a310f - 1 - PARENT-3-PROJECT_LOC/search/bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/edge_generator.o - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/nbest.o - 1 - PARENT-3-PROJECT_LOC/search/bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/nbest.o - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/rule.o - 1 - PARENT-3-PROJECT_LOC/search/bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/rule.o - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/vertex.o - 1 - PARENT-3-PROJECT_LOC/search/bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/vertex.o - - - bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/vertex_generator.o - 1 - PARENT-3-PROJECT_LOC/search/bin/gcc-4.5/release/debug-symbols-on/link-static/threading-multi/vertex_generator.o - + diff --git a/misc/create-ini/PT.cpp b/misc/create-ini/PT.cpp index fbb7120d9..cc1c0ff12 100644 --- a/misc/create-ini/PT.cpp +++ b/misc/create-ini/PT.cpp @@ -16,6 +16,13 @@ PT::PT(const std::string &line, int numFeatures, bool isHierarchical, const pair outFactors = factors->second; } + if (inFactors.size() == 0) { + inFactors.push_back(0); + } + if (outFactors.size() == 0) { + outFactors.push_back(0); + } + int implementation; if (toks.size() > 1) implementation = Scan(toks[1]); diff --git a/misc/create-ini/RO.cpp b/misc/create-ini/RO.cpp index 61d0a2a95..093605cd2 100644 --- a/misc/create-ini/RO.cpp +++ b/misc/create-ini/RO.cpp @@ -16,5 +16,12 @@ RO::RO(const std::string &line, const std::pair *factors) inFactors = factors->first; outFactors = factors->second; } + + if (inFactors.size() == 0) { + inFactors.push_back(0); + } + if (outFactors.size() == 0) { + outFactors.push_back(0); + } } diff --git a/moses/LM/SingleFactor.cpp b/moses/LM/SingleFactor.cpp index b21eb6b92..10bbd2f41 100644 --- a/moses/LM/SingleFactor.cpp +++ b/moses/LM/SingleFactor.cpp @@ -37,43 +37,14 @@ using namespace std; namespace Moses { -<<<<<<< HEAD LanguageModelSingleFactor::LanguageModelSingleFactor(const std::string& description, const std::string &line) :LanguageModelImplementation(description, line) -======= -LanguageModelSingleFactor::~LanguageModelSingleFactor() -{ -} - -struct PointerState : public FFState { - const void* lmstate; - PointerState(const void* lms) { - lmstate = lms; - } - int Compare(const FFState& o) const { - const PointerState& other = static_cast(o); - if (other.lmstate > lmstate) return 1; - else if (other.lmstate < lmstate) return -1; - return 0; - } -}; - -LanguageModelPointerState::LanguageModelPointerState() ->>>>>>> df5f0934be559418177ffa9a68c2e561918a310f { m_nullContextState = new PointerState(NULL); m_beginSentenceState = new PointerState(NULL); } -<<<<<<< HEAD LanguageModelSingleFactor::~LanguageModelSingleFactor() {} -======= -LanguageModelPointerState::~LanguageModelPointerState() -{ - delete m_nullContextState; - delete m_beginSentenceState; -} ->>>>>>> df5f0934be559418177ffa9a68c2e561918a310f const FFState *LanguageModelSingleFactor::GetNullContextState() const { diff --git a/moses/TranslationModel/PhraseDictionary.cpp b/moses/TranslationModel/PhraseDictionary.cpp index 2c82aa0c5..7d02c21b6 100644 --- a/moses/TranslationModel/PhraseDictionary.cpp +++ b/moses/TranslationModel/PhraseDictionary.cpp @@ -52,11 +52,11 @@ PhraseDictionary::PhraseDictionary(const std::string &description, const std::st const vector &args = m_args[i]; if (args[0] == "input-factor") { - m_input =Tokenize(args[1]); + m_input =Tokenize(args[1], ","); m_inputFactors = FactorMask(m_input); } else if (args[0] == "output-factor") { - m_output =Tokenize(args[1]); + m_output =Tokenize(args[1], ","); m_outputFactors = FactorMask(m_output); } else if (args[0] == "num-input-features") { diff --git a/scripts/ems/experiment.perl b/scripts/ems/experiment.perl index 4b7a88972..e49ceba83 100755 --- a/scripts/ems/experiment.perl +++ b/scripts/ems/experiment.perl @@ -2085,13 +2085,27 @@ sub define_training_create_config { my $moses_src_dir = &check_and_get("GENERAL:moses-src-dir"); my $cmd = "$moses_src_dir/bin/create-ini "; - my %IN = &get_factor_id("input"); - my %OUT = &get_factor_id("output"); + my %IN; + my %OUT; + if (&backoff_and_get("TRAINING:input-factors")) { + %IN = &get_factor_id("input"); + } + else { + $IN{"word"} = 0; + } + + if (&backoff_and_get("TRAINING:output-factors")) { + %OUT = &get_factor_id("output"); + } + else { + $OUT{"word"} = 0; + } $cmd .= "-input-factor-max ".((scalar keys %IN)-1)." "; - $cmd .= "-translation-factors ". - &encode_factor_definition("translation-factors",\%IN,\%OUT)." "; + $cmd .= "-translation-factors ". + &encode_factor_definition("translation-factors",\%IN,\%OUT)." " + if &get("TRAINING:translation-factors"); $cmd .= "-reordering-factors ". &encode_factor_definition("reordering-factors",\%IN,\%OUT)." " if &get("TRAINING:reordering-factors");