mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
beautify
This commit is contained in:
parent
8d857fa26e
commit
852242b804
@ -95,10 +95,12 @@ public:
|
||||
return 1;
|
||||
}
|
||||
|
||||
PhraseNode &GetRootSourceNode()
|
||||
{ return *m_rootSourceNode; }
|
||||
const PhraseNode &GetRootSourceNode() const
|
||||
{ return *m_rootSourceNode; }
|
||||
PhraseNode &GetRootSourceNode() {
|
||||
return *m_rootSourceNode;
|
||||
}
|
||||
const PhraseNode &GetRootSourceNode() const {
|
||||
return *m_rootSourceNode;
|
||||
}
|
||||
|
||||
UINT64 GetMisc(const std::string &key) const;
|
||||
|
||||
|
@ -265,9 +265,9 @@ Moses::TargetPhrase *TargetPhrase::ConvertToMoses(const std::vector<Moses::Facto
|
||||
ret->SetAlignNonTerm(alignNonTerm);
|
||||
|
||||
if (isSyntax) {
|
||||
Moses::Word *lhsTarget = new Moses::Word(true);
|
||||
GetWord(GetSize() - 1).ConvertToMoses(outputFactors, vocab, *lhsTarget);
|
||||
ret->SetTargetLHS(lhsTarget);
|
||||
Moses::Word *lhsTarget = new Moses::Word(true);
|
||||
GetWord(GetSize() - 1).ConvertToMoses(outputFactors, vocab, *lhsTarget);
|
||||
ret->SetTargetLHS(lhsTarget);
|
||||
}
|
||||
|
||||
// set source phrase
|
||||
|
@ -124,27 +124,26 @@ void PhraseDictionaryOnDisk::SetTargetPhraseFromPtMatrix(const std::vector<Input
|
||||
|
||||
if (lastWordOnDisk == NULL) {
|
||||
// OOV according to this phrase table. Not possible to extend
|
||||
node.SetTargetPhrases(*this, NULL, NULL);
|
||||
}
|
||||
else {
|
||||
const OnDiskPt::PhraseNode *ptNode = prevPtNode->GetChild(*lastWordOnDisk, wrapper);
|
||||
if (ptNode) {
|
||||
vector<float> weightT = StaticData::Instance().GetWeights(this);
|
||||
OnDiskPt::Vocab &vocab = wrapper.GetVocab();
|
||||
node.SetTargetPhrases(*this, NULL, NULL);
|
||||
} else {
|
||||
const OnDiskPt::PhraseNode *ptNode = prevPtNode->GetChild(*lastWordOnDisk, wrapper);
|
||||
if (ptNode) {
|
||||
vector<float> weightT = StaticData::Instance().GetWeights(this);
|
||||
OnDiskPt::Vocab &vocab = wrapper.GetVocab();
|
||||
|
||||
const OnDiskPt::TargetPhraseCollection *targetPhrasesOnDisk = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper);
|
||||
TargetPhraseCollection *targetPhrases
|
||||
= targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false);
|
||||
const OnDiskPt::TargetPhraseCollection *targetPhrasesOnDisk = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper);
|
||||
TargetPhraseCollection *targetPhrases
|
||||
= targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false);
|
||||
|
||||
node.SetTargetPhrases(*this, targetPhrases, ptNode);
|
||||
node.SetTargetPhrases(*this, targetPhrases, ptNode);
|
||||
|
||||
delete targetPhrasesOnDisk;
|
||||
delete targetPhrasesOnDisk;
|
||||
|
||||
} else {
|
||||
node.SetTargetPhrases(*this, NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
node.SetTargetPhrases(*this, NULL, NULL);
|
||||
}
|
||||
|
||||
delete lastWordOnDisk;
|
||||
delete lastWordOnDisk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user