mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +03:00
daily automatic beautifier
This commit is contained in:
parent
8424fb6e2a
commit
f38976aba0
@ -202,8 +202,8 @@ int main(int argc, char* argv[])
|
||||
<< " ||| ";
|
||||
vector<Word> mbrBestHypo = doLatticeMBR(manager,nBestList);
|
||||
manager.OutputBestHypo(mbrBestHypo, lineCount,
|
||||
manager.options().output.ReportSegmentation,
|
||||
manager.options().output.ReportAllFactors,
|
||||
manager.options().output.ReportSegmentation,
|
||||
manager.options().output.ReportAllFactors,
|
||||
cout);
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ std::set<size_t> AlignmentInfo::GetAlignmentsForTarget(size_t targetPos) const
|
||||
|
||||
bool
|
||||
compare_target(std::pair<size_t,size_t> const* a,
|
||||
std::pair<size_t,size_t> const* b)
|
||||
std::pair<size_t,size_t> const* b)
|
||||
{
|
||||
if(a->second < b->second) return true;
|
||||
if(a->second == b->second) return (a->first < b->first);
|
||||
@ -138,7 +138,7 @@ GetSortedAlignments(WordAlignmentSort SortOrder) const
|
||||
|
||||
default:
|
||||
UTIL_THROW(util::Exception, "Unknown word alignment sort option: "
|
||||
<< SortOrder);
|
||||
<< SortOrder);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -65,12 +65,11 @@ bool ChartCell::AddHypothesis(ChartHypothesis *hypo)
|
||||
{
|
||||
const Word &targetLHS = hypo->GetTargetLHS();
|
||||
MapType::iterator m = m_hypoColl.find(targetLHS);
|
||||
if (m == m_hypoColl.end())
|
||||
{
|
||||
std::pair<Word, ChartHypothesisCollection>
|
||||
e(targetLHS, ChartHypothesisCollection(m_manager.options()));
|
||||
m = m_hypoColl.insert(e).first;
|
||||
}
|
||||
if (m == m_hypoColl.end()) {
|
||||
std::pair<Word, ChartHypothesisCollection>
|
||||
e(targetLHS, ChartHypothesisCollection(m_manager.options()));
|
||||
m = m_hypoColl.insert(e).first;
|
||||
}
|
||||
return m->second.AddHypothesis(hypo, m_manager);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
class ChartSearchGraphWriter;
|
||||
class AllOptions;
|
||||
class AllOptions;
|
||||
|
||||
//! functor to compare (chart) hypotheses by (descending) score
|
||||
class ChartHypothesisScoreOrderer
|
||||
|
@ -109,11 +109,11 @@ void ChartParserUnknown::Process(const Word &sourceWord, const Range &range, Cha
|
||||
|
||||
AllOptions const& opts = staticData.options();
|
||||
if (!opts.output.detailed_tree_transrep_filepath.empty() ||
|
||||
opts.nbest.print_trees || staticData.GetTreeStructure() != NULL) {
|
||||
std::string prop = "[ ";
|
||||
prop += (*targetLHS)[0]->GetString().as_string() + " ";
|
||||
prop += sourceWord[0]->GetString().as_string() + " ]";
|
||||
targetPhrase->SetProperty("Tree", prop);
|
||||
opts.nbest.print_trees || staticData.GetTreeStructure() != NULL) {
|
||||
std::string prop = "[ ";
|
||||
prop += (*targetLHS)[0]->GetString().as_string() + " ";
|
||||
prop += sourceWord[0]->GetString().as_string() + " ]";
|
||||
targetPhrase->SetProperty("Tree", prop);
|
||||
}
|
||||
|
||||
// chart rule
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
virtual void Print(std::ostream&) const;
|
||||
|
||||
int Read(std::istream& in,const std::vector<FactorType>& factorOrder,
|
||||
AllOptions const& opts);
|
||||
AllOptions const& opts);
|
||||
|
||||
Phrase GetSubString(const Range&) const; //TODO not defined
|
||||
std::string GetStringRep(const std::vector<FactorType> factorsToPrint) const; //TODO not defined
|
||||
|
@ -103,11 +103,11 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO
|
||||
void
|
||||
DecodeStepTranslation::
|
||||
ProcessInitialTranslation(InputType const& source,
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPath const& inputPath,
|
||||
TargetPhraseCollection::shared_ptr phraseColl) const
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPath const& inputPath,
|
||||
TargetPhraseCollection::shared_ptr phraseColl) const
|
||||
{
|
||||
const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature();
|
||||
const size_t tableLimit = phraseDictionary->GetTableLimit();
|
||||
@ -118,7 +118,7 @@ ProcessInitialTranslation(InputType const& source,
|
||||
IFVERBOSE(3) {
|
||||
if(source.GetType() == SentenceInput)
|
||||
TRACE_ERR("[" << source.GetSubString(range) << "; "
|
||||
<< startPos << "-" << endPos << "]\n");
|
||||
<< startPos << "-" << endPos << "]\n");
|
||||
else
|
||||
TRACE_ERR("[" << startPos << "-" << endPos << "]" << std::endl);
|
||||
}
|
||||
@ -143,10 +143,10 @@ ProcessInitialTranslation(InputType const& source,
|
||||
void
|
||||
DecodeStepTranslation::
|
||||
ProcessInitialTransLEGACY(InputType const& source,
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPathList const& inputPathList) const
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPathList const& inputPathList) const
|
||||
{
|
||||
const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature();
|
||||
const size_t tableLimit = phraseDictionary->GetTableLimit();
|
||||
@ -159,7 +159,7 @@ ProcessInitialTransLEGACY(InputType const& source,
|
||||
IFVERBOSE(3) {
|
||||
if(source.GetType() == SentenceInput)
|
||||
TRACE_ERR("[" << source.GetSubString(range) << "; "
|
||||
<< startPos << "-" << endPos << "]\n");
|
||||
<< startPos << "-" << endPos << "]\n");
|
||||
else
|
||||
TRACE_ERR("[" << startPos << "-" << endPos << "]" << std::endl);
|
||||
}
|
||||
|
@ -63,10 +63,10 @@ public:
|
||||
// legacy
|
||||
void
|
||||
ProcessInitialTransLEGACY(InputType const& source,
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPathList const& inputPathList) const;
|
||||
PartialTranslOptColl &outputPartialTranslOptColl,
|
||||
size_t startPos, size_t endPos,
|
||||
bool adhereTableLimit,
|
||||
InputPathList const& inputPathList) const;
|
||||
|
||||
void ProcessLEGACY(const TranslationOption &inputPartialTranslOpt
|
||||
, const DecodeStep &decodeStep
|
||||
|
@ -388,8 +388,8 @@ OutputAlignment(std::ostream &out) const
|
||||
void
|
||||
Hypothesis::
|
||||
OutputAlignment(ostream &out,
|
||||
vector<const Hypothesis *> const& edges,
|
||||
WordAlignmentSort waso)
|
||||
vector<const Hypothesis *> const& edges,
|
||||
WordAlignmentSort waso)
|
||||
{
|
||||
size_t targetOffset = 0;
|
||||
|
||||
@ -409,7 +409,7 @@ void
|
||||
Hypothesis::
|
||||
OutputAlignment(ostream &out, const AlignmentInfo &ai,
|
||||
size_t sourceOffset, size_t targetOffset,
|
||||
WordAlignmentSort waso)
|
||||
WordAlignmentSort waso)
|
||||
{
|
||||
typedef std::vector< const std::pair<size_t,size_t>* > AlignVec;
|
||||
AlignVec alignments = ai.GetSortedAlignments(waso);
|
||||
@ -418,7 +418,7 @@ OutputAlignment(ostream &out, const AlignmentInfo &ai,
|
||||
for (it = alignments.begin(); it != alignments.end(); ++it) {
|
||||
const std::pair<size_t,size_t> &alignment = **it;
|
||||
out << alignment.first + sourceOffset << "-"
|
||||
<< alignment.second + targetOffset << " ";
|
||||
<< alignment.second + targetOffset << " ";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -256,13 +256,13 @@ public:
|
||||
|
||||
static void
|
||||
OutputAlignment(std::ostream &out,
|
||||
const std::vector<const Hypothesis *> &edges,
|
||||
WordAlignmentSort waso);
|
||||
const std::vector<const Hypothesis *> &edges,
|
||||
WordAlignmentSort waso);
|
||||
|
||||
static void
|
||||
OutputAlignment(std::ostream &out, const Moses::AlignmentInfo &ai,
|
||||
size_t sourceOffset, size_t targetOffset,
|
||||
WordAlignmentSort waso);
|
||||
size_t sourceOffset, size_t targetOffset,
|
||||
WordAlignmentSort waso);
|
||||
|
||||
void OutputInput(std::ostream& os) const;
|
||||
static void OutputInput(std::vector<const Phrase*>& map, const Hypothesis* hypo);
|
||||
|
@ -323,12 +323,12 @@ void Manager::OutputNBest(OutputCollector *collector) const
|
||||
void
|
||||
Manager::
|
||||
OutputNBestList(OutputCollector *collector,
|
||||
std::vector<search::Applied> const& nbest,
|
||||
long translationId) const
|
||||
std::vector<search::Applied> const& nbest,
|
||||
long translationId) const
|
||||
{
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
const std::vector<Moses::FactorType> &outputFactorOrder
|
||||
= staticData.GetOutputFactorOrder();
|
||||
= staticData.GetOutputFactorOrder();
|
||||
|
||||
std::ostringstream out;
|
||||
// wtf? copied from the original OutputNBestList
|
||||
@ -343,7 +343,7 @@ OutputNBestList(OutputCollector *collector,
|
||||
// <s> and </s>
|
||||
UTIL_THROW_IF2(outputPhrase.GetSize() < 2,
|
||||
"Output phrase should have contained at least 2 words "
|
||||
<< "(beginning and end-of-sentence)");
|
||||
<< "(beginning and end-of-sentence)");
|
||||
|
||||
outputPhrase.RemoveWord(0);
|
||||
outputPhrase.RemoveWord(outputPhrase.GetSize() - 1);
|
||||
|
@ -97,11 +97,11 @@ public:
|
||||
virtual void CalcScore(const Phrase &phrase, float &fullScore, float &ngramScore, size_t &oovCount) const;
|
||||
|
||||
virtual FFState *EvaluateWhenApplied(const Hypothesis &hypo, const FFState *ps, ScoreComponentCollection *out) const;
|
||||
/*
|
||||
virtual FFState *EvaluateWhenApplied(const ChartHypothesis& cur_hypo, int featureID, ScoreComponentCollection *accumulator) const;
|
||||
/*
|
||||
virtual FFState *EvaluateWhenApplied(const ChartHypothesis& cur_hypo, int featureID, ScoreComponentCollection *accumulator) const;
|
||||
|
||||
virtual FFState *EvaluateWhenApplied(const Syntax::SHyperedge& hyperedge, int featureID, ScoreComponentCollection *accumulator) const;
|
||||
*/
|
||||
virtual FFState *EvaluateWhenApplied(const Syntax::SHyperedge& hyperedge, int featureID, ScoreComponentCollection *accumulator) const;
|
||||
*/
|
||||
|
||||
void InitializeForInput(ttasksptr const& ttask);
|
||||
void CleanUpAfterSentenceProcessing(const InputType& source);
|
||||
|
@ -101,7 +101,7 @@ void Manager::Decode()
|
||||
{
|
||||
|
||||
std::cerr << options().nbest.nbest_size << " "
|
||||
<< options().nbest.enabled << " " << std::endl;
|
||||
<< options().nbest.enabled << " " << std::endl;
|
||||
|
||||
// initialize statistics
|
||||
ResetSentenceStats(m_source);
|
||||
@ -129,7 +129,7 @@ void Manager::Decode()
|
||||
IFVERBOSE(1) {
|
||||
GetSentenceStats().StopTimeCollectOpts();
|
||||
TRACE_ERR("Line "<< m_source.GetTranslationId()
|
||||
<< ": Collecting options took "
|
||||
<< ": Collecting options took "
|
||||
<< GetSentenceStats().GetTimeCollectOpts() << " seconds at "
|
||||
<< __FILE__ << ":" << __LINE__ << endl);
|
||||
}
|
||||
@ -1120,8 +1120,8 @@ void Manager::OutputSearchGraphAsSLF(long translationId, std::ostream &outputSea
|
||||
|
||||
void
|
||||
OutputSearchNode(AllOptions const& opts, long translationId,
|
||||
std::ostream &outputSearchGraphStream,
|
||||
SearchGraphNode const& searchNode)
|
||||
std::ostream &outputSearchGraphStream,
|
||||
SearchGraphNode const& searchNode)
|
||||
{
|
||||
const vector<FactorType> &outputFactorOrder = StaticData::Instance().GetOutputFactorOrder();
|
||||
bool extendedFormat = opts.output.SearchGraphExtended.size();
|
||||
@ -1402,7 +1402,7 @@ GetForwardBackwardSearchGraph
|
||||
std::map < int, double > forwardScore;
|
||||
|
||||
std::map < const Hypothesis*, set <const Hypothesis*> > & outgoingHyps
|
||||
= *pOutgoingHyps;
|
||||
= *pOutgoingHyps;
|
||||
vector< float> & estimatedScores = *pFwdBwdScores;
|
||||
|
||||
// *** find connected hypotheses ***
|
||||
@ -1412,7 +1412,7 @@ GetForwardBackwardSearchGraph
|
||||
|
||||
// forward cost of hypotheses on final stack is 0
|
||||
const std::vector < HypothesisStack* > &hypoStackColl
|
||||
= m_search->GetHypothesisStacks();
|
||||
= m_search->GetHypothesisStacks();
|
||||
const HypothesisStack &finalStack = *hypoStackColl.back();
|
||||
HypothesisStack::const_iterator iterHypo;
|
||||
for (iterHypo = finalStack.begin() ; iterHypo != finalStack.end() ; ++iterHypo) {
|
||||
@ -1531,12 +1531,12 @@ void Manager::OutputBest(OutputCollector *collector) const
|
||||
|
||||
// const PARAM_VEC *params = staticData.GetParameter().GetParam("print-id");
|
||||
if (options().output.PrintID) {
|
||||
out << translationId << " ";
|
||||
}
|
||||
out << translationId << " ";
|
||||
}
|
||||
|
||||
// VN : I put back the code for OutputPassthroughInformation
|
||||
if (options().output.PrintPassThrough) {
|
||||
OutputPassthroughInformation(out, bestHypo);
|
||||
// VN : I put back the code for OutputPassthroughInformation
|
||||
if (options().output.PrintPassThrough) {
|
||||
OutputPassthroughInformation(out, bestHypo);
|
||||
}
|
||||
// end of add back
|
||||
|
||||
@ -1590,7 +1590,7 @@ void Manager::OutputBest(OutputCollector *collector) const
|
||||
//Lattice MBR decoding
|
||||
vector<Word> mbrBestHypo = doLatticeMBR(*this,nBestList);
|
||||
OutputBestHypo(mbrBestHypo, translationId,
|
||||
options().output.ReportSegmentation,
|
||||
options().output.ReportSegmentation,
|
||||
options().output.ReportAllFactors, out);
|
||||
IFVERBOSE(2) {
|
||||
PrintUserTime("finished Lattice MBR decoding");
|
||||
@ -1614,7 +1614,7 @@ void Manager::OutputBest(OutputCollector *collector) const
|
||||
else {
|
||||
const TrellisPath &mbrBestHypo = doMBR(nBestList);
|
||||
OutputBestHypo(mbrBestHypo, translationId,
|
||||
options().output.ReportSegmentation,
|
||||
options().output.ReportSegmentation,
|
||||
options().output.ReportAllFactors, out);
|
||||
OutputAlignment(m_alignmentOut, mbrBestHypo);
|
||||
IFVERBOSE(2) {
|
||||
@ -1651,7 +1651,7 @@ void Manager::OutputNBest(OutputCollector *collector) const
|
||||
CalcNBest(options().nbest.nbest_size, nBestList,
|
||||
options().nbest.only_distinct);
|
||||
OutputNBest(out, nBestList,
|
||||
staticData.GetOutputFactorOrder(),
|
||||
staticData.GetOutputFactorOrder(),
|
||||
m_source.GetTranslationId(),
|
||||
options().output.ReportSegmentation);
|
||||
collector->Write(m_source.GetTranslationId(), out.str());
|
||||
@ -1662,9 +1662,9 @@ void Manager::OutputNBest(OutputCollector *collector) const
|
||||
void
|
||||
Manager::
|
||||
OutputNBest(std::ostream& out,
|
||||
const Moses::TrellisPathList &nBestList,
|
||||
const std::vector<Moses::FactorType>& outputFactorOrder,
|
||||
long translationId, char reportSegmentation) const
|
||||
const Moses::TrellisPathList &nBestList,
|
||||
const std::vector<Moses::FactorType>& outputFactorOrder,
|
||||
long translationId, char reportSegmentation) const
|
||||
{
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
NBestOptions const& nbo = options().nbest;
|
||||
@ -1682,7 +1682,7 @@ OutputNBest(std::ostream& out,
|
||||
for (int currEdge = (int)edges.size() - 1 ; currEdge >= 0 ; currEdge--) {
|
||||
const Hypothesis &edge = *edges[currEdge];
|
||||
OutputSurface(out, edge, outputFactorOrder, reportSegmentation,
|
||||
reportAllFactors);
|
||||
reportAllFactors);
|
||||
}
|
||||
out << " |||";
|
||||
|
||||
@ -1744,8 +1744,8 @@ OutputNBest(std::ostream& out,
|
||||
void
|
||||
Manager::
|
||||
OutputSurface(std::ostream &out, const Hypothesis &edge,
|
||||
const std::vector<FactorType> &outputFactorOrder,
|
||||
char reportSegmentation, bool reportAllFactors) const
|
||||
const std::vector<FactorType> &outputFactorOrder,
|
||||
char reportSegmentation, bool reportAllFactors) const
|
||||
{
|
||||
UTIL_THROW_IF2(outputFactorOrder.size() == 0,
|
||||
"Must specific at least 1 output factor");
|
||||
@ -1823,7 +1823,7 @@ OutputSurface(std::ostream &out, const Hypothesis &edge,
|
||||
void
|
||||
Manager::
|
||||
OutputAlignment(ostream &out, const AlignmentInfo &ai,
|
||||
size_t sourceOffset, size_t targetOffset) const
|
||||
size_t sourceOffset, size_t targetOffset) const
|
||||
{
|
||||
typedef std::vector< const std::pair<size_t,size_t>* > AlignVec;
|
||||
AlignVec alignments = ai.GetSortedAlignments(options().output.WA_SortOrder);
|
||||
@ -1832,7 +1832,7 @@ OutputAlignment(ostream &out, const AlignmentInfo &ai,
|
||||
for (it = alignments.begin(); it != alignments.end(); ++it) {
|
||||
const std::pair<size_t,size_t> &alignment = **it;
|
||||
out << alignment.first + sourceOffset << "-"
|
||||
<< alignment.second + targetOffset << " ";
|
||||
<< alignment.second + targetOffset << " ";
|
||||
}
|
||||
|
||||
}
|
||||
@ -1884,8 +1884,8 @@ void Manager::OutputLatticeSamples(OutputCollector *collector) const
|
||||
ostringstream out;
|
||||
CalcLatticeSamples(staticData.GetLatticeSamplesSize(), latticeSamples);
|
||||
OutputNBest(out,latticeSamples,
|
||||
staticData.GetOutputFactorOrder(),
|
||||
m_source.GetTranslationId(),
|
||||
staticData.GetOutputFactorOrder(),
|
||||
m_source.GetTranslationId(),
|
||||
options().output.ReportSegmentation);
|
||||
collector->Write(m_source.GetTranslationId(), out.str());
|
||||
}
|
||||
@ -2078,8 +2078,8 @@ void Manager::OutputBestHypo(const std::vector<Word>& mbrBestHypo, long /*trans
|
||||
void
|
||||
Manager::
|
||||
OutputBestHypo(const Moses::TrellisPath &path, long /*translationId*/,
|
||||
char reportSegmentation, bool reportAllFactors,
|
||||
std::ostream &out) const
|
||||
char reportSegmentation, bool reportAllFactors,
|
||||
std::ostream &out) const
|
||||
{
|
||||
const std::vector<const Hypothesis *> &edges = path.GetEdges();
|
||||
|
||||
|
@ -131,7 +131,7 @@ protected:
|
||||
// nbest
|
||||
mutable std::ostringstream m_latticeNBestOut;
|
||||
mutable std::ostringstream m_alignmentOut;
|
||||
public:
|
||||
public:
|
||||
void OutputNBest(std::ostream& out
|
||||
, const Moses::TrellisPathList &nBestList
|
||||
, const std::vector<Moses::FactorType>& outputFactorOrder
|
||||
|
@ -46,12 +46,12 @@ MockHypothesisGuard
|
||||
|
||||
//Initial empty hypothesis
|
||||
Bitmaps bitmaps(m_sentence.get()->GetSize(),
|
||||
m_sentence.get()->m_sourceCompleted);
|
||||
m_sentence.get()->m_sourceCompleted);
|
||||
m_manager->ResetSentenceStats(*m_sentence);
|
||||
|
||||
const Bitmap &initBitmap = bitmaps.GetInitialBitmap();
|
||||
m_hypothesis = new Hypothesis(*m_manager, *m_sentence, m_initialTransOpt,
|
||||
initBitmap);
|
||||
initBitmap);
|
||||
|
||||
//create the chain
|
||||
vector<Alignment>::const_iterator ai = alignments.begin();
|
||||
@ -60,7 +60,7 @@ MockHypothesisGuard
|
||||
Hypothesis* prevHypo = m_hypothesis;
|
||||
Range range(ai->first,ai->second);
|
||||
const Bitmap &newBitmap = bitmaps.GetBitmap(prevHypo->GetWordsBitmap(),
|
||||
range);
|
||||
range);
|
||||
|
||||
m_targetPhrases.push_back(TargetPhrase(NULL));
|
||||
// m_targetPhrases.back().CreateFromString(Input, factors, *ti, "|", NULL);
|
||||
|
@ -155,11 +155,10 @@ public:
|
||||
// issues a warning if format is wrong
|
||||
const PARAM_VEC *params = GetParam(name);
|
||||
val = (params && params->size());
|
||||
if (val && params->size() != 1)
|
||||
{
|
||||
TRACE_ERR("ERROR: wrong format for switch -" << name);
|
||||
return false;
|
||||
}
|
||||
if (val && params->size() != 1) {
|
||||
TRACE_ERR("ERROR: wrong format for switch -" << name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ OutputAllFeatureScores(std::ostream &out, bool with_labels) const
|
||||
{
|
||||
std::string lastName = "";
|
||||
const vector<const StatefulFeatureFunction*>& sff
|
||||
= StatefulFeatureFunction::GetStatefulFeatureFunctions();
|
||||
= StatefulFeatureFunction::GetStatefulFeatureFunctions();
|
||||
for( size_t i=0; i<sff.size(); i++ ) {
|
||||
const StatefulFeatureFunction *ff = sff[i];
|
||||
if (ff->IsTuneable()) {
|
||||
@ -321,7 +321,7 @@ OutputAllFeatureScores(std::ostream &out, bool with_labels) const
|
||||
}
|
||||
}
|
||||
const vector<const StatelessFeatureFunction*>& slf
|
||||
= StatelessFeatureFunction::GetStatelessFeatureFunctions();
|
||||
= StatelessFeatureFunction::GetStatelessFeatureFunctions();
|
||||
for( size_t i=0; i<slf.size(); i++ ) {
|
||||
const StatelessFeatureFunction *ff = slf[i];
|
||||
if (ff->IsTuneable()) {
|
||||
@ -333,7 +333,7 @@ OutputAllFeatureScores(std::ostream &out, bool with_labels) const
|
||||
void
|
||||
ScoreComponentCollection::
|
||||
OutputFeatureScores(std::ostream& out, FeatureFunction const* ff,
|
||||
std::string &lastName, bool with_labels) const
|
||||
std::string &lastName, bool with_labels) const
|
||||
{
|
||||
// const StaticData &staticData = StaticData::Instance();
|
||||
// bool labeledOutput = staticData.options().nbest.include_feature_labels;
|
||||
|
@ -433,7 +433,7 @@ public:
|
||||
|
||||
void OutputAllFeatureScores(std::ostream &out, bool with_labels) const;
|
||||
void OutputFeatureScores(std::ostream& out, Moses::FeatureFunction const* ff,
|
||||
std::string &lastName, bool with_labels) const;
|
||||
std::string &lastName, bool with_labels) const;
|
||||
|
||||
#ifdef MPI_ENABLE
|
||||
public:
|
||||
|
@ -371,8 +371,8 @@ CreateFromString(vector<FactorType> const& FOrder, string const& phraseString)
|
||||
|
||||
Sentence::
|
||||
Sentence(size_t const transId,
|
||||
string const& stext,
|
||||
AllOptions const& opts,
|
||||
string const& stext,
|
||||
AllOptions const& opts,
|
||||
vector<FactorType> const* IFO)
|
||||
: InputType(transId)
|
||||
{
|
||||
|
@ -65,8 +65,8 @@ protected:
|
||||
public:
|
||||
Sentence();
|
||||
Sentence(size_t const transId, std::string const& stext,
|
||||
AllOptions const& opts,
|
||||
std::vector<FactorType> const* IFO = NULL);
|
||||
AllOptions const& opts,
|
||||
std::vector<FactorType> const* IFO = NULL);
|
||||
// Sentence(size_t const transId, std::string const& stext);
|
||||
~Sentence();
|
||||
|
||||
|
@ -63,7 +63,7 @@ StaticData StaticData::s_instance;
|
||||
StaticData::StaticData()
|
||||
: m_sourceStartPosMattersForRecombination(false)
|
||||
, m_requireSortingAfterSourceContext(false)
|
||||
// , m_inputType(SentenceInput)
|
||||
// , m_inputType(SentenceInput)
|
||||
, m_lmEnableOOVFeature(false)
|
||||
, m_isAlwaysCreateDirectTranslationOption(false)
|
||||
, m_currentWeightSetting("default")
|
||||
@ -494,7 +494,7 @@ LoadDecodeGraphsOld(const vector<string> &mappingVector,
|
||||
const vector<GenerationDictionary*>& gens = GenerationDictionary::GetColl();
|
||||
|
||||
const std::vector<FeatureFunction*> *featuresRemaining
|
||||
= &FeatureFunction::GetFeatureFunctions();
|
||||
= &FeatureFunction::GetFeatureFunctions();
|
||||
DecodeStep *prev = 0;
|
||||
size_t prevDecodeGraphInd = 0;
|
||||
|
||||
@ -702,7 +702,7 @@ StaticData::
|
||||
InitializeForInput(ttasksptr const& ttask) const
|
||||
{
|
||||
const std::vector<FeatureFunction*> &producers
|
||||
= FeatureFunction::GetFeatureFunctions();
|
||||
= FeatureFunction::GetFeatureFunctions();
|
||||
for(size_t i=0; i<producers.size(); ++i) {
|
||||
FeatureFunction &ff = *producers[i];
|
||||
if (! IsFeatureFunctionIgnored(ff)) {
|
||||
@ -720,7 +720,7 @@ StaticData::
|
||||
CleanUpAfterSentenceProcessing(ttasksptr const& ttask) const
|
||||
{
|
||||
const std::vector<FeatureFunction*> &producers
|
||||
= FeatureFunction::GetFeatureFunctions();
|
||||
= FeatureFunction::GetFeatureFunctions();
|
||||
for(size_t i=0; i<producers.size(); ++i) {
|
||||
FeatureFunction &ff = *producers[i];
|
||||
if (! IsFeatureFunctionIgnored(ff)) {
|
||||
|
@ -470,15 +470,15 @@ public:
|
||||
// m_outputSearchGraph = outputSearchGraph;
|
||||
// }
|
||||
|
||||
// bool GetOutputSearchGraphExtended() const {
|
||||
// return m_outputSearchGraphExtended;
|
||||
// }
|
||||
// GetOutputSearchGraphSLF() const {
|
||||
// return m_outputSearchGraphSLF;
|
||||
// }
|
||||
// bool GetOutputSearchGraphHypergraph() const {
|
||||
// return m_outputSearchGraphHypergraph;
|
||||
// }
|
||||
// bool GetOutputSearchGraphExtended() const {
|
||||
// return m_outputSearchGraphExtended;
|
||||
// }
|
||||
// GetOutputSearchGraphSLF() const {
|
||||
// return m_outputSearchGraphSLF;
|
||||
// }
|
||||
// bool GetOutputSearchGraphHypergraph() const {
|
||||
// return m_outputSearchGraphHypergraph;
|
||||
// }
|
||||
|
||||
// #ifdef HAVE_PROTOBUF
|
||||
// bool GetOutputSearchGraphPB() const {
|
||||
|
@ -235,9 +235,9 @@ CreateTranslationOptionsForRangeLEGACY(const DecodeGraph &decodeGraph, size_t st
|
||||
const DecodeStep &decodeStep = **iterStep;
|
||||
|
||||
DecodeStepTranslation const& dstep
|
||||
= static_cast<const DecodeStepTranslation&>(decodeStep);
|
||||
= static_cast<const DecodeStepTranslation&>(decodeStep);
|
||||
dstep.ProcessInitialTransLEGACY(m_source, *oldPtoc, startPos, endPos,
|
||||
adhereTableLimit, inputPathList);
|
||||
adhereTableLimit, inputPathList);
|
||||
|
||||
// do rest of decode steps
|
||||
int indexStep = 0;
|
||||
|
@ -187,7 +187,7 @@ void TranslationTask::Run()
|
||||
// report thread number
|
||||
#if defined(WITH_THREADS) && defined(BOOST_HAS_PTHREADS)
|
||||
VERBOSE(2, "Translating line " << translationId << " in thread id "
|
||||
<< pthread_self() << endl);
|
||||
<< pthread_self() << endl);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -44,8 +44,8 @@ public:
|
||||
/** Read from PLF format (1 lattice per line)
|
||||
*/
|
||||
int Read(std::istream& in,
|
||||
std::vector<FactorType> const& factorOrder,
|
||||
AllOptions const& opts);
|
||||
std::vector<FactorType> const& factorOrder,
|
||||
AllOptions const& opts);
|
||||
|
||||
/** Convert internal representation into an edge matrix
|
||||
* @note edges[1][2] means there is an edge from 1 to 2
|
||||
|
Loading…
Reference in New Issue
Block a user