mosesdecoder/moses/FF/ChartBasedFeatureContext.h

40 lines
937 B
C
Raw Normal View History

2013-05-24 21:34:47 +04:00
#pragma once
namespace Moses
{
class ChartHypothesis;
class InputType;
class TargetPhrase;
/**
* Same as PhraseBasedFeatureContext, but for chart-based Moses.
**/
class ChartBasedFeatureContext
{
2013-05-29 21:16:15 +04:00
//The context either has a hypothesis (during search) or a
2013-05-24 21:34:47 +04:00
//TargetPhrase and source sentence (during pre-calculation)
//TODO: should the context also include some info on where the TargetPhrase
//is anchored (assuming it's lexicalised), which is available at pre-calc?
const ChartHypothesis* m_hypothesis;
const TargetPhrase& m_targetPhrase;
const InputType& m_source;
public:
ChartBasedFeatureContext(const ChartHypothesis* hypothesis);
ChartBasedFeatureContext(const TargetPhrase& targetPhrase,
const InputType& source);
2013-05-29 21:16:15 +04:00
const InputType& GetSource() const {
return m_source;
}
2013-05-25 02:18:38 +04:00
2013-05-29 21:16:15 +04:00
const TargetPhrase& GetTargetPhrase() const {
return m_targetPhrase;
}
2013-05-24 21:34:47 +04:00
};
} // namespace