diff options
Diffstat (limited to 'moses/TranslationModel/RuleTable')
4 files changed, 25 insertions, 25 deletions
diff --git a/moses/TranslationModel/RuleTable/LoaderStandard.cpp b/moses/TranslationModel/RuleTable/LoaderStandard.cpp index 9d2e3fa20..b6e779078 100644 --- a/moses/TranslationModel/RuleTable/LoaderStandard.cpp +++ b/moses/TranslationModel/RuleTable/LoaderStandard.cpp @@ -73,7 +73,7 @@ void ReformatHieroRule(int sourceTarget, string &phrase, map<size_t, pair<size_t // no-term vector<string> split = Tokenize(tok, ","); UTIL_THROW_IF2(split.size() != 2, - "Incorrectly formmatted non-terminal: " << tok); + "Incorrectly formmatted non-terminal: " << tok); tok = "[X]" + split[0] + "]"; size_t coIndex = Scan<size_t>(split[1]); @@ -100,7 +100,7 @@ void ReformateHieroScore(string &scoreString) string &tok = toks[i]; vector<string> nameValue = Tokenize(tok, "="); UTIL_THROW_IF2(nameValue.size() != 2, - "Incorrectly formatted score: " << tok); + "Incorrectly formatted score: " << tok); float score = Scan<float>(nameValue[1]); score = exp(-score); @@ -212,7 +212,7 @@ bool RuleTableLoaderStandard::Load(FormatType format const size_t numScoreComponents = ruleTable.GetNumScoreComponents(); if (scoreVector.size() != numScoreComponents) { UTIL_THROW2("Size of scoreVector != number (" << scoreVector.size() << "!=" - << numScoreComponents << ") of score components on line " << count); + << numScoreComponents << ") of score components on line " << count); } // parse source & find pt node diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.cpp index 81fd43fcb..4c2f4d186 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.cpp @@ -50,7 +50,7 @@ void PhraseDictionaryALSuffixArray::InitializeForInput(InputType const& source) *this); UTIL_THROW_IF2(ret == NULL, - "Rules not successfully loaded for sentence id " << translationId); + "Rules not successfully loaded for sentence id " << translationId); } void PhraseDictionaryALSuffixArray::CleanUpAfterSentenceProcessing(const InputType &source) diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp index 7cb26ad88..5d8c95428 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp @@ -84,13 +84,13 @@ PhraseDictionaryFuzzyMatch:: SetParameter(const std::string& key, const std::string& value) { if (key == "source") { - m_config[0] = value; + m_config[0] = value; } else if (key == "target") { - m_config[1] = value; + m_config[1] = value; } else if (key == "alignment") { - m_config[2] = value; + m_config[2] = value; } else { - PhraseDictionary::SetParameter(key, value); + PhraseDictionary::SetParameter(key, value); } } @@ -150,7 +150,7 @@ void PhraseDictionaryFuzzyMatch::InitializeForInput(InputType const& inputSenten char dirName[] = "/tmp/moses.XXXXXX"; char *temp = mkdtemp(dirName); UTIL_THROW_IF2(temp == NULL, - "Couldn't create temporary directory " << dirName); + "Couldn't create temporary directory " << dirName); string dirNameStr(dirName); @@ -218,11 +218,11 @@ void PhraseDictionaryFuzzyMatch::InitializeForInput(InputType const& inputSenten const size_t numScoreComponents = GetNumScoreComponents(); if (scoreVector.size() != numScoreComponents) { UTIL_THROW2("Size of scoreVector != number (" << scoreVector.size() << "!=" - << numScoreComponents << ") of score components on line " << count); + << numScoreComponents << ") of score components on line " << count); } UTIL_THROW_IF2(scoreVector.size() != numScoreComponents, - "Number of scores incorrectly specified"); + "Number of scores incorrectly specified"); // parse source & find pt node @@ -298,9 +298,9 @@ PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetOrCreateNode(PhraseDi const Word &sourceNonTerm = word; UTIL_THROW_IF2(iterAlign == alignmentInfo.end(), - "No alignment for non-term at position " << pos); + "No alignment for non-term at position " << pos); UTIL_THROW_IF2(iterAlign->first != pos, - "Alignment info incorrect at position " << pos); + "Alignment info incorrect at position " << pos); size_t targetNonTermInd = iterAlign->second; ++iterAlign; @@ -312,7 +312,7 @@ PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetOrCreateNode(PhraseDi } UTIL_THROW_IF2(currNode == NULL, - "Node not found at position " << pos); + "Node not found at position " << pos); } @@ -338,7 +338,7 @@ const PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetRootNode(long t { std::map<long, PhraseDictionaryNodeMemory>::const_iterator iter = m_collection.find(translationId); UTIL_THROW_IF2(iter == m_collection.end(), - "Couldn't find root node for input: " << translationId); + "Couldn't find root node for input: " << translationId); return iter->second; } PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetRootNode(const InputType &source) @@ -346,7 +346,7 @@ PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetRootNode(const InputT long transId = source.GetTranslationId(); std::map<long, PhraseDictionaryNodeMemory>::iterator iter = m_collection.find(transId); UTIL_THROW_IF2(iter == m_collection.end(), - "Couldn't find root node for input: " << transId); + "Couldn't find root node for input: " << transId); return iter->second; } diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp index ea60d4d23..778e349d2 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp @@ -85,20 +85,20 @@ void PhraseDictionaryOnDisk::InitializeForInput(InputType const& source) obj->BeginLoad(m_filePath); UTIL_THROW_IF2(obj->GetMisc("Version") != OnDiskPt::OnDiskWrapper::VERSION_NUM, - "On-disk phrase table is version " << obj->GetMisc("Version") - << ". It is not compatible with version " << OnDiskPt::OnDiskWrapper::VERSION_NUM); + "On-disk phrase table is version " << obj->GetMisc("Version") + << ". It is not compatible with version " << OnDiskPt::OnDiskWrapper::VERSION_NUM); UTIL_THROW_IF2(obj->GetMisc("NumSourceFactors") != m_input.size(), - "On-disk phrase table has " << obj->GetMisc("NumSourceFactors") << " source factors." - << ". The ini file specified " << m_input.size() << " source factors"); + "On-disk phrase table has " << obj->GetMisc("NumSourceFactors") << " source factors." + << ". The ini file specified " << m_input.size() << " source factors"); UTIL_THROW_IF2(obj->GetMisc("NumTargetFactors") != m_output.size(), - "On-disk phrase table has " << obj->GetMisc("NumTargetFactors") << " target factors." - << ". The ini file specified " << m_output.size() << " target factors"); + "On-disk phrase table has " << obj->GetMisc("NumTargetFactors") << " target factors." + << ". The ini file specified " << m_output.size() << " target factors"); UTIL_THROW_IF2(obj->GetMisc("NumScores") != m_numScoreComponents, - "On-disk phrase table has " << obj->GetMisc("NumScores") << " scores." - << ". The ini file specified " << m_numScoreComponents << " scores"); + "On-disk phrase table has " << obj->GetMisc("NumScores") << " scores." + << ". The ini file specified " << m_numScoreComponents << " scores"); m_implementation.reset(obj); } @@ -194,7 +194,7 @@ const TargetPhraseCollection *PhraseDictionaryOnDisk::GetTargetPhraseCollectionN const OnDiskPt::TargetPhraseCollection *targetPhrasesOnDisk = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper); TargetPhraseCollection *targetPhrases - = targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false); + = targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false); delete targetPhrasesOnDisk; |