mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
debug PhraseDictionaryALSuffixArray for Wilker. Sparse feature score to do
This commit is contained in:
parent
0580e2bd11
commit
ed220e91a9
@ -31,20 +31,22 @@ PhraseDictionaryALSuffixArray::PhraseDictionaryALSuffixArray(const std::string &
|
|||||||
|
|
||||||
void PhraseDictionaryALSuffixArray::InitializeForInput(InputType const& source)
|
void PhraseDictionaryALSuffixArray::InitializeForInput(InputType const& source)
|
||||||
{
|
{
|
||||||
// clear out rules for previous sentence
|
|
||||||
m_collection.Clear();
|
|
||||||
|
|
||||||
// populate with rules for this sentence
|
// populate with rules for this sentence
|
||||||
long translationId = source.GetTranslationId();
|
long translationId = source.GetTranslationId();
|
||||||
|
|
||||||
string grammarFile = GetFilePath() + "/grammar.out." + SPrint(translationId) + ".gz";
|
string grammarFile = GetFilePath() + "/grammar." + SPrint(translationId) + ".gz";
|
||||||
|
|
||||||
std::auto_ptr<RuleTableLoader> loader =
|
std::auto_ptr<RuleTableLoader> loader =
|
||||||
RuleTableLoaderFactory::Create(grammarFile);
|
RuleTableLoaderFactory::Create(grammarFile);
|
||||||
bool ret = loader->Load(*m_input, *m_output, grammarFile, m_tableLimit,
|
bool ret = loader->Load(m_input, m_output, grammarFile, m_tableLimit,
|
||||||
*this);
|
*this);
|
||||||
|
|
||||||
CHECK(ret);
|
CHECK(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhraseDictionaryALSuffixArray::CleanUpAfterSentenceProcessing(const InputType &source)
|
||||||
|
{
|
||||||
|
m_collection.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,11 +22,12 @@ class PhraseDictionaryALSuffixArray : public PhraseDictionaryMemory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PhraseDictionaryALSuffixArray(const std::string &line);
|
PhraseDictionaryALSuffixArray(const std::string &line);
|
||||||
|
bool InitDictionary()
|
||||||
|
{ return true; }
|
||||||
void InitializeForInput(InputType const& source);
|
void InitializeForInput(InputType const& source);
|
||||||
|
void CleanUpAfterSentenceProcessing(const InputType& source);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<FactorType> *m_input, *m_output;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user