Skip to content
Snippets Groups Projects
matchrulesequence.i 1.64 KiB
Newer Older
#ifndef SWIG_LIBWCCL_MATCHRULESEQUENCE_I
#define SWIG_LIBWCCL_MATCHRULESEQUENCE_I

%module libcclmatchrulesequence
%{
  #include <libwccl/ops/matchrulesequence.h>
%}

%include "matchrule.i"
%include "expression.i"
%include "libcorpus2/annotatedsentence.i"

%include "std_string.i"
%include "std_vector.i"
%include <libcorpus2/boost_shared_ptr.i>
%template(MatchRuleVector) std::vector<Wccl::Matching::MatchRule>;
%template(MatchRulePtr) boost::shared_ptr<Wccl::Matching::MatchRule>;
%template(ConstMatchRuleSequencePtr) boost::shared_ptr<const Wccl::Matching::MatchRuleSequence>;
%template(MatchRuleSequencePtr) boost::shared_ptr<Wccl::Matching::MatchRuleSequence>;
%template(ConstMatchRulePtr) boost::shared_ptr<const Wccl::Matching::MatchRule>;
  class MatchRuleSequence : public std::vector<MatchRule>, public Expression {
  public:
    MatchRuleSequence();
    MatchRuleSequence(const std::vector<MatchRule>& rules);

    /* --------------------------------------------------------------------- */

    %rename(OpFunMatchRuleSequence) operator()(const shared_ptr<Corpus2::AnnotatedSentence>& sentence);
    void operator()(const shared_ptr<Corpus2::AnnotatedSentence>& sentence);

    /* --------------------------------------------------------------------- */

    void apply_all(const shared_ptr<Corpus2::AnnotatedSentence>& sentence);

    /* --------------------------------------------------------------------- */

    std::string to_string(const Corpus2::Tagset& tagset) const;
  };
}

using namespace boost;
using namespace Wccl;
using namespace std;

#endif /* SWIG_LIBWCCL_MATCHRULESEQUENCE_I */