mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
rename SetTargetPhraseFromPtMatrix() to GetTargetPhraseCollectionBatch()
This commit is contained in:
parent
c6d8259f68
commit
66e7720b91
@ -75,7 +75,7 @@ void PhraseDictionary::SetFeaturesToApply()
|
||||
}
|
||||
}
|
||||
|
||||
void PhraseDictionary::SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const
|
||||
void PhraseDictionary::GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const
|
||||
{
|
||||
InputPathList::const_iterator iter;
|
||||
for (iter = phraseDictionaryQueue.begin(); iter != phraseDictionaryQueue.end(); ++iter) {
|
||||
|
@ -67,14 +67,14 @@ public:
|
||||
return m_tableLimit;
|
||||
}
|
||||
|
||||
// LEGACY - The preferred method is to override SetTargetPhraseFromPtMatrix().
|
||||
// LEGACY - The preferred method is to override GetTargetPhraseCollectionBatch().
|
||||
// See class PhraseDictionaryMemory or PhraseDictionaryOnDisk for details
|
||||
//! find list of translations that can translates src. Only for phrase input
|
||||
virtual const TargetPhraseCollection *GetTargetPhraseCollection(const Phrase& src) const;
|
||||
//! find list of translations that can translates a portion of src. Used by confusion network decoding
|
||||
virtual const TargetPhraseCollection *GetTargetPhraseCollection(InputType const& src,WordsRange const& range) const;
|
||||
|
||||
virtual void SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const;
|
||||
virtual void GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const;
|
||||
|
||||
//! Create entry for translation of source to targetPhrase
|
||||
virtual void InitializeForInput(InputType const& source) {
|
||||
|
@ -134,7 +134,7 @@ cerr << "source=" << source << endl
|
||||
return coll;
|
||||
}
|
||||
|
||||
void PhraseDictionaryMemory::SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const
|
||||
void PhraseDictionaryMemory::GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const
|
||||
{
|
||||
InputPathList::const_iterator iter;
|
||||
for (iter = phraseDictionaryQueue.begin(); iter != phraseDictionaryQueue.end(); ++iter) {
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
// only used by multi-model phrase table, and other meta-features
|
||||
const TargetPhraseCollection *GetTargetPhraseCollection(const Phrase& src) const;
|
||||
void SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const;
|
||||
void GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const;
|
||||
|
||||
TO_STRING();
|
||||
|
||||
|
@ -91,7 +91,7 @@ void PhraseDictionaryOnDisk::InitializeForInput(InputType const& source)
|
||||
m_implementation.reset(obj);
|
||||
}
|
||||
|
||||
void PhraseDictionaryOnDisk::SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const
|
||||
void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const
|
||||
{
|
||||
OnDiskPt::OnDiskWrapper &wrapper = const_cast<OnDiskPt::OnDiskWrapper&>(GetImplementation());
|
||||
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
const ChartCellCollectionBase &);
|
||||
|
||||
virtual void InitializeForInput(InputType const& source);
|
||||
void SetTargetPhraseFromPtMatrix(const InputPathList &phraseDictionaryQueue) const;
|
||||
void GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -688,7 +688,7 @@ const TranslationOptionList &TranslationOptionCollection::GetTranslationOptionLi
|
||||
return m_collection[startPos][maxSize];
|
||||
}
|
||||
|
||||
void TranslationOptionCollection::SetTargetPhraseFromPtMatrix()
|
||||
void TranslationOptionCollection::GetTargetPhraseCollectionBatch()
|
||||
{
|
||||
const vector <DecodeGraph*> &decodeGraphList = StaticData::Instance().GetDecodeGraphs();
|
||||
for (size_t graphInd = 0 ; graphInd < decodeGraphList.size() ; graphInd++) {
|
||||
@ -700,7 +700,7 @@ void TranslationOptionCollection::SetTargetPhraseFromPtMatrix()
|
||||
const DecodeStepTranslation *transStep = dynamic_cast<const DecodeStepTranslation *>(&decodeStep);
|
||||
if (transStep) {
|
||||
const PhraseDictionary &phraseDictionary = *transStep->GetPhraseDictionaryFeature();
|
||||
phraseDictionary.SetTargetPhraseFromPtMatrix(m_phraseDictionaryQueue);
|
||||
phraseDictionary.GetTargetPhraseCollectionBatch(m_phraseDictionaryQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ protected:
|
||||
|
||||
void CacheLexReordering();
|
||||
|
||||
void SetTargetPhraseFromPtMatrix();
|
||||
void GetTargetPhraseCollectionBatch();
|
||||
|
||||
void CreateTranslationOptionsForRange(
|
||||
const DecodeGraph &decodeGraph
|
||||
|
@ -130,7 +130,7 @@ void TranslationOptionCollectionConfusionNet::ProcessUnknownWord(size_t sourcePo
|
||||
void TranslationOptionCollectionConfusionNet::CreateTranslationOptions()
|
||||
{
|
||||
if (!m_useLegacy) {
|
||||
SetTargetPhraseFromPtMatrix();
|
||||
GetTargetPhraseCollectionBatch();
|
||||
}
|
||||
TranslationOptionCollection::CreateTranslationOptions();
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ InputPath &TranslationOptionCollectionText::GetInputPath(size_t startPos, size_t
|
||||
|
||||
void TranslationOptionCollectionText::CreateTranslationOptions()
|
||||
{
|
||||
SetTargetPhraseFromPtMatrix();
|
||||
GetTargetPhraseCollectionBatch();
|
||||
TranslationOptionCollection::CreateTranslationOptions();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user