mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +03:00
support -tt
This commit is contained in:
parent
4791e75a6b
commit
4443a34052
@ -228,15 +228,17 @@ void Scores::CreateFromString(const std::string &str,
|
||||
|
||||
void Scores::Debug(std::ostream &out, const System &system) const
|
||||
{
|
||||
out << "total=" << m_total;
|
||||
|
||||
if (system.nbestSize) {
|
||||
out << ", ";
|
||||
BOOST_FOREACH(const FeatureFunction *ff, system.featureFunctions.GetFeatureFunctions()) {
|
||||
out << ff->GetName() << ":";
|
||||
out << ff->GetName() << "= ";
|
||||
for (size_t i = ff->GetStartInd(); i < (ff->GetStartInd() + ff->GetNumScores()); ++i) {
|
||||
out << m_scores[i] << " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
out << "= " << m_total;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const Scores &obj)
|
||||
|
@ -159,8 +159,23 @@ void Hypothesis::OutputToStream(std::ostream &out) const
|
||||
out << phrase << " ";
|
||||
}
|
||||
|
||||
if (m_mgr->system.reportSegmentation && m_path->range.GetStartPos() != NOT_FOUND) {
|
||||
out << "|" << m_path->range.GetStartPos() << "-" << m_path->range.GetEndPos() << "| ";
|
||||
if (m_path->range.GetStartPos() != NOT_FOUND) {
|
||||
if (m_mgr->system.reportSegmentation == 1) {
|
||||
// just report phrase segmentation
|
||||
out << "|" << m_path->range.GetStartPos() << "-" << m_path->range.GetEndPos() << "| ";
|
||||
}
|
||||
else if (m_mgr->system.reportSegmentation == 2) {
|
||||
// more detailed info about every segment
|
||||
out << "|";
|
||||
|
||||
// phrase segmentation
|
||||
out << m_path->range.GetStartPos() << "-" << m_path->range.GetEndPos() << ",";
|
||||
|
||||
// score breakdown
|
||||
m_scores->Debug(out, m_mgr->system);
|
||||
|
||||
out << "| ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,9 @@ System::System(const Parameter ¶msArg)
|
||||
params.SetParameter(cpuAffinityOffset, "cpu-affinity-offset",
|
||||
0);
|
||||
|
||||
params.SetParameter(reportSegmentation, "report-segmentation",
|
||||
false);
|
||||
reportSegmentation = (params.GetParam("report-segmentation-enriched")
|
||||
? 2 : params.GetParam("report-segmentation")
|
||||
? 1 : 0);
|
||||
|
||||
params.SetParameter(outputHypoScore, "output-hypo-score",
|
||||
false);
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
bool onlyDistinct;
|
||||
|
||||
bool outputHypoScore;
|
||||
bool reportSegmentation;
|
||||
int reportSegmentation;
|
||||
int cpuAffinityOffset;
|
||||
|
||||
System(const Parameter ¶msArg);
|
||||
|
Loading…
Reference in New Issue
Block a user