mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 15:48:05 +03:00
caching target phrase for OnDisk pt
This commit is contained in:
parent
55920d5bca
commit
31360e70ef
@ -91,13 +91,19 @@ void PhraseDictionaryOnDisk::InitializeForInput(InputType const& source)
|
||||
m_implementation.reset(obj);
|
||||
}
|
||||
|
||||
void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const
|
||||
void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const
|
||||
{
|
||||
OnDiskPt::OnDiskWrapper &wrapper = const_cast<OnDiskPt::OnDiskWrapper&>(GetImplementation());
|
||||
|
||||
InputPathList::const_iterator iter;
|
||||
for (iter = phraseDictionaryQueue.begin(); iter != phraseDictionaryQueue.end(); ++iter) {
|
||||
for (iter = inputPathQueue.begin(); iter != inputPathQueue.end(); ++iter) {
|
||||
InputPath &inputPath = **iter;
|
||||
GetTargetPhraseCollectionBatch(inputPath);
|
||||
}
|
||||
}
|
||||
|
||||
void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(InputPath &inputPath) const
|
||||
{
|
||||
OnDiskPt::OnDiskWrapper &wrapper = const_cast<OnDiskPt::OnDiskWrapper&>(GetImplementation());
|
||||
|
||||
const Phrase &phrase = inputPath.GetPhrase();
|
||||
const InputPath *prevInputPath = inputPath.GetPrevNode();
|
||||
|
||||
@ -140,7 +146,6 @@ void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(const InputPathList
|
||||
delete lastWordOnDisk;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ protected:
|
||||
OnDiskPt::OnDiskWrapper &GetImplementation();
|
||||
const OnDiskPt::OnDiskWrapper &GetImplementation() const;
|
||||
|
||||
void GetTargetPhraseCollectionBatch(InputPath &inputPath) const;
|
||||
|
||||
public:
|
||||
PhraseDictionaryOnDisk(const std::string &line);
|
||||
~PhraseDictionaryOnDisk();
|
||||
@ -75,7 +77,7 @@ public:
|
||||
const ChartCellCollectionBase &);
|
||||
|
||||
virtual void InitializeForInput(InputType const& source);
|
||||
void GetTargetPhraseCollectionBatch(const InputPathList &phraseDictionaryQueue) const;
|
||||
void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user