2008-06-11 14:52:57 +04:00
|
|
|
// $Id$
|
2010-02-24 14:15:44 +03:00
|
|
|
#ifndef moses_TranslationOptionCollectionConfusionNet_h
|
|
|
|
#define moses_TranslationOptionCollectionConfusionNet_h
|
2008-06-11 14:52:57 +04:00
|
|
|
|
|
|
|
#include "TranslationOptionCollection.h"
|
2013-06-15 00:16:12 +04:00
|
|
|
#include "ConfusionNet.h"
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2008-10-09 03:51:26 +04:00
|
|
|
namespace Moses
|
|
|
|
{
|
2013-06-15 00:16:12 +04:00
|
|
|
class InputFeature;
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2012-06-29 02:29:46 +04:00
|
|
|
/** Holds all translation options, for all spans, of a particular confusion network input
|
|
|
|
* Inherited from TranslationOptionCollection.
|
|
|
|
*/
|
2011-02-24 16:14:42 +03:00
|
|
|
class TranslationOptionCollectionConfusionNet : public TranslationOptionCollection
|
|
|
|
{
|
|
|
|
public:
|
2013-06-14 18:43:18 +04:00
|
|
|
typedef std::pair<Phrase, ScoreComponentCollection> SourcePath;
|
|
|
|
|
2013-05-11 17:13:26 +04:00
|
|
|
TranslationOptionCollectionConfusionNet(const ConfusionNet &source, size_t maxNoTransOptPerCoverage, float translationOptionThreshold);
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
void ProcessUnknownWord(size_t sourcePos);
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2013-06-14 18:43:18 +04:00
|
|
|
const std::vector<SourcePath> &GetPhrases(size_t startPos, size_t endPos) const;
|
|
|
|
std::vector<SourcePath> &GetPhrases(size_t startPos, size_t endPos);
|
|
|
|
protected:
|
|
|
|
std::vector<std::vector<std::vector<SourcePath> > > m_collection;
|
2013-06-15 00:16:12 +04:00
|
|
|
|
|
|
|
void CreateSubPhrases(std::vector<SourcePath> &newSubphrases
|
2013-06-15 02:42:30 +04:00
|
|
|
, const std::vector<SourcePath> &prevSubphrases
|
|
|
|
, const ConfusionNet::Column &col
|
|
|
|
, const InputFeature &inputFeature);
|
2013-06-17 23:23:25 +04:00
|
|
|
|
|
|
|
void CreateTranslationOptionsForRange(const DecodeGraph &decodeStepList
|
|
|
|
, size_t startPosition
|
|
|
|
, size_t endPosition
|
|
|
|
, bool adhereTableLimit
|
|
|
|
, size_t graphInd);
|
2008-06-11 14:52:57 +04:00
|
|
|
};
|
2008-10-09 03:51:26 +04:00
|
|
|
|
|
|
|
}
|
2010-02-24 14:15:44 +03:00
|
|
|
#endif
|