2016-03-01 22:57:40 +03:00
|
|
|
/*
|
|
|
|
* InputPath.h
|
|
|
|
*
|
|
|
|
* Created on: 23 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
2016-08-17 16:40:08 +03:00
|
|
|
#include <list>
|
2016-04-19 22:45:17 +03:00
|
|
|
#include <boost/unordered_map.hpp>
|
2016-03-01 22:57:40 +03:00
|
|
|
#include "../InputPathBase.h"
|
2016-04-16 16:35:42 +03:00
|
|
|
#include "TargetPhrases.h"
|
2016-04-20 17:03:36 +03:00
|
|
|
#include "ActiveChart.h"
|
2016-04-27 19:32:22 +03:00
|
|
|
#include "Word.h"
|
2016-03-01 22:57:40 +03:00
|
|
|
|
|
|
|
namespace Moses2
|
|
|
|
{
|
|
|
|
namespace SCFG
|
|
|
|
{
|
2016-04-15 15:57:46 +03:00
|
|
|
class TargetPhrases;
|
2016-04-16 16:35:42 +03:00
|
|
|
class TargetPhraseImpl;
|
2016-04-15 15:57:46 +03:00
|
|
|
|
2016-03-01 22:57:40 +03:00
|
|
|
|
2016-03-03 16:04:27 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
2016-03-31 23:00:16 +03:00
|
|
|
class InputPath: public InputPathBase
|
2016-03-01 22:57:40 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-08-17 16:40:08 +03:00
|
|
|
typedef std::pair<SymbolBind, const SCFG::TargetPhrases*> Element;
|
|
|
|
typedef std::list<Element, MemPoolAllocator<Element> > Coll;
|
2016-08-16 15:19:21 +03:00
|
|
|
Coll targetPhrases;
|
2016-08-17 16:40:08 +03:00
|
|
|
|
2016-04-27 19:32:22 +03:00
|
|
|
SubPhrase<SCFG::Word> subPhrase;
|
2016-04-15 15:38:01 +03:00
|
|
|
|
2016-04-27 19:32:22 +03:00
|
|
|
InputPath(MemPool &pool, const SubPhrase<SCFG::Word> &subPhrase, const Range &range,
|
2016-03-31 23:00:16 +03:00
|
|
|
size_t numPt, const InputPath *prefixPath);
|
|
|
|
virtual ~InputPath();
|
2016-03-01 22:57:40 +03:00
|
|
|
|
2016-04-16 19:54:00 +03:00
|
|
|
const ActiveChart &GetActiveChart(size_t ptInd) const
|
|
|
|
{ return m_activeChart[ptInd]; }
|
2016-04-21 16:19:31 +03:00
|
|
|
|
|
|
|
void AddActiveChartEntry(size_t ptInd, ActiveChartEntry *chartEntry);
|
2016-03-01 22:57:40 +03:00
|
|
|
|
2016-06-22 12:59:51 +03:00
|
|
|
void AddTargetPhrasesToPath(
|
|
|
|
MemPool &pool,
|
2016-08-17 15:03:23 +03:00
|
|
|
const System &system,
|
2016-06-22 12:59:51 +03:00
|
|
|
const PhraseTable &pt,
|
|
|
|
const SCFG::TargetPhrases &tps,
|
|
|
|
const SCFG::SymbolBind &symbolBind);
|
|
|
|
|
2016-04-29 02:09:02 +03:00
|
|
|
size_t GetNumRules() const;
|
2016-06-11 00:03:11 +03:00
|
|
|
|
2016-06-20 16:59:31 +03:00
|
|
|
std::string Debug(const System &system) const;
|
2016-06-11 00:03:11 +03:00
|
|
|
|
2016-03-01 22:57:40 +03:00
|
|
|
protected:
|
2016-03-31 23:00:16 +03:00
|
|
|
ActiveChart *m_activeChart;
|
2016-03-01 22:57:40 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|