diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2014-04-30 23:20:07 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2014-04-30 23:20:07 +0400 |
commit | 26abab8e5c58d6e30e31fc47cf7fc971af1b692c (patch) | |
tree | fed0a033a61214fa5a996a0619376204ba120439 /moses/InputPath.cpp | |
parent | 55064961f7157e62c50b4771edf478aeae61825c (diff) |
debugging info
Diffstat (limited to 'moses/InputPath.cpp')
-rw-r--r-- | moses/InputPath.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/moses/InputPath.cpp b/moses/InputPath.cpp index b7b85fa6f..6ddbbef14 100644 --- a/moses/InputPath.cpp +++ b/moses/InputPath.cpp @@ -80,6 +80,22 @@ const Word &InputPath::GetLastWord() const return ret; } +size_t InputPath::GetTotalRuleSize() const +{ + size_t ret = 0; + std::map<const PhraseDictionary*, std::pair<const TargetPhraseCollection*, const void*> >::const_iterator iter; + for (iter = obj.m_targetPhrases.begin(); iter != obj.m_targetPhrases.end(); ++iter) { + const PhraseDictionary *pt = iter->first; + const TargetPhraseCollection *tpColl = iter->second.first; + + if (tpColl) { + ret += tpColl->GetSize(); + } + } + + return ret; +} + std::ostream& operator<<(std::ostream& out, const InputPath& obj) { out << &obj << " " << obj.GetWordsRange() << " " << obj.GetPrevPath() << " " << obj.GetPhrase(); @@ -88,7 +104,15 @@ std::ostream& operator<<(std::ostream& out, const InputPath& obj) std::map<const PhraseDictionary*, std::pair<const TargetPhraseCollection*, const void*> >::const_iterator iter; for (iter = obj.m_targetPhrases.begin(); iter != obj.m_targetPhrases.end(); ++iter) { const PhraseDictionary *pt = iter->first; - out << pt << " "; + const TargetPhraseCollection *tpColl = iter->second.first; + + out << pt << "="; + if (tpColl) { + cerr << tpColl->GetSize() << " "; + } + else { + cerr << "NULL "; + } } return out; |