Merge branch 'master' of https://github.com/moses-smt/mosesdecoder into mmt-dev

This commit is contained in:
Ulrich Germann 2015-11-04 18:25:32 +00:00
commit b733804fdc
106 changed files with 296 additions and 362 deletions

View File

@ -35,6 +35,7 @@
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.53427549" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="PT_UG"/>
<listOptionValue builtIn="false" value="HAVE_PROBINGPT"/>
<listOptionValue builtIn="false" value="HAVE_CMPH"/>
<listOptionValue builtIn="false" value="MAX_NUM_FACTORS=4"/>
<listOptionValue builtIn="false" value="KENLM_MAX_ORDER=7"/>
@ -72,7 +73,7 @@
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.1459438132" name="DALMWrapper.h" rcbsApplicability="disable" resourcePath="LM/DALMWrapper.h" toolsToInvoke=""/>
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.871386239" name="LDHT.h" rcbsApplicability="disable" resourcePath="LM/LDHT.h" toolsToInvoke=""/>
<sourceEntries>
<entry excluding="TranslationModel/UG/mm/test-http-client.cc|TranslationModel/UG/ptable-describe-features.cc|TranslationModel/UG/count-ptable-features.cc|TranslationModel/UG/try-align2.cc|TranslationModel/UG/try-align.cc|TranslationModel/UG/spe-check-coverage3.cc|TranslationModel/UG/spe-check-coverage2.cc|TranslationModel/UG/spe-check-coverage.cc|TranslationModel/UG/sim-pe.cc|TranslationModel/UG/generic/stringdist|TranslationModel/UG/mm/test-dynamic-im-tsa.cc|TranslationModel/UG/mm/mtt.count.cc|LM/ParallelBackoff.h|LM/ParallelBackoff.cpp|LM/bilingual-lm|LM/MaxEntSRI.h|LM/MaxEntSRI.cpp|LM/BilingualLM.h|LM/BilingualLM.cpp|LM/Rand.h|LM/Rand.cpp|LM/LDHT.h|LM/LDHT.cpp|LM/ORLM.h|LM/ORLM.cpp|LM/NeuralLMWrapper.h|LM/NeuralLMWrapper.cpp|LM/SRI.h|LM/SRI.cpp|LM/IRST.h|LM/IRST.cpp|LM/DALMWrapper.h|LM/DALMWrapper.cpp|LM/oxlm|TranslationModel/ProbingPT|TranslationModel/UG/util" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="TranslationModel/UG/mm/test-http-client.cc|TranslationModel/UG/ptable-describe-features.cc|TranslationModel/UG/count-ptable-features.cc|TranslationModel/UG/try-align2.cc|TranslationModel/UG/try-align.cc|TranslationModel/UG/spe-check-coverage3.cc|TranslationModel/UG/spe-check-coverage2.cc|TranslationModel/UG/spe-check-coverage.cc|TranslationModel/UG/sim-pe.cc|TranslationModel/UG/generic/stringdist|TranslationModel/UG/mm/test-dynamic-im-tsa.cc|TranslationModel/UG/mm/mtt.count.cc|LM/ParallelBackoff.h|LM/ParallelBackoff.cpp|LM/bilingual-lm|LM/MaxEntSRI.h|LM/MaxEntSRI.cpp|LM/BilingualLM.h|LM/BilingualLM.cpp|LM/Rand.h|LM/Rand.cpp|LM/LDHT.h|LM/LDHT.cpp|LM/ORLM.h|LM/ORLM.cpp|LM/NeuralLMWrapper.h|LM/NeuralLMWrapper.cpp|LM/SRI.h|LM/SRI.cpp|LM/IRST.h|LM/IRST.cpp|LM/DALMWrapper.h|LM/DALMWrapper.cpp|LM/oxlm|TranslationModel/UG/util" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>

View File

