mosesdecoder/contrib/moses2/SCFG/InputPath.h

63 lines
1.3 KiB
C
Raw Normal View History

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>
#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"
#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;
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]; }
void AddActiveChartEntry(size_t ptInd, ActiveChartEntry *chartEntry);
2016-03-01 22:57:40 +03:00
void AddTargetPhrasesToPath(
MemPool &pool,
const System &system,
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
};
}
}