mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +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)
|
||||
{
|
||||
// clear out rules for previous sentence
|
||||
m_collection.Clear();
|
||||
|
||||
// populate with rules for this sentence
|
||||
long translationId = source.GetTranslationId();
|
||||
|
||||
string grammarFile = GetFilePath() + "/grammar.out." + SPrint(translationId) + ".gz";
|
||||
string grammarFile = GetFilePath() + "/grammar." + SPrint(translationId) + ".gz";
|
||||
|
||||
std::auto_ptr<RuleTableLoader> loader =
|
||||
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);
|
||||
|
||||
CHECK(ret);
|
||||
}
|
||||
|
||||
void PhraseDictionaryALSuffixArray::CleanUpAfterSentenceProcessing(const InputType &source)
|
||||
{
|
||||
m_collection.Clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,11 +22,12 @@ class PhraseDictionaryALSuffixArray : public PhraseDictionaryMemory
|
||||
{
|
||||
public:
|
||||
PhraseDictionaryALSuffixArray(const std::string &line);
|
||||
|
||||
bool InitDictionary()
|
||||
{ return true; }
|
||||
void InitializeForInput(InputType const& source);
|
||||
void CleanUpAfterSentenceProcessing(const InputType& source);
|
||||
|
||||
protected:
|
||||
const std::vector<FactorType> *m_input, *m_output;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user