Hi

Would be possible to allow for several tags
<filter class="..."/> in the same rule?

It seems that we can only give one.
I'd like to be able to use several (at least 2):
* one to make sure that part of regexp matches a postag
* another one to make sure that part of the regexp does not match a postag

I tried something like this in the Breton grammar.xml
with 2 <filter.../> but it does not work:

<rule id="KEMM_EZ_J" name="ez-glas → ez-c’hlas">
  <pattern><token regexp="yes">ez[-‑‐](.*)</token></pattern>
  <filter class="org.languagetool.rules.br.BretonPartialPosTagFilter"
          args="no:1 regexp:(?i)ez[-‑‐](.*) postag_regexp:J"/>
  <filter class="org.languagetool.rules.br.BretonPartialPosTagFilter"
          args="no:1 regexp:(?i)ez[-‑‐](.*) postag_regexp:J.*:1b:.*
negate_pos:yes"/>
  <message>Ur c’hemmadur dre vlotaat a zlefe bezañ en anv-gwan «\1» goude
«ez-». (CHALM Sa)</message>
  <example correction=""><marker>Ez-glas</marker></example>
  <example>Ez-c’hlas</example>
</rule>


... but it gives an error:

$ mvn --projects languagetool-language-modules/br --also-make clean test
...snip...
Running XML validation for br/grammar.xml...
cvc-complex-type.2.4.a: Invalid content was found starting with element
'filter'. One of '{message}' is expected. Problem found at line 3148,
column 90.
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.404 sec
<<< FAILURE! - in org.languagetool.rules.br.BretonPatternRuleTest

I get no syntax error if I comment out the 2nd <filter...> tag in the
above rule, but then the rule will then have false alarms.

I've also noticed that the regexp in <filter class="..."/>
is case sensitive by default.  It's a bit odd as LT uses
case insensitive regexp by default everywhere else.  I'm
not sure it's done on purpose. Anyway, case sensitivity is
not blocking as I can use (?i) in the regexp to make it
case sensitive.

Regards
Dominique
------------------------------------------------------------------------------
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to