|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once |
|
|
|
#include "PhraseDictionaryNodeMemory.h" |
|
#include "moses/TranslationModel/PhraseDictionary.h" |
|
#include "moses/InputType.h" |
|
#include "moses/NonTerminal.h" |
|
#include "moses/TranslationModel/RuleTable/Trie.h" |
|
|
|
namespace Moses |
|
{ |
|
class ChartParser; |
|
|
|
|
|
|
|
|
|
class PhraseDictionaryMemory : public RuleTableTrie |
|
{ |
|
friend std::ostream& operator<<(std::ostream&, const PhraseDictionaryMemory&); |
|
friend class RuleTableLoader; |
|
|
|
protected: |
|
PhraseDictionaryMemory(int type, const std::string &line) |
|
: RuleTableTrie(line) { |
|
} |
|
|
|
public: |
|
PhraseDictionaryMemory(const std::string &line); |
|
|
|
const PhraseDictionaryNodeMemory &GetRootNode() const { |
|
return m_collection; |
|
} |
|
|
|
ChartRuleLookupManager* |
|
CreateRuleLookupManager( |
|
const ChartParser &, |
|
const ChartCellCollectionBase &, |
|
std::size_t); |
|
|
|
|
|
TargetPhraseCollection::shared_ptr |
|
GetTargetPhraseCollectionLEGACY(const Phrase& src) const; |
|
|
|
void |
|
GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const; |
|
|
|
TO_STRING(); |
|
|
|
protected: |
|
TargetPhraseCollection::shared_ptr |
|
GetOrCreateTargetPhraseCollection |
|
(const Phrase &source, const TargetPhrase &target, const Word *sourceLHS); |
|
|
|
PhraseDictionaryNodeMemory & |
|
GetOrCreateNode(const Phrase &source, const TargetPhrase &target, |
|
const Word *sourceLHS); |
|
|
|
void SortAndPrune(); |
|
|
|
PhraseDictionaryNodeMemory m_collection; |
|
}; |
|
|
|
} |
|
|