Bugs item #3541348, was opened at 2012-07-08 04:00
Message generated for change (Comment added) made by dominikoeo
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=655717&aid=3541348&group_id=110216
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: Fixed
Priority: 6
Private: No
Submitted By: Dominique Pelle (dominikoeo)
Assigned to: Nobody/Anonymous (nobody)
Summary: "ant test" reports spurious errors in rule Breton rules
Initial Comment:
"ant test" reports the following errors which look spurious:
[junit] The Breton rule: KLANV_PE_GLANVOCH:1 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:2 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:3 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:4 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:5 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:6 contains "\0" that is marked
as regular expression but probably is not one.
[junit] The Breton rule: KLANV_PE_GLANVOCH:7 contains "\0" that is marked
as regular expression but probably is not one.
The rule contains <match no="0" ...> which does not look correctly expanded
when doing the unit tests.
----------------------------------------------------------------------
>Comment By: Dominique Pelle (dominikoeo)
Date: 2012-07-12 03:29
Message:
Shouldn't the test instead expand \0 into whatever value it should be, and
then check whether the regexp is OK.
Thinking about it, it may actually unsafe to use \0 \1 etc (i.e. <match
no="0"...> etc) in regexp since the word could contain regexp special char
in in theory (assuming the tokenizer does not split on them, I can't think
of any example).
So perhaps I would use \\Q... \\E (i.e. quotemeta in the regexp around
things that should be checked verbatim. I'll double-check that when I have
time. The \Q and \E are documented here:
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
Quotation
\ Nothing, but quotes the following character
\Q Nothing, but quotes all characters until \E
\E Nothing, but ends quoting started by \Q
----------------------------------------------------------------------
Comment By: Marcin Miłkowski (milek_pl)
Date: 2012-07-12 02:41
Message:
I stopped the test from checking reference elements.
----------------------------------------------------------------------
Comment By: Marcin Miłkowski (milek_pl)
Date: 2012-07-11 01:34
Message:
This is how match no=1 is treated by the PatternRuleLoader. It's not a bug.
There's a bug in the test, I believe.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=655717&aid=3541348&group_id=110216
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs