mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-07-14 14:50:41 +03:00
daily automatic beautifier
This commit is contained in:
parent
8b2f1ba529
commit
dfcdb43c28
@ -237,8 +237,8 @@ void ChartParser::CreateInputPaths(const InputType &input)
|
||||
m_inputPathMatrix.resize(size);
|
||||
|
||||
UTIL_THROW_IF2(input.GetType() != SentenceInput && input.GetType() != TreeInputType,
|
||||
"Input must be a sentence or a tree, " <<
|
||||
"not lattice or confusion networks");
|
||||
"Input must be a sentence or a tree, " <<
|
||||
"not lattice or confusion networks");
|
||||
|
||||
TranslationTask const* ttask = m_ttask.lock().get();
|
||||
for (size_t phaseSize = 1; phaseSize <= size; ++phaseSize) {
|
||||
|
@ -55,8 +55,8 @@ void GlobalLexicalModel::Load(AllOptions::ptr const& opts)
|
||||
{
|
||||
m_options = opts;
|
||||
FactorCollection &factorCollection = FactorCollection::Instance();
|
||||
const std::string& oFactorDelimiter = opts->output.factor_delimiter;
|
||||
const std::string& iFactorDelimiter = opts->input.factor_delimiter;
|
||||
const std::string& oFactorDelimiter = opts->output.factor_delimiter;
|
||||
const std::string& iFactorDelimiter = opts->input.factor_delimiter;
|
||||
|
||||
|
||||
VERBOSE(2, "Loading global lexical model from file " << m_filePath << endl);
|
||||
@ -82,8 +82,8 @@ void GlobalLexicalModel::Load(AllOptions::ptr const& opts)
|
||||
for (size_t i=0 ; i < m_outputFactorsVec.size() ; i++) {
|
||||
const FactorDirection& direction = Output;
|
||||
const FactorType& factorType = m_outputFactorsVec[i];
|
||||
const Factor* factor
|
||||
= factorCollection.AddFactor( direction, factorType, factorString[i] );
|
||||
const Factor* factor
|
||||
= factorCollection.AddFactor( direction, factorType, factorString[i] );
|
||||
outWord->SetFactor( factorType, factor );
|
||||
}
|
||||
|
||||
@ -93,8 +93,8 @@ void GlobalLexicalModel::Load(AllOptions::ptr const& opts)
|
||||
for (size_t i=0 ; i < m_inputFactorsVec.size() ; i++) {
|
||||
const FactorDirection& direction = Input;
|
||||
const FactorType& factorType = m_inputFactorsVec[i];
|
||||
const Factor* factor
|
||||
= factorCollection.AddFactor( direction, factorType, factorString[i] );
|
||||
const Factor* factor
|
||||
= factorCollection.AddFactor( direction, factorType, factorString[i] );
|
||||
inWord->SetFactor( factorType, factor );
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
|
||||
public:
|
||||
// ttaskwptr const ttask;
|
||||
TranslationTask const* ttask;
|
||||
TranslationTask const* ttask;
|
||||
protected:
|
||||
const InputPath *m_prevPath;
|
||||
Phrase m_phrase;
|
||||
|
@ -135,8 +135,8 @@ PDTAimp::GetTargetPhraseCollection(Phrase const &src) const
|
||||
targetPhrase.GetScoreBreakdown().Assign(m_obj, *cands[i].fnames[j], cands[i].fvalues[j]);
|
||||
}
|
||||
|
||||
CreateTargetPhrase(targetPhrase,factorStrings, fd, scoreVector, Scores(0),
|
||||
&wacands[i], &src);
|
||||
CreateTargetPhrase(targetPhrase,factorStrings, fd, scoreVector, Scores(0),
|
||||
&wacands[i], &src);
|
||||
|
||||
costs.push_back(std::make_pair(-targetPhrase.GetFutureScore(),tCands.size()));
|
||||
tCands.push_back(targetPhrase);
|
||||
@ -377,7 +377,7 @@ void PDTAimp::CacheSource(ConfusionNet const& src)
|
||||
TargetPhrase targetPhrase(m_obj);
|
||||
CreateTargetPhrase(targetPhrase
|
||||
, j ->first
|
||||
, m_obj->options()->output.factor_delimiter
|
||||
, m_obj->options()->output.factor_delimiter
|
||||
, scores.transScore
|
||||
, scores.inputScores
|
||||
, NULL
|
||||
@ -406,7 +406,7 @@ void PDTAimp::CacheSource(ConfusionNet const& src)
|
||||
|
||||
void PDTAimp::CreateTargetPhrase(TargetPhrase& targetPhrase,
|
||||
StringTgtCand::Tokens const& factorStrings,
|
||||
std::string const& factorDelimiter,
|
||||
std::string const& factorDelimiter,
|
||||
Scores const& transVector,
|
||||
Scores const& inputVector,
|
||||
const std::string *alignmentString,
|
||||
@ -415,8 +415,8 @@ void PDTAimp::CreateTargetPhrase(TargetPhrase& targetPhrase,
|
||||
FactorCollection &factorCollection = FactorCollection::Instance();
|
||||
|
||||
for(size_t k=0; k<factorStrings.size(); ++k) {
|
||||
util::TokenIter<util::MultiCharacter, false>
|
||||
word(*factorStrings[k], factorDelimiter);
|
||||
util::TokenIter<util::MultiCharacter, false>
|
||||
word(*factorStrings[k], factorDelimiter);
|
||||
Word& w=targetPhrase.AddWord();
|
||||
for(size_t l=0; l<m_output.size(); ++l, ++word) {
|
||||
w[m_output[l]]= factorCollection.AddFactor(*word);
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
|
||||
void CreateTargetPhrase(TargetPhrase& targetPhrase,
|
||||
StringTgtCand::Tokens const& factorStrings,
|
||||
std::string const& factorDelimiter,
|
||||
std::string const& factorDelimiter,
|
||||
Scores const& transVector,
|
||||
Scores const& inputVector,
|
||||
const std::string *alignmentString,
|
||||
|
@ -27,7 +27,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
CompletedRuleCollection::CompletedRuleCollection(size_t rule_limit)
|
||||
CompletedRuleCollection::CompletedRuleCollection(size_t rule_limit)
|
||||
: m_ruleLimit(rule_limit)
|
||||
{
|
||||
m_scoreThreshold = numeric_limits<float>::infinity();
|
||||
|
@ -144,10 +144,10 @@ TargetPhraseCollection::shared_ptr PhraseDictionaryMultiModelCounts::GetTargetPh
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
PhraseDictionaryMultiModelCounts::
|
||||
CollectSufficientStats(const Phrase& src, vector<float> &fs,
|
||||
map<string,multiModelCountsStats*>* allStats) const
|
||||
CollectSufficientStats(const Phrase& src, vector<float> &fs,
|
||||
map<string,multiModelCountsStats*>* allStats) const
|
||||
//fill fs and allStats with statistics from models
|
||||
{
|
||||
for(size_t i = 0; i < m_numModels; ++i) {
|
||||
|
@ -63,10 +63,10 @@ TranslationOptionCollectionConfusionNet(ttasksptr const& ttask,
|
||||
const ScorePair &scores = col[i].second;
|
||||
ScorePair *inputScore = new ScorePair(scores);
|
||||
|
||||
InputPath* path = new InputPath(ttask.get(), subphrase, labels,
|
||||
InputPath* path = new InputPath(ttask.get(), subphrase, labels,
|
||||
range, NULL, inputScore);
|
||||
list.push_back(path);
|
||||
|
||||
|
||||
m_inputPathQueue.push_back(path);
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,7 @@ TranslationOptionCollectionConfusionNet(ttasksptr const& ttask,
|
||||
ScorePair *inputScore = new ScorePair(*prevInputScore);
|
||||
inputScore->PlusEquals(scores);
|
||||
|
||||
InputPath *path = new InputPath(ttask.get(), subphrase, labels, range,
|
||||
InputPath *path = new InputPath(ttask.get(), subphrase, labels, range,
|
||||
&prevPath, inputScore);
|
||||
list.push_back(path);
|
||||
|
||||
|
@ -65,7 +65,7 @@ TranslationOptionCollectionLattice
|
||||
ScorePair *inputScore = new ScorePair(scores);
|
||||
|
||||
InputPath *path
|
||||
= new InputPath(ttask.get(), subphrase, labels, range, NULL, inputScore);
|
||||
= new InputPath(ttask.get(), subphrase, labels, range, NULL, inputScore);
|
||||
|
||||
path->SetNextNode(nextNode);
|
||||
m_inputPathQueue.push_back(path);
|
||||
|
@ -213,8 +213,8 @@ TO_STRING_BODY(Word);
|
||||
ostream& operator<<(ostream& out, const Word& word)
|
||||
{
|
||||
util::StringStream strme;
|
||||
const std::string& factorDelimiter
|
||||
= StaticData::Instance().options()->output.factor_delimiter;
|
||||
const std::string& factorDelimiter
|
||||
= StaticData::Instance().options()->output.factor_delimiter;
|
||||
bool firstPass = true;
|
||||
unsigned int stop = max_fax();
|
||||
for (unsigned int currFactor = 0 ; currFactor < stop; currFactor++) {
|
||||
|
Loading…
Reference in New Issue
Block a user