@ -85,6 +85,16 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/parameters/BeamSearchOptions.h</locationURI>
</link>
<link>
<name>Bitmap.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Bitmap.cpp</locationURI>
</link>
<link>
<name>Bitmap.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Bitmap.h</locationURI>
</link>
<link>
<name>BitmapContainer.cpp</name>
<type>1</type>
@ -725,6 +735,16 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/PrefixTreeMap.h</locationURI>
</link>
<link>
<name>Range.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Range.cpp</locationURI>
</link>
<link>
<name>Range.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Range.h</locationURI>
</link>
<link>
<name>ReorderingConstraint.cpp</name>
<type>1</type>
@ -1135,26 +1155,6 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/WordLattice.h</locationURI>
</link>
<link>
<name>Bitmap.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Bitmap.cpp</locationURI>
</link>
<link>
<name>Bitmap.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Bitmap.h</locationURI>
</link>
<link>
<name>Range.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Range.cpp</locationURI>
</link>
<link>
<name>Range.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/Range.h</locationURI>
</link>
<link>
<name>XmlOption.cpp</name>
<type>1</type>
@ -3255,11 +3255,6 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/ProbingPT/storing.hh</locationURI>
</link>
<link>
<name>TranslationModel/ProbingPT/tests</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>TranslationModel/ProbingPT/vocabid.cpp</name>
<type>1</type>
@ -3700,16 +3695,6 @@
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>TranslationModel/ProbingPT/tests/tokenization_tests.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/ProbingPT/tests/tokenization_tests.cpp</locationURI>
</link>
<link>
<name>TranslationModel/ProbingPT/tests/vocabid_test.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/ProbingPT/tests/vocabid_test.cpp</locationURI>
</link>
<link>
<name>TranslationModel/UG/bin/gcc-4.8</name>
<type>2</type>
@ -4485,6 +4470,11 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/BilingualLM.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Bitmap.o</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Bitmap.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/BitmapContainer.o</name>
<type>1</type>
@ -4760,6 +4750,11 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/PrefixTreeMap.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Range.o</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Range.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Remote.o</name>
<type>1</type>
@ -4950,16 +4945,6 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/WordLattice.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Bitmap.o</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Bitmap.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Range.o</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/Range.o</locationURI>
</link>
<link>
<name>bin/gcc-4.8/release/debug-symbols-on/link-static/threading-multi/XmlOption.o</name>
<type>1</type>

View File

