So the new patch looks like this but I will try to create a new rule...
Since this is the first time… any help is appreciated also in testing it.
What about the % sign?
Ciao
Paolo
### Eclipse Workspace Patch 1.0
#P languagetool
Index:
languagetool-core/src/main/java/org/languagetool/rules/CommaWhitespaceRule.java
===================================================================
---
languagetool-core/src/main/java/org/languagetool/rules/CommaWhitespaceRule.java
(revision 9815)
+++
languagetool-core/src/main/java/org/languagetool/rules/CommaWhitespaceRule.java
(working copy)
@@ -100,7 +100,23 @@
&& isNumberOrDot(tokens[i + 1].getToken())) {
msg = null;
}
+/* 3607406 + */
+// }
+ } else if (token.equals(":")) {
+ msg = messages.getString("no_space_before_colon");
+ suggestionText = ":";
+ fixLen = 1;
+ // exception case for figures such as "1 : 0"
+ if (i + 1 < tokens.length
+ && isNumberOrDot(tokens[i + 1].getToken())) {
+ msg = null;
+ }
+ } else if (token.equals(";")) {
+ msg = messages.getString("no_space_before_semicolon");
+ suggestionText = ";";
+ fixLen = 1;
}
+/* 3607406 - */
}
if (msg != null) {
final int fromPos = tokens[i - 1].getStartPos();
Index:
languagetool-core/src/main/resources/org/languagetool/MessagesBundle.properties
===================================================================
---
languagetool-core/src/main/resources/org/languagetool/MessagesBundle.properties
(revision 9815)
+++
languagetool-core/src/main/resources/org/languagetool/MessagesBundle.properties
(working copy)
@@ -203,6 +203,14 @@
no_space_before_dot = Don't put a space before the full stop
+# 3607406 +
+
+no_space_before_colon = Don't put a space before the colon
+
+no_space_before_semicolon = Don't put a space before the semicolon
+
+# 3607406 -
+
pl = Polish
repetition = Possible typo: you repeated a word
On Apr 5, 2013, at 11:04 AM, Daniel Naber wrote:
> On 05.04.2013, 10:33:34 Paolo Bianchini wrote:
>
> Hi Paolo,
>
>> I coded and tested the following patch.
>>
>> Would it be ok?
>
> the change looks good, but I'm not sure about false alarms. Especially the
> colon rule looks like it might have exceptions.... for example, what about
> soccer results, can they be written "0 : 1" and would that trigger the
> rule? Have you tested this on Wikipedia text?
>
> Regards
> Daniel
>
> --
> http://www.danielnaber.de
>
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Languagetool-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/languagetool-devel
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Languagetool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-devel