|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once |
|
|
#ifndef moses_ChartRuleLookupManagerOnDisk_h |
|
|
#define moses_ChartRuleLookupManagerOnDisk_h |
|
|
|
|
|
#include "OnDiskPt/OnDiskWrapper.h" |
|
|
|
|
|
#include "ChartRuleLookupManagerCYKPlus.h" |
|
|
#include "DotChartOnDisk.h" |
|
|
#include "moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h" |
|
|
#include "moses/ChartParserCallback.h" |
|
|
#include "moses/InputType.h" |
|
|
|
|
|
namespace Moses |
|
|
{ |
|
|
|
|
|
|
|
|
class ChartRuleLookupManagerOnDisk : public ChartRuleLookupManagerCYKPlus |
|
|
{ |
|
|
public: |
|
|
ChartRuleLookupManagerOnDisk(const ChartParser &parser, |
|
|
const ChartCellCollectionBase &cellColl, |
|
|
const PhraseDictionaryOnDisk &dictionary, |
|
|
OnDiskPt::OnDiskWrapper &dbWrapper, |
|
|
const std::vector<FactorType> &inputFactorsVec, |
|
|
const std::vector<FactorType> &outputFactorsVec); |
|
|
|
|
|
~ChartRuleLookupManagerOnDisk(); |
|
|
|
|
|
virtual void GetChartRuleCollection(const InputPath &inputPath, |
|
|
size_t last, |
|
|
ChartParserCallback &outColl); |
|
|
|
|
|
private: |
|
|
const PhraseDictionaryOnDisk &m_dictionary; |
|
|
OnDiskPt::OnDiskWrapper &m_dbWrapper; |
|
|
const std::vector<FactorType> &m_inputFactorsVec; |
|
|
const std::vector<FactorType> &m_outputFactorsVec; |
|
|
std::vector<DottedRuleStackOnDisk*> m_expandableDottedRuleListVec; |
|
|
std::map<uint64_t, TargetPhraseCollection::shared_ptr > m_cache; |
|
|
std::list<const OnDiskPt::PhraseNode*> m_sourcePhraseNode; |
|
|
Word m_input_default_nonterminal; |
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|