mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Renamed
This commit is contained in:
parent
c22ce0e61d
commit
d737a352b3
@ -25,7 +25,7 @@
|
||||
#include "moses/FF/PhrasePairFeature.h"
|
||||
#include "moses/FF/PhraseLengthFeature.h"
|
||||
#include "moses/FF/DistortionScoreProducer.h"
|
||||
#include "moses/FF/SparseReorderingFeature.h"
|
||||
#include "moses/FF/SparseHieroReorderingFeature.h"
|
||||
#include "moses/FF/WordPenaltyProducer.h"
|
||||
#include "moses/FF/InputFeature.h"
|
||||
#include "moses/FF/PhrasePenalty.h"
|
||||
@ -145,7 +145,7 @@ FeatureRegistry::FeatureRegistry()
|
||||
MOSES_FNAME(ControlRecombination);
|
||||
MOSES_FNAME(SkeletonStatelessFF);
|
||||
MOSES_FNAME(SkeletonStatefulFF);
|
||||
MOSES_FNAME(SparseReorderingFeature);
|
||||
MOSES_FNAME(SparseHieroReorderingFeature);
|
||||
MOSES_FNAME(ExternalFeature);
|
||||
|
||||
#ifdef HAVE_SYNLM
|
||||
|
@ -7,15 +7,15 @@
|
||||
|
||||
#include "util/exception.hh"
|
||||
|
||||
#include "SparseReorderingFeature.h"
|
||||
#include "SparseHieroReorderingFeature.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
SparseReorderingFeature::SparseReorderingFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("SparseReorderingFeature",0, line),
|
||||
SparseHieroReorderingFeature::SparseHieroReorderingFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("SparseHieroReorderingFeature",0, line),
|
||||
m_type(SourceCombined),
|
||||
m_sourceFactor(0),
|
||||
m_targetFactor(0),
|
||||
@ -39,7 +39,7 @@ SparseReorderingFeature::SparseReorderingFeature(const std::string &line)
|
||||
LoadVocabulary(m_targetVocabFile, m_targetVocab);
|
||||
}
|
||||
|
||||
void SparseReorderingFeature::SetParameter(const std::string& key, const std::string& value) {
|
||||
void SparseHieroReorderingFeature::SetParameter(const std::string& key, const std::string& value) {
|
||||
if (key == "input-factor") {
|
||||
m_sourceFactor = Scan<FactorType>(value);
|
||||
} else if (key == "output-factor") {
|
||||
@ -63,7 +63,7 @@ void SparseReorderingFeature::SetParameter(const std::string& key, const std::st
|
||||
}
|
||||
}
|
||||
|
||||
void SparseReorderingFeature::LoadVocabulary(const std::string& filename, Vocab& vocab)
|
||||
void SparseHieroReorderingFeature::LoadVocabulary(const std::string& filename, Vocab& vocab)
|
||||
{
|
||||
if (filename.empty()) return;
|
||||
ifstream in(filename.c_str());
|
||||
@ -75,13 +75,13 @@ void SparseReorderingFeature::LoadVocabulary(const std::string& filename, Vocab&
|
||||
in.close();
|
||||
}
|
||||
|
||||
const Factor* SparseReorderingFeature::GetFactor(const Word& word, const Vocab& vocab, FactorType factorType) const {
|
||||
const Factor* SparseHieroReorderingFeature::GetFactor(const Word& word, const Vocab& vocab, FactorType factorType) const {
|
||||
const Factor* factor = word.GetFactor(factorType);
|
||||
if (vocab.size() && vocab.find(factor) == vocab.end()) return m_otherFactor;
|
||||
return factor;
|
||||
}
|
||||
|
||||
void SparseReorderingFeature::EvaluateChart(
|
||||
void SparseHieroReorderingFeature::EvaluateChart(
|
||||
const ChartHypothesis& cur_hypo ,
|
||||
ScoreComponentCollection* accumulator) const
|
||||
{
|
@ -12,7 +12,7 @@
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
class SparseReorderingFeature : public StatelessFeatureFunction
|
||||
class SparseHieroReorderingFeature : public StatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
@ -21,7 +21,7 @@ public:
|
||||
SourceRight
|
||||
};
|
||||
|
||||
SparseReorderingFeature(const std::string &line);
|
||||
SparseHieroReorderingFeature(const std::string &line);
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const
|
||||
{ return true; }
|
Loading…
Reference in New Issue
Block a user