From 1e0e98101470368ec5199e3a1ffcc851f2d0eaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl> Date: Fri, 10 Dec 2010 15:10:27 +0100 Subject: [PATCH] Added method for dumping variables --- libwccl/ops/parsedexpression.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libwccl/ops/parsedexpression.h b/libwccl/ops/parsedexpression.h index d8e1526..b3b007a 100644 --- a/libwccl/ops/parsedexpression.h +++ b/libwccl/ops/parsedexpression.h @@ -138,6 +138,19 @@ public: * @see clone_ptr - a version that keeps values of the variables. */ boost::shared_ptr<ParsedExpression> clone_clean_ptr() const; + + /** + * Dup all variables to error stream. + */ + void dumpvariables(const Corpus2::Tagset& tagset) + { + typedef std::pair<std::string, boost::shared_ptr<Wccl::Value> > v_t; + + foreach (const v_t& v, variables_->get_all<Wccl::Value>()) { + std::cerr << v.second->make_var_repr(v.first) << "=" + << v.second->to_string(tagset) << "\n"; + } + } protected: explicit ParsedExpression(const Variables& variables); -- GitLab