Revision: 7399
http://languagetool.svn.sourceforge.net/languagetool/?rev=7399&view=rev
Author: milek_pl
Date: 2012-06-18 16:27:49 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
fix sf bug #3431788
Modified Paths:
--------------
trunk/JLanguageTool/CHANGES.txt
trunk/JLanguageTool/src/java/org/languagetool/rules/patterns/XMLRuleHandler.java
trunk/JLanguageTool/src/rules/de/grammar.xml
Modified: trunk/JLanguageTool/CHANGES.txt
===================================================================
--- trunk/JLanguageTool/CHANGES.txt 2012-06-18 08:56:09 UTC (rev 7398)
+++ trunk/JLanguageTool/CHANGES.txt 2012-06-18 16:27:49 UTC (rev 7399)
@@ -132,6 +132,10 @@
-Bugfix: when LT was hidden in the tray, two very fast mouse clicks could
activate the check
twice, and that caused errors. Right now only one checking thread is active.
+
+ -Bugfix #3431788: When the message contained the reference to a previous
token as the first
+ character, the corrections generated via regular expression replacements on
match elements
+ were wrong.
1.7 (2012-03-25)
Modified:
trunk/JLanguageTool/src/java/org/languagetool/rules/patterns/XMLRuleHandler.java
===================================================================
---
trunk/JLanguageTool/src/java/org/languagetool/rules/patterns/XMLRuleHandler.java
2012-06-18 08:56:09 UTC (rev 7398)
+++
trunk/JLanguageTool/src/java/org/languagetool/rules/patterns/XMLRuleHandler.java
2012-06-18 16:27:49 UTC (rev 7399)
@@ -457,9 +457,9 @@
int matchCounter = 0;
while (pos != -1) {
pos = messageStr.indexOf('\\', ind + 1);
- if (pos != -1 && messageStr.length() > pos) {
+ if (pos != -1 && messageStr.length() > pos) {
if (Character.isDigit(messageStr.charAt(pos + 1))) {
- if (pos == 1 || messageStr.charAt(pos - 1) != '\u0001') {
+ if (pos == 0 || messageStr.charAt(pos - 1) != '\u0001') {
final Match mWorker = new Match(null, null, false, null,
null, Match.CaseConversion.NONE, false, false,
Match.IncludeRange.NONE);
mWorker.setInMessageOnly(true);
@@ -473,6 +473,7 @@
}
ind = pos;
}
+
if (sugMatch.isEmpty()) {
return suggestionMatches;
}
Modified: trunk/JLanguageTool/src/rules/de/grammar.xml
===================================================================
--- trunk/JLanguageTool/src/rules/de/grammar.xml 2012-06-18 08:56:09 UTC
(rev 7398)
+++ trunk/JLanguageTool/src/rules/de/grammar.xml 2012-06-18 16:27:49 UTC
(rev 7399)
@@ -7345,17 +7345,17 @@
<!-- TODO split category? (Umgangssprache + Stil) -->
<category name="Stil, Umgangssprache">
<!-- TODO Make one Java-rule for context-independent, colloquial
expressions and maintain a list -->
- <!-- TODO suggestion is incorrect, commented for now
+
<rule id="BAUCHWEH" name="Umgangssprache: 'Bauchweh (Bauchschmerz)'">
<pattern>
<token regexp="yes">(Bauch|Kopf|Hals|Zahn)wehs?</token>
</pattern>
- <message>\1 ist umgangssprachlich. Vorschläge: <suggestion><match
no="1" regexp_replace="schmerz" regexp_match="wehs?$"/></suggestion>,
<suggestion><match no="1" regexp_replace="schmerzen"
regexp_match="schmerz$"/></suggestion>.\nBitte beachten Sie, dass etwaige
Ajektive an das neue Genus angepasst werden müssen.</message>
+ <message><match no="1"/> ist umgangssprachlich. Vorschläge:
<suggestion><match no="1" regexp_replace="schmerz"
regexp_match="wehs?$"/></suggestion>, <suggestion><match no="1"
regexp_replace="schmerzen" regexp_match="wehs?$"/></suggestion>.\nBitte
beachten Sie, dass etwaige Ajektive an das neue Genus angepasst werden
müssen.</message>
<example type="correct">Er hat
<marker>Bauchschmerzen</marker>.</example>
<example type="incorrect"
correction="Bauchschmerz|Bauchschmerzen">Er hat
<marker>Bauchweh</marker>.</example>
<example type="incorrect">Wegen des starken
<marker>Zahnwehs</marker>...</example>
</rule>
- -->
+
<rulegroup id="AUF_OFFEN" name="Umgangssprache: 'auf (offen)'">
<rule>
<pattern>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
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