diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-11 13:12:54 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-11 16:52:48 +0300 |
commit | 65f4f1f92af3d645b1dfc2f161bbcf47bdce1402 (patch) | |
tree | d24edefd5cbe1e954021958b5214471c29c96a04 /moses/HypergraphOutput.h | |
parent | 40ed3df9cb513681569a2fcde32a5215c38253f3 (diff) |
Code cleanup and refactoring.
Diffstat (limited to 'moses/HypergraphOutput.h')
-rw-r--r-- | moses/HypergraphOutput.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/moses/HypergraphOutput.h b/moses/HypergraphOutput.h index 6503a9a28..58467d781 100644 --- a/moses/HypergraphOutput.h +++ b/moses/HypergraphOutput.h @@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #define moses_Hypergraph_Output_h #include <ostream> +#include "moses/parameters/AllOptions.h" /** * Manage the output of hypergraphs. @@ -58,6 +59,9 @@ private: **/ class ChartSearchGraphWriter { +protected: + AllOptions::ptr m_options; + ChartSearchGraphWriter(AllOptions::ptr const& opts) : m_options(opts) { } public: virtual void WriteHeader(size_t winners, size_t losers) const = 0; virtual void WriteHypos(const ChartHypothesisCollection& hypos, @@ -69,8 +73,9 @@ public: class ChartSearchGraphWriterMoses : public virtual ChartSearchGraphWriter { public: - ChartSearchGraphWriterMoses(std::ostream* out, size_t lineNumber) : - m_out(out), m_lineNumber(lineNumber) {} + ChartSearchGraphWriterMoses(AllOptions::ptr const& opts, + std::ostream* out, size_t lineNumber) + : ChartSearchGraphWriter(opts), m_out(out), m_lineNumber(lineNumber) {} virtual void WriteHeader(size_t, size_t) const { /* do nothing */ } @@ -86,8 +91,8 @@ private: class ChartSearchGraphWriterHypergraph : public virtual ChartSearchGraphWriter { public: - ChartSearchGraphWriterHypergraph(std::ostream* out) : - m_out(out), m_nodeId(0) {} + ChartSearchGraphWriterHypergraph(AllOptions::ptr const& opts, std::ostream* out) + : ChartSearchGraphWriter(opts), m_out(out), m_nodeId(0) { } virtual void WriteHeader(size_t winners, size_t losers) const; virtual void WriteHypos(const ChartHypothesisCollection& hypos, const std::map<unsigned, bool> &reachable) const; |