mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
clean up TargetPhrase
This commit is contained in:
parent
9ead26071e
commit
f844bd12d9
@ -38,24 +38,6 @@ using namespace std;
|
|||||||
|
|
||||||
namespace Moses
|
namespace Moses
|
||||||
{
|
{
|
||||||
TargetPhrase::TargetPhrase( std::string out_string)
|
|
||||||
:Phrase(0)
|
|
||||||
, m_fullScore(0.0)
|
|
||||||
, m_futureScore(0.0)
|
|
||||||
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
|
||||||
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
|
||||||
, m_lhsTarget(NULL)
|
|
||||||
, m_ruleSource(NULL)
|
|
||||||
, m_decodeGraphId(NOT_FOUND)
|
|
||||||
{
|
|
||||||
|
|
||||||
//ACAT
|
|
||||||
const StaticData &staticData = StaticData::Instance();
|
|
||||||
CreateFromString(Output, staticData.GetInputFactorOrder(), out_string,
|
|
||||||
// staticData.GetFactorDelimiter(), // eliminated [UG]
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
TargetPhrase::TargetPhrase()
|
TargetPhrase::TargetPhrase()
|
||||||
:Phrase()
|
:Phrase()
|
||||||
, m_fullScore(0.0)
|
, m_fullScore(0.0)
|
||||||
@ -64,7 +46,7 @@ TargetPhrase::TargetPhrase()
|
|||||||
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||||
, m_lhsTarget(NULL)
|
, m_lhsTarget(NULL)
|
||||||
, m_ruleSource(NULL)
|
, m_ruleSource(NULL)
|
||||||
, m_decodeGraphId(NOT_FOUND)
|
, m_container(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +58,7 @@ TargetPhrase::TargetPhrase(const Phrase &phrase)
|
|||||||
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||||
, m_lhsTarget(NULL)
|
, m_lhsTarget(NULL)
|
||||||
, m_ruleSource(NULL)
|
, m_ruleSource(NULL)
|
||||||
, m_decodeGraphId(NOT_FOUND)
|
, m_container(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +69,7 @@ TargetPhrase::TargetPhrase(const TargetPhrase ©)
|
|||||||
, m_scoreBreakdown(copy.m_scoreBreakdown)
|
, m_scoreBreakdown(copy.m_scoreBreakdown)
|
||||||
, m_alignTerm(copy.m_alignTerm)
|
, m_alignTerm(copy.m_alignTerm)
|
||||||
, m_alignNonTerm(copy.m_alignNonTerm)
|
, m_alignNonTerm(copy.m_alignNonTerm)
|
||||||
, m_decodeGraphId(copy.m_decodeGraphId)
|
, m_container(copy.m_container)
|
||||||
{
|
{
|
||||||
if (copy.m_lhsTarget) {
|
if (copy.m_lhsTarget) {
|
||||||
m_lhsTarget = new Word(*copy.m_lhsTarget);
|
m_lhsTarget = new Word(*copy.m_lhsTarget);
|
||||||
|
@ -41,6 +41,8 @@ namespace Moses
|
|||||||
{
|
{
|
||||||
class FeatureFunction;
|
class FeatureFunction;
|
||||||
class InputPath;
|
class InputPath;
|
||||||
|
class InputPath;
|
||||||
|
class PhraseDictionary;
|
||||||
|
|
||||||
/** represents an entry on the target side of a phrase table (scores, translation, alignment)
|
/** represents an entry on the target side of a phrase table (scores, translation, alignment)
|
||||||
*/
|
*/
|
||||||
@ -60,12 +62,11 @@ private:
|
|||||||
typedef std::map<std::string, boost::shared_ptr<PhraseProperty> > Properties;
|
typedef std::map<std::string, boost::shared_ptr<PhraseProperty> > Properties;
|
||||||
Properties m_properties;
|
Properties m_properties;
|
||||||
|
|
||||||
size_t m_decodeGraphId;
|
const PhraseDictionary *m_container;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TargetPhrase();
|
TargetPhrase();
|
||||||
TargetPhrase(const TargetPhrase ©);
|
TargetPhrase(const TargetPhrase ©);
|
||||||
explicit TargetPhrase(std::string out_string);
|
|
||||||
explicit TargetPhrase(const Phrase &targetPhrase);
|
explicit TargetPhrase(const Phrase &targetPhrase);
|
||||||
~TargetPhrase();
|
~TargetPhrase();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user