@ -1,4 +1,4 @@
// -*- c++ -*-
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
// A class to store "local" information (such as task-specific caches).
// The idea is for each translation task to have a scope, which stores
// shared pointers to task-specific objects such as caches and priors.
@ -14,16 +14,12 @@
// for some reason, the xmlrpc_c headers must be included AFTER the
// boost thread-related ones ...
#ifdef HAVE_XMLRPC_C
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-c/registry.hpp>
#include <xmlrpc-c/server_abyss.hpp>
#endif
#include "xmlrpc-c.h"
#include <map>
#include <boost/shared_ptr.hpp>
// #include "thread_safe_container.h"
#include "TypeDef.h"
#include "Util.h"
namespace Moses
{
@ -40,25 +36,6 @@ protected:
#endif
SPTR<std::map<std::string,float> const> m_context_weights;
public:
// class write_access
// {
// boost::unique_lock<boost::shared_mutex> m_lock;
// public:
// write_access(boost::shared_mutex& lock)
// : m_lock(lock)
// { }
// write_access(write_access& other)
// {
// swap(m_lock, other.m_lock);
// }
// };
// write_access lock() const
// {
// return write_access(m_lock);
// }
template<typename T>
boost::shared_ptr<void> const&
@ -109,22 +86,10 @@ public:
m_scratchpad = other.m_scratchpad;
}
#ifdef HAVE_XMLRPC_C
SPTR<std::map<std::string,float> const>
GetContextWeights(xmlrpc_c::value const* spec = NULL) {
if (spec && m_context_weights == NULL) {
boost::unique_lock<boost::shared_mutex> lock(m_lock);
SPTR<std::map<std::string,float> > M(new std::map<std::string, float>);
typedef std::map<std::string,xmlrpc_c::value> tmap;
tmap const tmp = static_cast<tmap>(xmlrpc_c::value_struct(*spec));
for(tmap::const_iterator m = tmp.begin(); m != tmp.end(); ++m)
(*M)[m->first] = xmlrpc_c::value_double(m->second);
m_context_weights = M;
}
GetContextWeights() {
return m_context_weights;
}
#endif
bool
SetContextWeights(std::string const& spec) {
@ -147,7 +112,9 @@ public:
bool
SetContextWeights(SPTR<std::map<std::string,float> const> const& w) {
if (m_context_weights) return false;
#ifdef WITH_THREADS
boost::unique_lock<boost::shared_mutex> lock(m_lock);
#endif
m_context_weights = w;
return true;
}

View File

@ -60,13 +60,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#include "ExportInterface.h"
#ifdef HAVE_XMLRPC_C
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-c/registry.hpp>
#include <xmlrpc-c/server_abyss.hpp>
#include "server/Server.h"
#endif
#include "moses/server/Server.h"
using namespace std;
using namespace Moses;
@ -148,6 +142,9 @@ run_as_server()
#ifdef HAVE_XMLRPC_C
MosesServer::Server server(params);
return server.run(); // actually: don't return. see Server::run()
#else
UTIL_THROW2("Moses was compiled without xmlrpc-c. "
<< "No server functionality available.");
#endif
}

View File

@ -128,7 +128,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -137,7 +137,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
bool Enabled() const {

View File

@ -45,7 +45,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void EvaluateWithSourceContext(const InputType &input
@ -53,7 +53,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -61,14 +61,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -19,7 +19,7 @@ CountNonTerms::CountNonTerms(const std::string &line)
void CountNonTerms::EvaluateInIsolation(const Phrase &sourcePhrase
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
const StaticData &staticData = StaticData::Instance();

View File

@ -16,14 +16,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -33,7 +33,7 @@ bool CoveredReferenceState::operator==(const FFState& other) const
void CoveredReferenceFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{}
void CoveredReferenceFeature::EvaluateWithSourceContext(const InputType &input
@ -41,7 +41,7 @@ void CoveredReferenceFeature::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
long id = input.GetTranslationId();
boost::unordered_map<long, std::multiset<string> >::const_iterator refIt = m_refs.find(id);
@ -54,7 +54,7 @@ void CoveredReferenceFeature::EvaluateWithSourceContext(const InputType &input
scores.push_back(covered.size());
scoreBreakdown.Assign(this, scores);
estimatedScore->Assign(this, scores);
estimatedScores->Assign(this, scores);
}
void CoveredReferenceFeature::Load()

View File

@ -56,13 +56,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -76,7 +76,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {
@ -85,7 +85,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void SetContainer(const DecodeStep *container) {

View File

@ -41,7 +41,7 @@ void DeleteRules::Load()
void DeleteRules::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &target
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
// dense scores
size_t hash = 0;
@ -61,7 +61,7 @@ void DeleteRules::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{}
void DeleteRules::EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -24,13 +24,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;

View File

@ -52,7 +52,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -62,7 +62,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
};
}

View File

@ -88,7 +88,7 @@ void DynamicCacheBasedLanguageModel::SetParameter(const std::string& key, const
void DynamicCacheBasedLanguageModel::EvaluateInIsolation(const Phrase &sp
, const TargetPhrase &tp
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
float score = m_lower_score;
switch(m_query_type) {

View File

@ -132,14 +132,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -151,7 +151,7 @@ public:
virtual void
EvaluateInIsolation(const Phrase &source, const TargetPhrase &targetPhrase,
ScoreComponentCollection& scoreBreakdown,
ScoreComponentCollection& estimatedScore) const = 0;
ScoreComponentCollection& estimatedScores) const = 0;
// for context-dependent processing
static void SetupAll(TranslationTask const& task);
@ -163,13 +163,13 @@ public:
// 'stackVec' is a vector of chart cells that the RHS non-terms cover.
// It is guaranteed to be in the same order as the non-terms in the source phrase.
// For pb models, stackvec is NULL.
// No FF should set estimatedScore in both overloads!
// No FF should set estimatedScores in both overloads!
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const = 0;
, ScoreComponentCollection *estimatedScores = NULL) const = 0;
// This method is called once all the translation options are retrieved from the phrase table, and
// just before search.
@ -177,7 +177,7 @@ public:
// 'stackVec' is a vector of chart cells that the RHS non-terms cover.
// It is guaranteed to be in the same order as the non-terms in the source phrase.
// For pb models, stackvec is NULL.
// No FF should set estimatedScore in both overloads!
// No FF should set estimatedScores in both overloads!
virtual void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const = 0;

View File

@ -171,7 +171,7 @@ float GlobalLexicalModel::GetFromCacheOrScorePhrase( const TargetPhrase& targetP
void GlobalLexicalModel::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
scoreBreakdown.PlusEquals( this, GetFromCacheOrScorePhrase(targetPhrase) );
}

View File

@ -75,7 +75,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const {
@ -89,7 +89,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -90,7 +90,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -100,7 +100,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void AddFeature(ScoreComponentCollection* accumulator,

View File

@ -21,7 +21,7 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
virtual void EvaluateWithSourceContext(const InputType &input
@ -29,7 +29,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
virtual void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -49,7 +49,7 @@ void InputFeature::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
if (m_legacy) {
//binary phrase-table does input feature itself

View File

@ -41,7 +41,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void EvaluateWithSourceContext(const InputType &input
@ -49,7 +49,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -71,7 +71,7 @@ public:
const TargetPhrase &targetPhrase,
const StackVec *stackVec,
ScoreComponentCollection& scoreBreakdown,
ScoreComponentCollection* estimatedScore = NULL) const
ScoreComponentCollection* estimatedScores = NULL) const
{ }
void
@ -83,7 +83,7 @@ public:
EvaluateInIsolation(const Phrase &source,
const TargetPhrase &targetPhrase,
ScoreComponentCollection &scoreBreakdown,
ScoreComponentCollection &estimatedScore) const
ScoreComponentCollection &estimatedScores) const
{ }
bool

View File

@ -30,7 +30,7 @@ MaxSpanFreeNonTermSource::MaxSpanFreeNonTermSource(const std::string &line)
void MaxSpanFreeNonTermSource::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
targetPhrase.SetRuleSource(source);
}
@ -40,7 +40,7 @@ void MaxSpanFreeNonTermSource::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
const Word &targetLHS = targetPhrase.GetTargetLHS();

View File

@ -19,14 +19,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -183,7 +183,7 @@ void Model1Feature::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
const Sentence& sentence = static_cast<const Sentence&>(input);
float score = 0.0;

View File

@ -66,7 +66,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{};
void EvaluateWithSourceContext(const InputType &input
@ -74,7 +74,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const

View File

@ -27,7 +27,7 @@ std::vector<float> NieceTerminal::DefaultWeights() const
void NieceTerminal::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
targetPhrase.SetRuleSource(source);
}
@ -37,7 +37,7 @@ void NieceTerminal::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
assert(stackVec);

View File

@ -22,13 +22,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -45,7 +45,7 @@ void OpSequenceModel::Load()
void OpSequenceModel:: EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
osmHypothesis obj;
@ -82,7 +82,7 @@ void OpSequenceModel:: EvaluateInIsolation(const Phrase &source
obj.computeOSMFeature(startIndex,myBitmap);
obj.calculateOSMProb(*OSM);
obj.populateScores(scores,numFeatures);
estimatedScore.PlusEquals(this, scores);
estimatedScores.PlusEquals(this, scores);
}

View File

@ -42,7 +42,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -52,7 +52,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
virtual const FFState* EmptyHypothesisState(const InputType &input) const;

View File

@ -59,7 +59,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -68,7 +68,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void SetParameter(const std::string& key, const std::string& value);

View File

@ -19,7 +19,7 @@ PhraseLengthFeature::PhraseLengthFeature(const std::string &line)
void PhraseLengthFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
// get length of source and target phrase
size_t targetLength = targetPhrase.GetSize();

View File

@ -36,7 +36,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -45,7 +45,7 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
};

View File

@ -109,7 +109,7 @@ void PhraseOrientationFeature::LoadWordList(const std::string& filename,
void PhraseOrientationFeature::EvaluateInIsolation(const Phrase &source,
const TargetPhrase &targetPhrase,
ScoreComponentCollection &scoreBreakdown,
ScoreComponentCollection &estimatedScore) const
ScoreComponentCollection &estimatedScores) const
{
targetPhrase.SetRuleSource(source);

View File

@ -294,14 +294,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const
, ScoreComponentCollection *estimatedScores = NULL) const
{};
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -118,7 +118,7 @@ void PhrasePairFeature::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
const Phrase& source = inputPath.GetPhrase();
if (m_domainTrigger) {
@ -237,7 +237,7 @@ void PhrasePairFeature::EvaluateWithSourceContext(const InputType &input
void PhrasePairFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
if (m_simple) {
util::StringStream namestr;

View File

@ -52,7 +52,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {
@ -62,7 +62,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const {

View File

@ -18,7 +18,7 @@ PhrasePenalty::PhrasePenalty(const std::string &line)
void PhrasePenalty::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
if (m_perPhraseTable) {
const PhraseDictionary *pt = targetPhrase.GetContainer();

View File

@ -17,7 +17,7 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const {
@ -34,7 +34,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -19,7 +19,7 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
virtual void EvaluateWithSourceContext(const InputType &input
@ -27,7 +27,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -41,7 +41,7 @@ void RulePairUnlexicalizedSource::SetParameter(const std::string& key, const std
void RulePairUnlexicalizedSource::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
const Factor* targetPhraseLHS = targetPhrase.GetTargetLHS()[0];
if ( !m_glueRules && (targetPhraseLHS == m_glueTargetLHS) ) {

View File

@ -24,14 +24,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const
, ScoreComponentCollection *estimatedScores = NULL) const
{}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -23,7 +23,7 @@ bool IsAmbiguous(const Word &word, bool sourceSyntax)
void RuleScope::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
if (IsGlueRule(source)) {
return;
@ -67,12 +67,12 @@ void RuleScope::EvaluateInIsolation(const Phrase &source
scores[score] = 1;
if (m_futureCostOnly) {
estimatedScore.PlusEquals(this, scores);
estimatedScores.PlusEquals(this, scores);
} else {
scoreBreakdown.PlusEquals(this, scores);
}
} else if (m_futureCostOnly) {
estimatedScore.PlusEquals(this, score);
estimatedScores.PlusEquals(this, score);
} else {
scoreBreakdown.PlusEquals(this, score);
}

View File

@ -18,14 +18,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -13,7 +13,7 @@ SetSourcePhrase::SetSourcePhrase(const std::string &line)
void SetSourcePhrase::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
targetPhrase.SetRuleSource(source);
}

View File

@ -18,14 +18,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -18,7 +18,7 @@ SkeletonStatefulFF::SkeletonStatefulFF(const std::string &line)
void SkeletonStatefulFF::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{}
void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input
@ -26,7 +26,7 @@ void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{}
void SkeletonStatefulFF::EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -40,13 +40,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;

View File

@ -16,7 +16,7 @@ SkeletonStatelessFF::SkeletonStatelessFF(const std::string &line)
void SkeletonStatelessFF::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
// dense scores
vector<float> newScores(m_numScoreComponents);
@ -34,7 +34,7 @@ void SkeletonStatelessFF::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
if (targetPhrase.GetNumNonTerminals()) {
vector<float> newScores(m_numScoreComponents);

View File

@ -18,13 +18,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;

View File

@ -25,13 +25,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {};
, ScoreComponentCollection &estimatedScores) const {};
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {};
, ScoreComponentCollection *estimatedScores = NULL) const {};
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -288,7 +288,7 @@ void SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(const Inpu
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
assert(stackVec);

View File

@ -35,7 +35,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
targetPhrase.SetRuleSource(source);
};
@ -44,7 +44,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const

View File

@ -37,7 +37,7 @@ void SourceGHKMTreeInputMatchFeature::EvaluateWithSourceContext(const InputType
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
const Range& range = inputPath.GetWordsRange();
size_t startPos = range.GetStartPos();

View File

@ -20,14 +20,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {};
, ScoreComponentCollection &estimatedScores) const {};
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -64,7 +64,7 @@ bool SourceWordDeletionFeature::IsUseable(const FactorMask &mask) const
void SourceWordDeletionFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignTerm();
ComputeFeatures(source, targetPhrase, &scoreBreakdown, alignmentInfo);

View File

@ -30,13 +30,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -24,7 +24,7 @@ SpanLength::SpanLength(const std::string &line)
void SpanLength::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
targetPhrase.SetRuleSource(source);
}
@ -34,7 +34,7 @@ void SpanLength::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
assert(stackVec);

View File

@ -18,14 +18,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -34,14 +34,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
virtual void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -17,7 +17,7 @@ SyntaxRHS::SyntaxRHS(const std::string &line)
void SyntaxRHS::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
}
@ -26,7 +26,7 @@ void SyntaxRHS::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
assert(stackVec);

View File

@ -18,13 +18,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -53,12 +53,12 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -220,7 +220,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -230,7 +230,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void SetParameter(const std::string& key, const std::string& value);

View File

@ -56,7 +56,7 @@ void TargetWordInsertionFeature::Load()
void TargetWordInsertionFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignTerm();
ComputeFeatures(source, targetPhrase, &scoreBreakdown, alignmentInfo);

View File

@ -30,13 +30,13 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const {

View File

@ -66,13 +66,13 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {};
, ScoreComponentCollection &estimatedScores) const {};
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {};
, ScoreComponentCollection *estimatedScores = NULL) const {};
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {

View File

@ -21,7 +21,7 @@ UnalignedWordCountFeature::UnalignedWordCountFeature(const std::string &line)
void UnalignedWordCountFeature::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignTerm();
const size_t sourceLength = source.GetSize();

View File

@ -19,14 +19,14 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -45,7 +45,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -55,7 +55,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
};

View File

@ -20,7 +20,7 @@ WordPenaltyProducer::WordPenaltyProducer(const std::string &line)
void WordPenaltyProducer::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
float score = - (float) targetPhrase.GetNumTerminals();
scoreBreakdown.Assign(this, score);

View File

@ -30,7 +30,7 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const {
}
@ -45,7 +45,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -142,7 +142,7 @@ void WordTranslationFeature::EvaluateWithSourceContext(const InputType &input
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
const Sentence& sentence = static_cast<const Sentence&>(input);
const AlignmentInfo &alignment = targetPhrase.GetAlignTerm();

View File

@ -47,12 +47,12 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const;
, ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -1,4 +1,4 @@
// $Id$
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
// vim:tabstop=2
/***********************************************************************
Moses - factored phrase-based language decoder
@ -566,11 +566,14 @@ size_t Hypothesis::hash() const
{
size_t seed;
// coverage
// NOTE from Hieu - we could make bitmap comparison here and in operator== compare the pointers since the bitmaps come from a factory.
// Same coverage is guaranteed to have the same bitmap. However, this make the decoding algorithm non-deterministic as the order
// of hypo extension can be different. This causes several regression tests to break. Since the speedup is minimal, I'm gonna leave
// it comparing the actual bitmaps
// coverage NOTE from Hieu - we could make bitmap comparison here
// and in operator== compare the pointers since the bitmaps come
// from a factory. Same coverage is guaranteed to have the same
// bitmap. However, this make the decoding algorithm
// non-deterministic as the order of hypo extension can be
// different. This causes several regression tests to break. Since
// the speedup is minimal, I'm gonna leave it comparing the actual
// bitmaps
seed = m_sourceCompleted.hash();
// states
@ -585,7 +588,7 @@ size_t Hypothesis::hash() const
bool Hypothesis::operator==(const Hypothesis& other) const
{
// coverage
if (m_sourceCompleted != other.m_sourceCompleted) {
if (&m_sourceCompleted != &other.m_sourceCompleted) {
return false;
}
@ -600,57 +603,21 @@ bool Hypothesis::operator==(const Hypothesis& other) const
return true;
}
#ifdef HAVE_XMLRPC_C
void
Hypothesis::
OutputLocalWordAlignment(vector<xmlrpc_c::value>& dest) const
{
using namespace std;
Range const& src = this->GetCurrSourceWordsRange();
Range const& trg = this->GetCurrTargetWordsRange();
WordAlignmentSort waso = m_manager.options().output.WA_SortOrder;
vector<pair<size_t,size_t> const* > a
= this->GetCurrTargetPhrase().GetAlignTerm().GetSortedAlignments(waso);
typedef pair<size_t,size_t> item;
map<string, xmlrpc_c::value> M;
BOOST_FOREACH(item const* p, a) {
M["source-word"] = xmlrpc_c::value_int(src.GetStartPos() + p->first);
M["target-word"] = xmlrpc_c::value_int(trg.GetStartPos() + p->second);
dest.push_back(xmlrpc_c::value_struct(M));
}
}
void
Hypothesis::
OutputWordAlignment(vector<xmlrpc_c::value>& out) const
{
vector<Hypothesis const*> tmp;
for (Hypothesis const* h = this; h; h = h->GetPrevHypo())
tmp.push_back(h);
for (size_t i = tmp.size(); i-- > 0;)
tmp[i]->OutputLocalWordAlignment(out);
}
bool
Hypothesis::
beats(Hypothesis const& b) const
beats(Hypothesis const& b) const
{
if (m_totalScore != b.m_totalScore)
if (m_totalScore != b.m_totalScore)
return m_totalScore > b.m_totalScore;
else if (m_futureScore != b.m_futureScore)
return m_futureScore > b.m_futureScore;
else if (m_prevHypo)
else if (m_prevHypo)
return b.m_prevHypo ? m_prevHypo->beats(*b.m_prevHypo) : true;
else return false;
// TO DO: add more tie breaking here
// results. We should compare other property of the hypos here.
// results. We should compare other property of the hypos here.
// On the other hand, how likely is this going to happen?
}
#endif
}

View File

@ -36,10 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "ScoreComponentCollection.h"
#include "InputType.h"
#include "ObjectPool.h"
#ifdef HAVE_XMLRPC_C
#include <xmlrpc-c/base.hpp>
#endif
#include "xmlrpc-c.h"
namespace Moses
{
@ -276,12 +273,13 @@ public:
bool operator==(const Hypothesis& other) const;
#ifdef HAVE_XMLRPC_C
// these are implemented in moses/server/Hypothesis_4server.cpp !
void OutputWordAlignment(std::vector<xmlrpc_c::value>& out) const;
void OutputLocalWordAlignment(std::vector<xmlrpc_c::value>& dest) const;
#endif
bool beats(Hypothesis const& b) const;
};

View File

@ -72,7 +72,7 @@ void LanguageModel::ReportHistoryOrder(std::ostream &out,const Phrase &phrase) c
void LanguageModel::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const
, ScoreComponentCollection &estimatedScores) const
{
// contains factors used by this LM
float fullScore, nGramScore;
@ -90,10 +90,10 @@ void LanguageModel::EvaluateInIsolation(const Phrase &source
estimateScores[0] = estimateScore;
estimateScores[1] = 0;
estimatedScore.Assign(this, estimateScores);
estimatedScores.Assign(this, estimateScores);
} else {
scoreBreakdown.Assign(this, nGramScore);
estimatedScore.Assign(this, estimateScore);
estimatedScores.Assign(this, estimateScore);
}
}

View File

@ -92,14 +92,14 @@ public:
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const;
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore = NULL) const {
, ScoreComponentCollection *estimatedScores = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input

View File

@ -191,14 +191,14 @@ size_t BilingualLM::getState(const Hypothesis& cur_hypo) const
void BilingualLM::EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {}
, ScoreComponentCollection &estimatedScores) const {}
void BilingualLM::EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const
, ScoreComponentCollection *estimatedScores) const
{
}

View File

@ -123,7 +123,7 @@ public:
const Phrase &source,
const TargetPhrase &targetPhrase,
ScoreComponentCollection &scoreBreakdown,
ScoreComponentCollection &estimatedScore) const;
ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(
const InputType &input,
@ -131,7 +131,7 @@ public:
const TargetPhrase &targetPhrase,
const StackVec *stackVec,
ScoreComponentCollection &scoreBreakdown,
ScoreComponentCollection *estimatedScore = NULL) const;
ScoreComponentCollection *estimatedScores = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {};

View File

@ -100,8 +100,8 @@ Manager::GetSource() const
void Manager::Decode()
{
std::cerr << options().nbest.nbest_size << " "
<< options().nbest.enabled << " " << std::endl;
//std::cerr << options().nbest.nbest_size << " "
// << options().nbest.enabled << " " << std::endl;
// initialize statistics
ResetSentenceStats(m_source);

View File

@ -41,7 +41,7 @@ public:
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScore) const {
, ScoreComponentCollection *estimatedScores) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
@ -50,7 +50,7 @@ public:
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScore) const {
, ScoreComponentCollection &estimatedScores) const {
}
};

View File

@ -189,16 +189,16 @@ void TargetPhrase::EvaluateInIsolation(const Phrase &source, const std::vector<F
{
if (ffs.size()) {
const StaticData &staticData = StaticData::Instance();
ScoreComponentCollection estimatedScore;
ScoreComponentCollection estimatedScores;
for (size_t i = 0; i < ffs.size(); ++i) {
const FeatureFunction &ff = *ffs[i];
if (! staticData.IsFeatureFunctionIgnored( ff )) {
ff.EvaluateInIsolation(source, *this, m_scoreBreakdown, estimatedScore);
ff.EvaluateInIsolation(source, *this, m_scoreBreakdown, estimatedScores);
}
}
float weightedScore = m_scoreBreakdown.GetWeightedScore();
m_estimatedScore += estimatedScore.GetWeightedScore();
m_estimatedScore += estimatedScores.GetWeightedScore();
m_futureScore = weightedScore + m_estimatedScore;
}
}

View File

@ -16,10 +16,10 @@ line_text splitLine(StringPiece textin)
//Get probabilities
output.prob = *it;
it++;
//Get WordAllignment 1
//Get WordAllignment
output.word_all1 = *it;
it++;
//Get WordAllignment 2
//Get count
output.word_all2 = *it;
return output;

View File

@ -811,11 +811,9 @@ namespace Moses
Mmsapt::
setup_bias(ttasksptr const& ttask)
{
// VERBOSE(2,"Setting up bias at " << HERE << std::endl);
SPTR<ContextScope> const& scope = ttask->GetScope();
SPTR<ContextForQuery> context = scope->get<ContextForQuery>(btfix.get(), true);
SPTR<ContextForQuery> context;
context = scope->get<ContextForQuery>(btfix.get(), true);
if (context->bias) return;
// bias weights specified with the session?

View File

@ -90,7 +90,6 @@ namespace Moses
if (!output.update(param)) return false;
return sanity_check();
}
#endif
bool

View File

@ -35,10 +35,7 @@ namespace Moses
AllOptions() {}
AllOptions(Parameter const& param);
#ifdef HAVE_XMLRPC_C
bool update(std::map<std::string,xmlrpc_c::value>const& param);
#endif
bool NBestDistinct() const;
};

View File

@ -18,10 +18,8 @@ namespace Moses
CubePruningOptions(Parameter const& param);
CubePruningOptions() {};
#ifdef HAVE_XMLRPC_C
bool
update(std::map<std::string,xmlrpc_c::value>const& params);
#endif
};
}

View File

@ -24,9 +24,7 @@ struct NBestOptions : public OptionsBaseClass
bool init(Parameter const& param);
#ifdef HAVE_XMLRPC_C
bool update(std::map<std::string,xmlrpc_c::value>const& param);
#endif
};

View File

@ -1,8 +1,7 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
#include "OptionsBaseClass.h"
namespace Moses {
namespace Moses
{
#ifdef HAVE_XMLRPC_C
bool
OptionsBaseClass::
@ -10,7 +9,9 @@ namespace Moses
{
return true;
}
#endif
#ifdef HAVE_XMLRPC_C
bool
OptionsBaseClass::
check(std::map<std::string, xmlrpc_c::value> const& param,
@ -19,7 +20,5 @@ namespace Moses
std::map<std::string, xmlrpc_c::value>::const_iterator m;
return (param.find(key) != param.end());
}
#endif
}

View File

@ -1,8 +1,6 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#pragma once
#ifdef HAVE_XMLRPC_C
#include <xmlrpc-c/base.hpp>
#endif
#include "moses/xmlrpc-c.h"
#include <string>
#include <map>
namespace Moses
@ -12,10 +10,9 @@ namespace Moses
#ifdef HAVE_XMLRPC_C
virtual bool
update(std::map<std::string,xmlrpc_c::value>const& params);
#endif
bool
check(std::map<std::string, xmlrpc_c::value> const& param,
std::string const key);
#endif
};
}

View File

@ -73,10 +73,11 @@ namespace Moses {
#ifdef HAVE_XMLRPC_C
bool
ReportingOptions::
update(std::map<std::string,xmlrpc_c::value>const& param)
update(std::map<std::string, xmlrpc_c::value>const& param)
{
ReportAllFactors = check(param, "report-all-factors");
return true;
}
#endif
}

View File

@ -54,9 +54,8 @@ namespace Moses
}
#ifdef HAVE_XMLRPC_C
bool update(std::map<std::string,xmlrpc_c::value>const& param);
bool update(std::map<std::string, xmlrpc_c::value>const& param);
#endif
};
}

View File

@ -43,10 +43,8 @@ namespace Moses
return early_discarding_threshold != -std::numeric_limits<float>::infinity();
}
#ifdef HAVE_XMLRPC_C
bool
update(std::map<std::string,xmlrpc_c::value>const& params);
#endif
};

View File

@ -0,0 +1,37 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
#include "moses/Hypothesis.h"
#include "moses/Manager.h"
#include <boost/foreach.hpp>
namespace Moses {
void
Hypothesis::
OutputLocalWordAlignment(std::vector<xmlrpc_c::value>& dest) const
{
using namespace std;
Range const& src = this->GetCurrSourceWordsRange();
Range const& trg = this->GetCurrTargetWordsRange();
WordAlignmentSort waso = m_manager.options().output.WA_SortOrder;
vector<pair<size_t,size_t> const* > a
= this->GetCurrTargetPhrase().GetAlignTerm().GetSortedAlignments(waso);
typedef pair<size_t,size_t> item;
map<string, xmlrpc_c::value> M;
BOOST_FOREACH(item const* p, a) {
M["source-word"] = xmlrpc_c::value_int(src.GetStartPos() + p->first);
M["target-word"] = xmlrpc_c::value_int(trg.GetStartPos() + p->second);
dest.push_back(xmlrpc_c::value_struct(M));
}
}
void
Hypothesis::
OutputWordAlignment(std::vector<xmlrpc_c::value>& out) const
{
std::vector<Hypothesis const*> tmp;
for (Hypothesis const* h = this; h; h = h->GetPrevHypo())
tmp.push_back(h);
for (size_t i = tmp.size(); i-- > 0;)
tmp[i]->OutputLocalWordAlignment(out);
}
}

View File

@ -1,5 +1,4 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
#ifdef HAVE_XMLRPC_C
#include "PackScores.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
@ -44,5 +43,3 @@ PackScores(ScoreComponentCollection const& S)
return xmlrpc_c::value_struct(M);
}
}
#endif

View File

@ -1,16 +1,10 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
#ifdef HAVE_XMLRPC_C
#pragma once
#include <xmlrpc-c/base.hpp>
#include "moses/FF/FeatureFunction.h"
#include "moses/ScoreComponentCollection.h"
namespace Moses {
xmlrpc_c::value
PackScores(ScoreComponentCollection const& S);
xmlrpc_c::value
PackScores(ScoreComponentCollection const& S);
}
#endif

Some files were not shown because too many files have changed in this diff Show More