diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-10-02 20:43:59 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-10-02 20:43:59 +0400 |
commit | 1b12b0c4a24ffd78a08dd0053739b6497b8ce990 (patch) | |
tree | f1370e3ee87602f988eb678da09639f5b011060f /moses/WordLattice.cpp | |
parent | bb511af0ee016646e9272a086cfe118efd7e1938 (diff) |
correct creation of input paths for lattices
Diffstat (limited to 'moses/WordLattice.cpp')
-rw-r--r-- | moses/WordLattice.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/moses/WordLattice.cpp b/moses/WordLattice.cpp index ae52eeb35..376ab05fd 100644 --- a/moses/WordLattice.cpp +++ b/moses/WordLattice.cpp @@ -204,5 +204,29 @@ bool WordLattice::CanIGetFromAToB(size_t start, size_t end) const } +std::ostream& operator<<(std::ostream &out, const WordLattice &obj) +{ + out << "next_nodes="; + for (size_t i = 0; i < obj.next_nodes.size(); ++i) { + out << i << ":"; + + const std::vector<size_t> &inner = obj.next_nodes[i]; + for (size_t j = 0; j < inner.size(); ++j) { + out << inner[j] << " "; + } + } + + out << "distances="; + for (size_t i = 0; i < obj.distances.size(); ++i) { + out << i << ":"; + + const std::vector<int> &inner = obj.distances[i]; + for (size_t j = 0; j < inner.size(); ++j) { + out << inner[j] << " "; + } + } + return out; } +} // namespace + |