2013-12-02 19:29:13 +04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "PhraseDictionary.h"
|
2013-12-06 20:25:17 +04:00
|
|
|
#include <boost/thread/tss.hpp>
|
2013-12-02 19:29:13 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
class ChartParser;
|
|
|
|
class ChartCellCollectionBase;
|
|
|
|
class ChartRuleLookupManager;
|
2013-12-05 17:06:35 +04:00
|
|
|
class InputPath;
|
2013-12-02 19:29:13 +04:00
|
|
|
|
2013-12-05 17:13:01 +04:00
|
|
|
class PhraseDictionaryTransliteration : public PhraseDictionary
|
2013-12-02 19:29:13 +04:00
|
|
|
{
|
2013-12-05 17:13:01 +04:00
|
|
|
friend std::ostream& operator<<(std::ostream&, const PhraseDictionaryTransliteration&);
|
2013-12-02 19:29:13 +04:00
|
|
|
|
|
|
|
public:
|
2013-12-05 17:13:01 +04:00
|
|
|
PhraseDictionaryTransliteration(const std::string &line);
|
2013-12-02 19:29:13 +04:00
|
|
|
|
2013-12-10 16:42:05 +04:00
|
|
|
void Load();
|
|
|
|
|
2013-12-02 19:29:13 +04:00
|
|
|
virtual void CleanUpAfterSentenceProcessing(const InputType& source);
|
|
|
|
|
|
|
|
// for phrase-based model
|
|
|
|
void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const;
|
|
|
|
|
|
|
|
// for syntax/hiero model (CKY+ decoding)
|
|
|
|
ChartRuleLookupManager* CreateRuleLookupManager(const ChartParser&, const ChartCellCollectionBase&);
|
|
|
|
|
2013-12-04 23:16:37 +04:00
|
|
|
void SetParameter(const std::string& key, const std::string& value);
|
|
|
|
|
2013-12-02 19:29:13 +04:00
|
|
|
TO_STRING();
|
|
|
|
|
|
|
|
protected:
|
2013-12-04 23:16:37 +04:00
|
|
|
std::string m_mosesDir, m_scriptDir, m_externalDir, m_inputLang, m_outputLang;
|
|
|
|
|
2013-12-04 22:47:33 +04:00
|
|
|
std::vector<TargetPhrase*> CreateTargetPhrases(const Phrase &sourcePhrase, const std::string &outDir) const;
|
2013-12-05 17:06:35 +04:00
|
|
|
bool SatisfyBackoff(const InputPath &inputPath) const;
|
|
|
|
|
2013-12-06 20:25:17 +04:00
|
|
|
void GetTargetPhraseCollection(InputPath &inputPath) const;
|
|
|
|
|
2013-12-02 19:29:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Moses
|