diff --git a/swig/Makefile b/swig/Makefile index 6f53c276dda88de3ab4112d03e2dd4ecf3f7e584..3c69872e9bd436a997dc34169ca413d8c2b9d5ec 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -21,6 +21,9 @@ CBIN=libcclvalue.o \ libccltset.o \ libcclstrset.o \ libcclmatch.o \ + libcclmatchdata.o \ + libccltokenmatch.o \ + libcclannotationmatch.o \ libcclexpression.o \ libcclparsedexpression.o \ libcclfunctionaloperator.o \ @@ -39,6 +42,9 @@ CBINOUT=_libcclvalue.so \ _libcclfunctionaloperator.so \ _libcclvariables.so \ _libcclmatch.so \ + _libcclmatchdata.so \ + _libccltokenmatch.so \ + _libcclannotationmatch.so \ _libcclsentencecontext.so \ _libccloperator.so \ _libcclparser.so \ @@ -55,6 +61,9 @@ CWRAP=libcclvalue_wrap.cxx \ libcclfunctionaloperator_wrap.cxx \ libcclvariables_wrap.cxx \ libcclmatch_wrap.cxx \ + libcclmatchdata_wrap.cxx \ + libccltokenmatch_wrap.cxx \ + libcclannotationmatch_wrap.cxx \ libcclsentencecontext_wrap.cxx \ libcorpussentence_wrap.cxx \ libccloperator_wrap.cxx \ @@ -70,6 +79,9 @@ CWRAPBIN=libcclvalue_wrap.o \ libcclfunctionaloperator_wrap.o \ libcclvariables_wrap.o \ libcclmatch_wrap.o \ + libcclmatchdata_wrap.o \ + libccltokenmatch_wrap.o \ + libcclannotationmatch_wrap.o \ libcclsentencecontext_wrap.o \ libccloperator_wrap.o \ libcclparser_wrap.o \ @@ -81,10 +93,14 @@ PYMODULES=libcclvalue.py \ libcclparser.py \ libcclposition.py \ libccltset.py \ + libcclmatch.py \ + libcclmatchdata.py \ + libccltokenmatch.py \ libcclexpression.py \ libcclparsedexpression.py \ libcclvariables.py \ libcclsentencecontext.py \ + libcclannotationmatch.py \ libcclfunctionaloperator.py \ libccloperator.py \ boost_shared_ptr.py @@ -94,10 +110,14 @@ PYCBIN=libcclvalue.pyc \ libcclbool.pyc \ libcclposition.pyc \ libccltset.pyc \ + libcclmatch.pyc \ + libcclmatchdata.pyc \ + libccltokenmatch.pyc \ libcclexpression.pyc \ libcclparsedexpression.pyc \ libcclvariables.pyc \ libcclsentencecontext.pyc \ + libcclannotationmatch.pyc \ libcclfunctionaloperator.pyc \ libccloperator.pyc \ libcclparser.pyc \ @@ -164,6 +184,27 @@ libcclmatch.o: $(CPP) -shared libcclmatch_wrap.o \ $(CCLBIN) $(ANTLRLIB) -o _libcclmatch.so +# MatchData +libcclmatchdata.o: + $(SWIG) $(SWIGOPTS_LANG) libcclmatchdata.i + $(CPP) -c libcclmatchdata_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS) + $(CPP) -shared libcclmatchdata_wrap.o \ + $(CCLBIN) $(ANTLRLIB) -o _libcclmatchdata.so + +# TokenMatch +libccltokenmatch.o: + $(SWIG) $(SWIGOPTS_LANG) libccltokenmatch.i + $(CPP) -c libccltokenmatch_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS) + $(CPP) -shared libccltokenmatch_wrap.o \ + $(CCLBIN) $(ANTLRLIB) -o _libccltokenmatch.so + +# AnnotationMatch +libcclannotationmatch.o: + $(SWIG) $(SWIGOPTS_LANG) libcclannotationmatch.i + $(CPP) -c libcclannotationmatch_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS) + $(CPP) -shared libcclannotationmatch_wrap.o \ + $(CCLBIN) $(ANTLRLIB) -o _libcclannotationmatch.so + # Expression libcclexpression.o: $(SWIG) $(SWIGOPTS_LANG) libcclexpression.i diff --git a/swig/libcclannotationmatch.i b/swig/libcclannotationmatch.i new file mode 100644 index 0000000000000000000000000000000000000000..791be9f5269346fb72b3df9fd59ac721765327de --- /dev/null +++ b/swig/libcclannotationmatch.i @@ -0,0 +1,37 @@ +#ifndef SWIG_LIBWCCL_ANNOTATIONMATCH_I +#define SWIG_LIBWCCL_ANNOTATIONMATCH_I + +%module libcclannotationmatch +%{ + #include <libwccl/values/annotationmatch.h> +%} + +%include "std_string.i" +%include "libcclposition.i" +%include "libcclmatchdata.i" +%include "libcorpus/libcorpusannotatedsentence.i" + +%nodefaultctor Wccl::AnnotationMatch; + +namespace Wccl { + class AnnotationMatch : public MatchData { + public: + explicit AnnotationMatch(Position position, const std::string channel); + explicit AnnotationMatch(int pos, const std::string channel); + + /* --------------------------------------------------------------------- */ + bool empty() const; + + /* --------------------------------------------------------------------- */ + Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const; + Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const; + + /* --------------------------------------------------------------------- */ + std::string to_raw_string() const; + }; +} + +using namespace std; +using namespace Wccl; + +#endif /* SWIG_LIBWCCL_ANNOTATIONMATCH_I */ diff --git a/swig/libcclmatchdata.i b/swig/libcclmatchdata.i new file mode 100644 index 0000000000000000000000000000000000000000..08893106f536fa2416731fcb79d718d68c639d91 --- /dev/null +++ b/swig/libcclmatchdata.i @@ -0,0 +1,44 @@ +#ifndef SWIG_LIBWCCL_MATCHDATA_I +#define SWIG_LIBWCCL_MATCHDATA_I + +%module libcclmatchdata +%{ + #include <libwccl/values/matchdata.h> +%} + +%include "boost_shared_ptr.i" +%include "libcclmatch.i" +%include "libcorpus/libcorpusannotatedsentence.i" + +// %template(MatchDataPtr) boost::shared_ptr<Wccl::MatchData>; + +namespace Wccl { + class MatchData { + public: + ~MatchData(); + + /* --------------------------------------------------------------------- */ + + virtual bool empty() const = 0; + virtual Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const = 0; + virtual Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const = 0; + + /* --------------------------------------------------------------------- */ + + virtual const boost::shared_ptr<Match>& submatch(size_t); + + /* --------------------------------------------------------------------- */ + + boost::shared_ptr<MatchData> clone() const; + + /* --------------------------------------------------------------------- */ + + virtual std::string to_raw_string() const = 0; + }; +} + +using namespace std; +using namespace Wccl; +using namespace boost; + +#endif /* SWIG_LIBWCCL_MATCHDATA_I */ diff --git a/swig/libccltokenmatch.i b/swig/libccltokenmatch.i new file mode 100644 index 0000000000000000000000000000000000000000..32757f86b051bc116a1cdb2e870c7432cd287ff0 --- /dev/null +++ b/swig/libccltokenmatch.i @@ -0,0 +1,36 @@ +#ifndef SWIG_LIBWCCL_TOKENMATCH_I +#define SWIG_LIBWCCL_TOKENMATCH_I + +%module libccltokenmatch +%{ + #include <libwccl/values/tokenmatch.h> +%} + +%include "libcclposition.i" +%include "libcclmatchdata.i" +%include "libcorpus/libcorpusannotatedsentence.i" + +%nodefaultctor Wccl::TokenMatch; + +namespace Wccl { + class TokenMatch : public MatchData { + public: + explicit TokenMatch(Position position); + explicit TokenMatch(int pos); + + /* --------------------------------------------------------------------- */ + bool empty() const; + + /* --------------------------------------------------------------------- */ + Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const; + Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const; + + /* --------------------------------------------------------------------- */ + std::string to_raw_string() const; + }; +} + +using namespace std; +using namespace Wccl; + +#endif /* SWIG_LIBWCCL_TOKENMATCH_I */ diff --git a/swig/libccltset.i b/swig/libccltset.i index cd8eb1b3db31e0c2c8886562d5dd4d37a2bf1cc1..d9f536311ad4909ab035688fdc7198e7fbae4d13 100644 --- a/swig/libccltset.i +++ b/swig/libccltset.i @@ -8,10 +8,10 @@ %} /* Include required headers */ -%include "libcorpustag.i" - -%include "libcclvalue.i" %include "std_string.i" +%include "libcclvalue.i" +%include "libcorpus/libcorpustag.i" +%include "libcorpus/libcorpustagset.i" %feature("notabstract") Wccl::TSet; diff --git a/swig/libcclvalue.i b/swig/libcclvalue.i index 62462210fbce71b3286b349fcd6916370eb73ef6..4a62b2132bf48610ba8bd2aae8153c418402795c 100644 --- a/swig/libcclvalue.i +++ b/swig/libcclvalue.i @@ -7,25 +7,32 @@ %} %include "std_string.i" -%include "boost_shared_ptr.i" +%include "libcorpus/libcorpustagset.i" + +%nodefaultctor Wccl::Value; namespace Wccl { class Value { public: - static const char* type_name; - + static const char type_name[56]; virtual const char* get_type_name() const; + + /* --------------------------------------------------------------------- */ + virtual ~Value(); + /* --------------------------------------------------------------------- */ + virtual std::string make_var_repr(const std::string&) const = 0; + + /* --------------------------------------------------------------------- */ + virtual std::string to_string(const Corpus2::Tagset& /*tagset*/) const; virtual std::string to_raw_string() const = 0; }; -} -// %template(BoolSharedPtr) boost::shared_ptr<Wccl::Value>; +} -using namespace boost; using namespace std; using namespace Wccl; diff --git a/swig/makewrapper.sh b/swig/makewrapper.sh new file mode 100755 index 0000000000000000000000000000000000000000..8d6f5167baa63d6063cbe96734f7ca2b8fbdff09 --- /dev/null +++ b/swig/makewrapper.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x + +if [ ${#} -eq 0 ] +then + echo "Usage: $0 wccl2class" + exit 1 +fi + +UPPER=`echo ${1} | tr '[:lower:]' '[:upper:]'` +LOWER=`echo ${1} | tr '[:upper:]' '[:lower:]'` +CLNAM=${1} +OUTFILE=libccl${LOWER}.i + +cat swig_template_wccl.template | sed s/TEMPLATE/${UPPER}/g | sed s/Template/${CLNAM}/g | sed s/template/${LOWER}/g > ${OUTFILE} + +echo -e "\e[1;32m${OUTFILE} was generated. Don't forget to add ${OUTFILE} to Makefile (or CMake)!\e[0m" diff --git a/swig/swig_template_wccl.template b/swig/swig_template_wccl.template new file mode 100644 index 0000000000000000000000000000000000000000..93ebce82b5b4ed74c3b2f5482aa046ce9ce93c91 --- /dev/null +++ b/swig/swig_template_wccl.template @@ -0,0 +1,25 @@ +#ifndef SWIG_LIBWCCL_TEMPLATE_I +#define SWIG_LIBWCCL_TEMPLATE_I + +%module libccltemplate +%{ + // Add includes here... + // #include <...> +%} + +// %include "...i" + +namespace Wccl { + class Template { + public: + Template(); + ~Template(); + + /* --------------------------------------------------------------------- */ + }; +} + +using namespace std; +using namespace Wccl; + +#endif /* SWIG_LIBWCCL_TEMPLATE_I */ diff --git a/tests/rules-data/match/postcond/cclmatch.xml b/tests/rules-data/match/postcond/cclmatch.xml new file mode 100644 index 0000000000000000000000000000000000000000..c45107573669c0c9d4914388f0a2c48de071e65a --- /dev/null +++ b/tests/rules-data/match/postcond/cclmatch.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE cesAna SYSTEM "xcesAnaIPI.dtd"> +<cesAna xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" type="lex disamb"> +<chunkList> + <chunk id="ch1" type="p"> + <sentence> + <tok> + <orth>Tę</orth> + <lex><base>ten</base><ctag>adj:sg:acc:f:pos</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżynę</orth> + <lex><base>wyżyna</base><ctag>subst:sg:acc:f</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Paweł</orth> + <lex><base>Paweł</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Pawła</base><ctag>subst:pl:gen:f</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:nom:m3</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:acc:m3</ctag></lex> + <ann chan="Person" head="1">1</ann> + </tok> + <tok> + <orth>Nowak</orth> + <lex><base>Nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>Nowicki</orth> + <lex><base>Nowicki</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Nowicki</base><ctag>subst:sg:voc:m1</ctag></lex> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>zwiedził</orth> + <lex><base>zwiedzić</base><ctag>praet:sg:m1:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m2:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m3:perf</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>,</orth> + <lex><base>,</base><ctag>interp</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>to</orth> + <lex><base>ten</base><ctag>adj:sg:nom:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:acc:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:voc:n:pos</ctag></lex> + <lex><base>to</base><ctag>conj</ctag></lex> + <lex><base>to</base><ctag>pred</ctag></lex> + <lex><base>to</base><ctag>qub</ctag></lex> + <lex><base>to</base><ctag>subst:sg:nom:n</ctag></lex> + <lex><base>to</base><ctag>subst:sg:acc:n</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>jest</orth> + <lex><base>być</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>i</orth> + <lex><base>i</base><ctag>conj</ctag></lex> + <lex><base>i</base><ctag>qub</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>.</orth> + <lex><base>.</base><ctag>interp</ctag></lex> + <ann chan="Person">0</ann> + </tok> + </sentence> + </chunk> +</chunkList> +</cesAna> diff --git a/tests/rules-data/match/postcond/cclmatch1.ccl b/tests/rules-data/match/postcond/cclmatch1.ccl new file mode 100644 index 0000000000000000000000000000000000000000..0e5675307e90f80483f0e8c8829ea0e613076dbb --- /dev/null +++ b/tests/rules-data/match/postcond/cclmatch1.ccl @@ -0,0 +1,14 @@ +apply( + match( + inter( base[0], 'wyżyna' ), + repeat( + and( inter(class[0], {subst}), inter(cas[0], {nom}) ) + ) + ), + cond( + not( annsub(:2, 'Person' ) ) + ), + actions( + mark(:2, 'Highland') + ) +) diff --git a/tests/rules-data/match/postcond/cclmatch1.out.xml b/tests/rules-data/match/postcond/cclmatch1.out.xml new file mode 100644 index 0000000000000000000000000000000000000000..8bf39fb7742056b6184ea92c9f1526e6e0cc51d0 --- /dev/null +++ b/tests/rules-data/match/postcond/cclmatch1.out.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE cesAna SYSTEM "xcesAnaIPI.dtd"> +<cesAna xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" type="lex disamb"> +<chunkList> + <chunk id="ch1" type="p"> + <sentence> + <tok> + <orth>Tę</orth> + <lex><base>ten</base><ctag>adj:sg:acc:f:pos</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżynę</orth> + <lex><base>wyżyna</base><ctag>subst:sg:acc:f</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Paweł</orth> + <lex><base>Paweł</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Pawła</base><ctag>subst:pl:gen:f</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:nom:m3</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:acc:m3</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person" head="1">1</ann> + </tok> + <tok> + <orth>Nowak</orth> + <lex><base>Nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>Nowicki</orth> + <lex><base>Nowicki</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Nowicki</base><ctag>subst:sg:voc:m1</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>zwiedził</orth> + <lex><base>zwiedzić</base><ctag>praet:sg:m1:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m2:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m3:perf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>,</orth> + <lex><base>,</base><ctag>interp</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>to</orth> + <lex><base>ten</base><ctag>adj:sg:nom:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:acc:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:voc:n:pos</ctag></lex> + <lex><base>to</base><ctag>conj</ctag></lex> + <lex><base>to</base><ctag>pred</ctag></lex> + <lex><base>to</base><ctag>qub</ctag></lex> + <lex><base>to</base><ctag>subst:sg:nom:n</ctag></lex> + <lex><base>to</base><ctag>subst:sg:acc:n</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>jest</orth> + <lex><base>być</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Highland" head="1">1</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Highland">1</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>i</orth> + <lex><base>i</base><ctag>conj</ctag></lex> + <lex><base>i</base><ctag>qub</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Highland" head="1">2</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Highland">2</ann> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>.</orth> + <lex><base>.</base><ctag>interp</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + </sentence> + </chunk> +</chunkList> +</cesAna> diff --git a/tests/rules-data/match/postcond/cclmatch2.ccl b/tests/rules-data/match/postcond/cclmatch2.ccl new file mode 100644 index 0000000000000000000000000000000000000000..3f2b4555dc297efa3db3087682bd4743589f5deb --- /dev/null +++ b/tests/rules-data/match/postcond/cclmatch2.ccl @@ -0,0 +1,14 @@ +apply( + match( + inter( base[0], 'wyżyna' ), + repeat( + and( inter(class[0], {subst}), inter(cas[0], {nom}) ) + ) + ), + cond( + not( ann(:2, 'Person' ) ) + ), + actions( + mark(:2, 'Highland') + ) +) diff --git a/tests/rules-data/match/postcond/cclmatch2.out.xml b/tests/rules-data/match/postcond/cclmatch2.out.xml new file mode 100644 index 0000000000000000000000000000000000000000..8bf39fb7742056b6184ea92c9f1526e6e0cc51d0 --- /dev/null +++ b/tests/rules-data/match/postcond/cclmatch2.out.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE cesAna SYSTEM "xcesAnaIPI.dtd"> +<cesAna xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" type="lex disamb"> +<chunkList> + <chunk id="ch1" type="p"> + <sentence> + <tok> + <orth>Tę</orth> + <lex><base>ten</base><ctag>adj:sg:acc:f:pos</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżynę</orth> + <lex><base>wyżyna</base><ctag>subst:sg:acc:f</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Paweł</orth> + <lex><base>Paweł</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Pawła</base><ctag>subst:pl:gen:f</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:nom:m3</ctag></lex> + <lex><base>paweł</base><ctag>subst:sg:acc:m3</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person" head="1">1</ann> + </tok> + <tok> + <orth>Nowak</orth> + <lex><base>Nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>nowak</base><ctag>subst:sg:nom:m1</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>Nowicki</orth> + <lex><base>Nowicki</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>Nowicki</base><ctag>subst:sg:voc:m1</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">1</ann> + </tok> + <tok> + <orth>zwiedził</orth> + <lex><base>zwiedzić</base><ctag>praet:sg:m1:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m2:perf</ctag></lex> + <lex><base>zwiedzić</base><ctag>praet:sg:m3:perf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>,</orth> + <lex><base>,</base><ctag>interp</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>to</orth> + <lex><base>ten</base><ctag>adj:sg:nom:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:acc:n:pos</ctag></lex> + <lex><base>ten</base><ctag>adj:sg:voc:n:pos</ctag></lex> + <lex><base>to</base><ctag>conj</ctag></lex> + <lex><base>to</base><ctag>pred</ctag></lex> + <lex><base>to</base><ctag>qub</ctag></lex> + <lex><base>to</base><ctag>subst:sg:nom:n</ctag></lex> + <lex><base>to</base><ctag>subst:sg:acc:n</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>jest</orth> + <lex><base>być</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Highland" head="1">1</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Highland">1</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>i</orth> + <lex><base>i</base><ctag>conj</ctag></lex> + <lex><base>i</base><ctag>qub</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>wyżyna</orth> + <lex><base>wyżyna</base><ctag>subst:sg:nom:f</ctag></lex> + <lex><base>wyżynać</base><ctag>fin:sg:ter:imperf</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Pies</orth> + <lex><base>pies</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>pies</base><ctag>subst:sg:nom:m2</ctag></lex> + <ann chan="Highland" head="1">2</ann> + <ann chan="Person">0</ann> + </tok> + <tok> + <orth>Kot</orth> + <lex><base>Kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m1</ctag></lex> + <lex><base>kot</base><ctag>subst:sg:nom:m2</ctag></lex> + <lex><base>kota</base><ctag>subst:pl:gen:f</ctag></lex> + <ann chan="Highland">2</ann> + <ann chan="Person">0</ann> + </tok> + <ns/> + <tok> + <orth>.</orth> + <lex><base>.</base><ctag>interp</ctag></lex> + <ann chan="Highland">0</ann> + <ann chan="Person">0</ann> + </tok> + </sentence> + </chunk> +</chunkList> +</cesAna>