Bugs item #3431788, was opened at 2011-11-01 03:03
Message generated for change (Comment added) made by milek_pl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=655717&aid=3431788&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: 5
Private: No
Submitted By: gulp21 (gulp21-1)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem when re-using <match/> with regexp_replace
Initial Comment:
When the match element with regexp_replace is used more than once, the
resulting text is not the expected one.
Example (German rule):
<rule id="BAUCHWEH" name="Umgangssprache: 'Bauchweh (Bauchschmerz)'">
<pattern>
<token regexp="yes">(Bauch|Kopf|Hals|Zahn)wehe?s?n?</token>
</pattern>
<message>\1 ist umgangssprachlich. Vorschläge: <suggestion><match no="1"
regexp_replace="schmerz" regexp_match="weh.*"/></suggestion>,
<suggestion><match no="1" regexp_replace="schmerzen"
regexp_match="weh.*"/></suggestion></message><!--TODO is this a bug?-->
<example type="correct">Er hat <marker>Bauchschmerzen</marker>.</example>
<example type="incorrect">Wegen des starken
<marker>Zahnwehs</marker>...</example>
</rule>
message will be:
"Bauchschmerz ist umgangssprachlich. Vorschläge: Bauchschmerzen, Bauchschmerzen"
but it's supposed to be:
"Bauchweh ist umgangssprachlich. Vorschläge: Bauchschmerz, Bauchschmerzen"
----------------------------------------------------------------------
>Comment By: Marcin Miłkowski (milek_pl)
Date: 2012-06-18 09:28
Message:
The error was due to the fact that \1 was the first character in the
message, and the code contained a wrong assumption that this is the very
first position in the string. Fixed in 1.8-dev.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=655717&aid=3431788&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