diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-12-07 04:21:06 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-12-07 04:21:06 +0400 |
commit | ba209202efa9fbb410078fdc7efc5b52827fc600 (patch) | |
tree | f52ccfb03989e37fe301202876af8f5661f7bd63 /moses/ConfusionNet.cpp | |
parent | a5d0296699c7b4214ea897b36de299ca91d7c729 (diff) |
move all feature functions out of StaticData
Diffstat (limited to 'moses/ConfusionNet.cpp')
-rw-r--r-- | moses/ConfusionNet.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/moses/ConfusionNet.cpp b/moses/ConfusionNet.cpp index 7b8acdb5e..a6b93a2dc 100644 --- a/moses/ConfusionNet.cpp +++ b/moses/ConfusionNet.cpp @@ -69,8 +69,7 @@ ConfusionNet::ConfusionNet() if (staticData.IsChart()) { m_defaultLabelSet.insert(StaticData::Instance().GetInputDefaultNonTerminal()); } - UTIL_THROW_IF2(StaticData::Instance().GetInputFeature() == NULL, - "Input feature must be specified"); + UTIL_THROW_IF2(&InputFeature::Instance() == NULL, "Input feature must be specified"); } ConfusionNet::~ConfusionNet() { @@ -131,9 +130,9 @@ bool ConfusionNet::ReadFormat0(std::istream& in, Clear(); const StaticData &staticData = StaticData::Instance(); - const InputFeature *inputFeature = staticData.GetInputFeature(); - size_t numInputScores = inputFeature->GetNumInputScores(); - size_t numRealWordCount = inputFeature->GetNumRealWordsInInput(); + const InputFeature &inputFeature = InputFeature::Instance(); + size_t numInputScores = inputFeature.GetNumInputScores(); + size_t numRealWordCount = inputFeature.GetNumRealWordsInInput(); size_t totalCount = numInputScores + numRealWordCount; bool addRealWordCount = (numRealWordCount > 0); |