mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-09 04:56:57 +03:00
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
/*
|
|
* InputPath.h
|
|
*
|
|
* Created on: 23 Oct 2015
|
|
* Author: hieu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <boost/unordered_map.hpp>
|
|
#include "../InputPathBase.h"
|
|
#include "TargetPhrases.h"
|
|
#include "ActiveChart.h"
|
|
#include "Word.h"
|
|
|
|
namespace Moses2
|
|
{
|
|
namespace SCFG
|
|
{
|
|
class TargetPhrases;
|
|
class TargetPhraseImpl;
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
class InputPath: public InputPathBase
|
|
{
|
|
friend std::ostream& operator<<(std::ostream &, const InputPath &);
|
|
public:
|
|
typedef boost::unordered_map<SymbolBind, SCFG::TargetPhrases> Coll;
|
|
Coll targetPhrases;
|
|
SubPhrase<SCFG::Word> subPhrase;
|
|
|
|
InputPath(MemPool &pool, const SubPhrase<SCFG::Word> &subPhrase, const Range &range,
|
|
size_t numPt, const InputPath *prefixPath);
|
|
virtual ~InputPath();
|
|
|
|
const ActiveChart &GetActiveChart(size_t ptInd) const
|
|
{ return m_activeChart[ptInd]; }
|
|
|
|
void AddActiveChartEntry(size_t ptInd, ActiveChartEntry *chartEntry);
|
|
|
|
void AddTargetPhrase(const PhraseTable &pt,
|
|
const SCFG::SymbolBind &symbolBind,
|
|
const SCFG::TargetPhraseImpl *tp);
|
|
|
|
size_t GetNumRules() const;
|
|
protected:
|
|
ActiveChart *m_activeChart;
|
|
};
|
|
|
|
}
|
|
}
|
|
|