mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 12:36:35 +03:00
Merge branch 'master' of github.com:moses-smt/mosesdecoder
This commit is contained in:
commit
c74d772bd9
@ -426,8 +426,7 @@
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/opt/local/include/,
|
||||
/Users/hieuhoang/workspace/sourceforge/trunk/kenlm,
|
||||
/usr/local/include,
|
||||
../kenlm,
|
||||
../srilm/include,
|
||||
);
|
||||
INSTALL_PATH = /usr/local/lib;
|
||||
@ -447,8 +446,7 @@
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/opt/local/include/,
|
||||
/Users/hieuhoang/workspace/sourceforge/trunk/kenlm,
|
||||
/usr/local/include,
|
||||
../kenlm,
|
||||
../srilm/include,
|
||||
);
|
||||
INSTALL_PATH = /usr/local/lib;
|
||||
|
@ -62,6 +62,7 @@
|
||||
1E2E163F132A892800ED4085 /* ThreadPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2E1638132A892800ED4085 /* ThreadPool.h */; };
|
||||
1E46B5A613BA5C7F0084F898 /* RuleCubeItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E46B5A413BA5C7F0084F898 /* RuleCubeItem.cpp */; };
|
||||
1E46B5A713BA5C7F0084F898 /* RuleCubeItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E46B5A513BA5C7F0084F898 /* RuleCubeItem.h */; };
|
||||
1E474E12145575CA00178AD5 /* RuleTableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E474E11145575CA00178AD5 /* RuleTableLoader.h */; };
|
||||
1E528B9D13A12B2D00E9A67E /* params.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E528B9B13A12B2D00E9A67E /* params.cpp */; };
|
||||
1E528B9E13A12B2D00E9A67E /* SyntacticLanguageModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E528B9C13A12B2D00E9A67E /* SyntacticLanguageModel.cpp */; };
|
||||
1EA6AB4A13BCC838004465AF /* ChartRuleLookupManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EA6AB4813BCC838004465AF /* ChartRuleLookupManager.cpp */; };
|
||||
@ -323,6 +324,7 @@
|
||||
1E2E1638132A892800ED4085 /* ThreadPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPool.h; path = src/ThreadPool.h; sourceTree = "<group>"; };
|
||||
1E46B5A413BA5C7F0084F898 /* RuleCubeItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RuleCubeItem.cpp; path = src/RuleCubeItem.cpp; sourceTree = "<group>"; };
|
||||
1E46B5A513BA5C7F0084F898 /* RuleCubeItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RuleCubeItem.h; path = src/RuleCubeItem.h; sourceTree = "<group>"; };
|
||||
1E474E11145575CA00178AD5 /* RuleTableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RuleTableLoader.h; path = src/RuleTableLoader.h; sourceTree = "<group>"; };
|
||||
1E528B9B13A12B2D00E9A67E /* params.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = params.cpp; path = src/DynSAInclude/params.cpp; sourceTree = "<group>"; };
|
||||
1E528B9C13A12B2D00E9A67E /* SyntacticLanguageModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SyntacticLanguageModel.cpp; path = src/SyntacticLanguageModel.cpp; sourceTree = "<group>"; };
|
||||
1EA6AB4813BCC838004465AF /* ChartRuleLookupManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChartRuleLookupManager.cpp; path = src/ChartRuleLookupManager.cpp; sourceTree = "<group>"; };
|
||||
@ -555,6 +557,7 @@
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E474E11145575CA00178AD5 /* RuleTableLoader.h */,
|
||||
1E16D086144DAA3F00B60B4F /* LM */,
|
||||
1ED0FD4C124BB9380029177F /* AlignmentInfo.cpp */,
|
||||
1ED0FD4D124BB9380029177F /* AlignmentInfo.h */,
|
||||
@ -996,6 +999,7 @@
|
||||
1E16D0B6144DAA6C00B60B4F /* ParallelBackoff.h in Headers */,
|
||||
1E16D0BC144DAA6C00B60B4F /* SingleFactor.h in Headers */,
|
||||
1E16D0BE144DAA6C00B60B4F /* SRI.h in Headers */,
|
||||
1E474E12145575CA00178AD5 /* RuleTableLoader.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ void ChartRuleLookupManagerMemory::GetChartRuleCollection(
|
||||
// get list of all rules that apply to spans at same starting position
|
||||
DottedRuleColl &dottedRuleCol = *m_dottedRuleColls[range.GetStartPos()];
|
||||
const DottedRuleList &expandableDottedRuleList = dottedRuleCol.GetExpandableDottedRuleList();
|
||||
|
||||
|
||||
const ChartCellLabel &sourceWordLabel = GetCellCollection().Get(WordsRange(absEndPos, absEndPos)).GetSourceWordLabel();
|
||||
|
||||
// loop through the rules
|
||||
|
@ -64,7 +64,7 @@ void PhraseDictionaryNodeSCFG::Sort(size_t tableLimit)
|
||||
|
||||
PhraseDictionaryNodeSCFG *PhraseDictionaryNodeSCFG::GetOrCreateChild(const Word &sourceTerm)
|
||||
{
|
||||
assert(!sourceTerm.IsNonTerminal());
|
||||
//assert(!sourceTerm.IsNonTerminal());
|
||||
|
||||
std::pair <TerminalMap::iterator,bool> insResult;
|
||||
insResult = m_sourceTermMap.insert( std::make_pair(sourceTerm, PhraseDictionaryNodeSCFG()) );
|
||||
|
@ -63,13 +63,18 @@ bool PhraseDictionarySCFG::Load(const std::vector<FactorType> &input
|
||||
return ret;
|
||||
}
|
||||
|
||||
TargetPhraseCollection &PhraseDictionarySCFG::GetOrCreateTargetPhraseCollection(const Phrase &source, const TargetPhrase &target)
|
||||
TargetPhraseCollection &PhraseDictionarySCFG::GetOrCreateTargetPhraseCollection(
|
||||
const Phrase &source
|
||||
, const TargetPhrase &target
|
||||
, const Word &sourceLHS)
|
||||
{
|
||||
PhraseDictionaryNodeSCFG &currNode = GetOrCreateNode(source, target);
|
||||
PhraseDictionaryNodeSCFG &currNode = GetOrCreateNode(source, target, sourceLHS);
|
||||
return currNode.GetOrCreateTargetPhraseCollection();
|
||||
}
|
||||
|
||||
PhraseDictionaryNodeSCFG &PhraseDictionarySCFG::GetOrCreateNode(const Phrase &source, const TargetPhrase &target)
|
||||
PhraseDictionaryNodeSCFG &PhraseDictionarySCFG::GetOrCreateNode(const Phrase &source
|
||||
, const TargetPhrase &target
|
||||
, const Word &sourceLHS)
|
||||
{
|
||||
const size_t size = source.GetSize();
|
||||
|
||||
@ -97,7 +102,12 @@ PhraseDictionaryNodeSCFG &PhraseDictionarySCFG::GetOrCreateNode(const Phrase &so
|
||||
|
||||
assert(currNode != NULL);
|
||||
}
|
||||
|
||||
// finally, the source LHS
|
||||
//currNode = currNode->GetOrCreateChild(sourceLHS);
|
||||
//assert(currNode != NULL);
|
||||
|
||||
|
||||
return *currNode;
|
||||
}
|
||||
|
||||
|
@ -78,10 +78,11 @@ class PhraseDictionarySCFG : public PhraseDictionary
|
||||
|
||||
private:
|
||||
TargetPhraseCollection &GetOrCreateTargetPhraseCollection(
|
||||
const Phrase &source, const TargetPhrase &target);
|
||||
const Phrase &source, const TargetPhrase &target, const Word &sourceLHS);
|
||||
|
||||
PhraseDictionaryNodeSCFG &GetOrCreateNode(const Phrase &source,
|
||||
const TargetPhrase &target);
|
||||
PhraseDictionaryNodeSCFG &GetOrCreateNode(const Phrase &source
|
||||
, const TargetPhrase &target
|
||||
, const Word &sourceLHS);
|
||||
|
||||
void SortAndPrune();
|
||||
|
||||
|
@ -56,9 +56,11 @@ class RuleTableLoader
|
||||
// Provide access to PhraseDictionarySCFG's private
|
||||
// GetOrCreateTargetPhraseCollection function.
|
||||
TargetPhraseCollection &GetOrCreateTargetPhraseCollection(
|
||||
PhraseDictionarySCFG &ruleTable, const Phrase &source,
|
||||
const TargetPhrase &target) {
|
||||
return ruleTable.GetOrCreateTargetPhraseCollection(source, target);
|
||||
PhraseDictionarySCFG &ruleTable
|
||||
, const Phrase &source
|
||||
, const TargetPhrase &target
|
||||
, const Word &sourceLHS) {
|
||||
return ruleTable.GetOrCreateTargetPhraseCollection(source, target, sourceLHS);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -202,6 +202,7 @@ bool RuleTableLoaderCompact::LoadRuleSection(
|
||||
const Phrase &sourcePhrase = sourcePhrases[sourcePhraseId];
|
||||
const Phrase &targetPhrasePhrase = targetPhrases[targetPhraseId];
|
||||
const Word &targetLhs = vocab[targetLhsIds[targetPhraseId]];
|
||||
Word sourceLHS("X"); // TODO not implemented for compact
|
||||
const AlignmentInfo *alignmentInfo = alignmentSets[alignmentSetId];
|
||||
|
||||
// Then there should be one score for each score component.
|
||||
@ -229,7 +230,7 @@ bool RuleTableLoaderCompact::LoadRuleSection(
|
||||
|
||||
// Insert rule into table.
|
||||
TargetPhraseCollection &coll = GetOrCreateTargetPhraseCollection(
|
||||
ruleTable, sourcePhrase, *targetPhrase);
|
||||
ruleTable, sourcePhrase, *targetPhrase, sourceLHS);
|
||||
coll.Add(targetPhrase);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ bool RuleTableLoaderStandard::Load(const std::vector<FactorType> &input
|
||||
|
||||
targetPhrase->SetScoreChart(ruleTable.GetFeature(), scoreVector, weight, languageModels,wpProducer);
|
||||
|
||||
TargetPhraseCollection &phraseColl = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, *targetPhrase);
|
||||
TargetPhraseCollection &phraseColl = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, *targetPhrase, sourceLHS);
|
||||
phraseColl.Add(targetPhrase);
|
||||
|
||||
count++;
|
||||
|
Loading…
Reference in New Issue
Block a user