From 0f640d95a597e8fc542bc35690da281d23e67002 Mon Sep 17 00:00:00 2001 From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl> Date: Mon, 9 May 2011 14:37:44 +0200 Subject: [PATCH] example match rules --- examples/ne-match.ccl | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 examples/ne-match.ccl diff --git a/examples/ne-match.ccl b/examples/ne-match.ccl new file mode 100644 index 0000000..1129219 --- /dev/null +++ b/examples/ne-match.ccl @@ -0,0 +1,54 @@ +match_rules( + + // „wyżyna Xâ€, gdzie X jest oznaczone anotacjÄ… reladj_gaz_based + // poza tym wymagane jest uzgodnienie + apply( + match( + regex( base[0], 'wyżyna' ), + is( 'reladj_gaz_based' ) + ), + cond( + ann(:1, 'capitalized_noun' ), + agr(first(:1), first(:2), {nmb,gnd,cas}) + //equal( nmb[first(:1)], nmb[first(:2)] ), + //equal( cas[first(:1)], cas[first(:2)] ), + //equal( gnd[first(:1)], gnd[first(:2)] ) + ), + actions( + mark(M, 'HIGHLAND_NAM') + ) + ); + + // „wyżyna Xâ€, gdzie X może być subst i może być nom + // znakuje drugi element jako HIGHLAND_NAM, + // pierwszy element nie może być oznakowany jako capitalized_noun + apply( + match( + regex( base[0], 'wyżyna'), + and( inter(class[0], {subst}), inter(cas[0], {nom}) ) + ), + cond( + not( ann(:1, 'capitalized_noun' ) ) + ), + actions( + mark(:2, 'HIGHLAND_NAM') + ) + ); + + // „MIASTO Yâ€, gdzie MIASTO to anotacja city_trigger (jedno lub wielotokenowa), + // a Y to first_capital_word, poza tym mamy post-condition, że Y nie zawiera siÄ™ + // w anotacji city_nam_gaz + apply( + match( + is( 'city_trigger' ), + is( 'first_capital_word' ) + ), + cond( + not( annsub(:2, 'city_nam_gaz') ) + ), + actions( + mark(:2, 'CITY_NAM') + ) + ) + +) -- GitLab