mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
debugging output for ReorderingConstraint
This commit is contained in:
parent
44c9e6db17
commit
60b83e7963
@ -236,4 +236,26 @@ bool ReorderingConstraint::Check( const Bitmap &bitmap, size_t startPos, size_t
|
||||
return true;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const ReorderingConstraint &obj)
|
||||
{
|
||||
out << "Zones:";
|
||||
for (size_t i = 0; i < obj.m_zone.size(); ++i) {
|
||||
const std::vector< size_t > &zone1 = obj.m_zone[i];
|
||||
UTIL_THROW_IF2(zone1.size() != 2, "m_zone[" << i << "] != 2");
|
||||
out << zone1[0] << "-" << zone1[1] << " ";
|
||||
}
|
||||
|
||||
out << "Walls:";
|
||||
for (size_t i = 0; i < obj.m_size; ++i) {
|
||||
out << obj.m_wall[i];
|
||||
}
|
||||
|
||||
out << " Local walls:";
|
||||
for (size_t i = 0; i < obj.m_size; ++i) {
|
||||
out << obj.m_localWall[i] << " ";
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class Bitmap;
|
||||
*/
|
||||
class ReorderingConstraint
|
||||
{
|
||||
friend std::ostream& operator<<(std::ostream& out, const ReorderingConstraint& reorderingConstraint);
|
||||
friend std::ostream& operator<<(std::ostream& out, const ReorderingConstraint &obj);
|
||||
protected:
|
||||
// const size_t m_size; /**< number of words in sentence */
|
||||
size_t m_size; /**< number of words in sentence */
|
||||
|
Loading…
Reference in New Issue
Block a user