mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Merge branch 'master' of https://github.com/moses-smt/mosesdecoder
This commit is contained in:
commit
b899ab8175
@ -26,16 +26,6 @@
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>Alignment.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/Alignment.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Alignment.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/Alignment.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Hole.h</name>
|
||||
<type>1</type>
|
||||
@ -71,15 +61,20 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/OutputFileStream.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseExtractionOptions.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseExtractionOptions.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/PhraseOrientation.cpp</locationURI>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/PhraseOrientation.h</locationURI>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>SentenceAlignment.cpp</name>
|
||||
|
@ -60,6 +60,21 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/OutputFileStream.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseExtractionOptions.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseExtractionOptions.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>SentenceAlignment.cpp</name>
|
||||
<type>1</type>
|
||||
|
@ -73,8 +73,11 @@
|
||||
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.1815042864" name="SRI.h" rcbsApplicability="disable" resourcePath="LM/SRI.h" toolsToInvoke=""/>
|
||||
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.871386239" name="LDHT.h" rcbsApplicability="disable" resourcePath="LM/LDHT.h" toolsToInvoke=""/>
|
||||
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.1761300858" name="ParallelBackoff.h" rcbsApplicability="disable" resourcePath="LM/ParallelBackoff.h" toolsToInvoke=""/>
|
||||
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1846963597.300346127" name="ptable-lookup.cc" rcbsApplicability="disable" resourcePath="TranslationModel/UG/ptable-lookup.cc" toolsToInvoke="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1729217620.1237671916">
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1729217620.1237671916" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1729217620"/>
|
||||
</fileInfo>
|
||||
<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/UG/util" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="TranslationModel/UG/ptable-lookup.cc|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>
|
||||
|
@ -25,16 +25,6 @@
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>Alignment.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/Alignment.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Alignment.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/Alignment.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>AlignmentInfo.cpp</name>
|
||||
<type>1</type>
|
||||
@ -720,6 +710,16 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/Phrase.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PhraseOrientation.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/PhraseOrientation.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>PrefixTree.h</name>
|
||||
<type>1</type>
|
||||
@ -1170,11 +1170,6 @@
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>extract-ghkm</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>gzfilebuf.h</name>
|
||||
<type>1</type>
|
||||
@ -2330,16 +2325,6 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/bin/lm.log</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>extract-ghkm/PhraseOrientation.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/PhraseOrientation.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>extract-ghkm/PhraseOrientation.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/phrase-extract/extract-ghkm/PhraseOrientation.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>parameters/AllOptions.cpp</name>
|
||||
<type>1</type>
|
||||
@ -2490,6 +2475,16 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/parameters/ServerOptions.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>parameters/SyntaxOptions.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/parameters/SyntaxOptions.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>parameters/SyntaxOptions.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/parameters/SyntaxOptions.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>FF/LexicalReordering/LexicalReordering.cpp</name>
|
||||
<type>1</type>
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
, m_transOptRange(transOptRange) {
|
||||
m_totalWeightDistortion = 0;
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
|
||||
|
||||
const std::vector<const DistortionScoreProducer*> &ffs = DistortionScoreProducer::GetDistortionFeatureFunctions();
|
||||
std::vector<const DistortionScoreProducer*>::const_iterator iter;
|
||||
for (iter = ffs.begin(); iter != ffs.end(); ++iter) {
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
m_options = opts;
|
||||
}
|
||||
|
||||
AllOptions::ptr const&
|
||||
AllOptions::ptr const&
|
||||
options() const {
|
||||
return m_options;
|
||||
}
|
||||
|
@ -569,9 +569,9 @@ void SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(const Inpu
|
||||
}
|
||||
if ( treeInputLabelsLHS.size() == 0 ) {
|
||||
scoreBreakdown.PlusEquals(this,
|
||||
"LHSPAIR_" + targetLHS->GetString().as_string() + "_"
|
||||
+ m_options->syntax.output_default_non_terminal[0]
|
||||
->GetString().as_string(),
|
||||
"LHSPAIR_" + targetLHS->GetString().as_string() + "_"
|
||||
+ m_options->syntax.output_default_non_terminal[0]
|
||||
->GetString().as_string(),
|
||||
1);
|
||||
if (!m_targetSourceLHSJointCountFile.empty()) {
|
||||
t2sLabelsScore = TransformScore(m_floor);
|
||||
|
@ -48,10 +48,10 @@ void SourceGHKMTreeInputMatchFeature::EvaluateWithSourceContext(const InputType
|
||||
|
||||
const StaticData& staticData = StaticData::Instance();
|
||||
|
||||
std::vector<float> newScores(m_numScoreComponents,0.0);
|
||||
std::vector<float> newScores(m_numScoreComponents,0.0);
|
||||
// m_numScoreComponents == 2 // first fires for matches, second for mismatches
|
||||
|
||||
if ( (treeInputLabels.find(lhsLabel) != treeInputLabels.end())
|
||||
if ( (treeInputLabels.find(lhsLabel) != treeInputLabels.end())
|
||||
&& (lhsLabel != m_options->syntax.output_default_non_terminal) ) {
|
||||
// match
|
||||
newScores[0] = 1.0;
|
||||
|
@ -204,7 +204,7 @@ LanguageModelDALM::~LanguageModelDALM()
|
||||
delete m_lm;
|
||||
}
|
||||
|
||||
void LanguageModelDALM::Load(AllOptions const& opts)
|
||||
void LanguageModelDALM::Load(AllOptions::ptr const& opts)
|
||||
{
|
||||
/////////////////////
|
||||
// READING INIFILE //
|
||||
|
@ -96,7 +96,7 @@ bool LanguageModelIRST::IsUseable(const FactorMask &mask) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
void LanguageModelIRST::Load(AllOptions::ptr const& opts)
|
||||
void LanguageModelIRST::Load(AllOptions::ptr const& opts)
|
||||
{
|
||||
FactorCollection &factorCollection = FactorCollection::Instance();
|
||||
|
||||
|
@ -187,7 +187,7 @@ bool ReorderingConstraint::Check( const Bitmap &bitmap, size_t startPos, size_t
|
||||
|
||||
|
||||
// check, if we are setting us up for a dead end due to distortion limits
|
||||
|
||||
|
||||
// size_t distortionLimit = (size_t)StaticData::Instance().GetMaxDistortion();
|
||||
size_t distortionLimit = m_max_distortion;
|
||||
if (startPos != firstGapPos && endZone-firstGapPos >= distortionLimit) {
|
||||
|
@ -57,11 +57,11 @@ protected:
|
||||
public:
|
||||
|
||||
//! create ReorderingConstraint of length size and initialise to zero
|
||||
ReorderingConstraint(int max_distortion)
|
||||
: m_wall(NULL)
|
||||
, m_localWall(NULL)
|
||||
, m_active(false)
|
||||
, m_max_distortion(max_distortion)
|
||||
ReorderingConstraint(int max_distortion)
|
||||
: m_wall(NULL)
|
||||
, m_localWall(NULL)
|
||||
, m_active(false)
|
||||
, m_max_distortion(max_distortion)
|
||||
{}
|
||||
|
||||
//! destructer
|
||||
|
@ -196,7 +196,7 @@ public:
|
||||
}
|
||||
|
||||
AllOptions::ptr const
|
||||
options() const {
|
||||
options() const {
|
||||
return m_options;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ Read(std::istream& in)
|
||||
stringstream strme;
|
||||
strme << line << endl;
|
||||
|
||||
Sentence::Read(strme);
|
||||
Sentence::Read(strme);
|
||||
|
||||
// size input chart
|
||||
size_t sourceSize = GetSize();
|
||||
|
@ -1,105 +0,0 @@
|
||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||
#include "InputOptions.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "moses/StaticData.h"
|
||||
#include "moses/TypeDef.h"
|
||||
|
||||
namespace Moses {
|
||||
|
||||
InputOptions::
|
||||
InputOptions()
|
||||
{
|
||||
xml_brackets.first = "<";
|
||||
xml_brackets.second = ">";
|
||||
input_type = SentenceInput;
|
||||
}
|
||||
|
||||
bool
|
||||
InputOptions::
|
||||
init(Parameter const& param)
|
||||
{
|
||||
param.SetParameter(input_type, "inputtype", SentenceInput);
|
||||
if (input_type == SentenceInput)
|
||||
{ VERBOSE(2, "input type is: text input"); }
|
||||
else if (input_type == ConfusionNetworkInput)
|
||||
{ VERBOSE(2, "input type is: confusion net"); }
|
||||
else if (input_type == WordLatticeInput)
|
||||
{ VERBOSE(2, "input type is: word lattice"); }
|
||||
else if (input_type == TreeInputType)
|
||||
{ VERBOSE(2, "input type is: tree"); }
|
||||
else if (input_type == TabbedSentenceInput)
|
||||
{ VERBOSE(2, "input type is: tabbed sentence"); }
|
||||
else if (input_type == ForestInputType)
|
||||
{ VERBOSE(2, "input type is: forest"); }
|
||||
|
||||
param.SetParameter(continue_partial_translation,
|
||||
"continue-partial-translation", false);
|
||||
param.SetParameter(default_non_term_only_for_empty_range,
|
||||
"default-non-term-for-empty-range-only", false);
|
||||
|
||||
|
||||
param.SetParameter<XmlInputType>(xml_policy, "xml-input", XmlPassThrough);
|
||||
|
||||
// specify XML tags opening and closing brackets for XML option
|
||||
// Do we really want this to be configurable???? UG
|
||||
const PARAM_VEC *pspec;
|
||||
pspec = param.GetParam("xml-brackets");
|
||||
if (pspec && pspec->size())
|
||||
{
|
||||
std::vector<std::string> brackets = Tokenize(pspec->at(0));
|
||||
if(brackets.size()!=2)
|
||||
{
|
||||
std::cerr << "invalid xml-brackets value, "
|
||||
<< "must specify exactly 2 blank-delimited strings "
|
||||
<<<<<<< HEAD
|
||||
<< "for XML tags opening and closing brackets" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
xml_brackets.first= brackets[0];
|
||||
xml_brackets.second=brackets[1];
|
||||
=======
|
||||
<< "for XML tags opening and closing brackets"
|
||||
<< std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
xml_brackets.first= brackets[0];
|
||||
xml_brackets.second=brackets[1];
|
||||
|
||||
>>>>>>> b733804fdcf20a5a9e822861471248c8fdbc0e2d
|
||||
VERBOSE(1,"XML tags opening and closing brackets for XML input are: "
|
||||
<< xml_brackets.first << " and "
|
||||
<< xml_brackets.second << std::endl);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
param.SetParameter(placeholder_factor, "placeholder-factor", NOT_FOUND);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_XMLRPC_C
|
||||
bool
|
||||
InputOptions::
|
||||
update(std::map<std::string,xmlrpc_c::value>const& param)
|
||||
{
|
||||
typedef std::map<std::string, xmlrpc_c::value> params_t;
|
||||
params_t::const_iterator si = param.find("xml-input");
|
||||
if (si != param.end())
|
||||
xml_policy = Scan<XmlInputType>(xmlrpc_c::value_string(si->second));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
=======
|
||||
pspec = param.GetParam("input-factors");
|
||||
if (pspec) factor_order = Scan<FactorType>(*pspec);
|
||||
if (factor_order.empty()) factor_order.assign(1,0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
>>>>>>> b733804fdcf20a5a9e822861471248c8fdbc0e2d
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "moses/Parameter.h"
|
||||
#include <string>
|
||||
#include "OptionsBaseClass.h"
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
struct
|
||||
InputOptions : public OptionsBaseClass
|
||||
{
|
||||
bool continue_partial_translation;
|
||||
bool default_non_term_only_for_empty_range; // whatever that means
|
||||
InputTypeEnum input_type;
|
||||
XmlInputType xml_policy; // pass through, ignore, exclusive, inclusive
|
||||
<<<<<<< HEAD
|
||||
|
||||
FactorType placeholder_factor; // where to store original text for placeholders
|
||||
|
||||
|
||||
=======
|
||||
std::vector<FactorType> factor_order; // input factor order
|
||||
|
||||
>>>>>>> b733804fdcf20a5a9e822861471248c8fdbc0e2d
|
||||
std::pair<std::string,std::string> xml_brackets;
|
||||
// strings to use as XML tags' opening and closing brackets.
|
||||
// Default are "<" and ">"
|
||||
|
||||
InputOptions();
|
||||
|
||||
bool init(Parameter const& param);
|
||||
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user