Well, I looked for that rule in the configuration.
I found the “Smart ellipsis (. . . )” rule under the “Miscellaneous” section. That converts three dots into some special ellipsis character. That’s not the same thing.
I also found “Use of two consecutive dots or commas.” Again, that’s not the same thing.
In fact, I turned off the entire “Miscellaneous” section, which unchecked all the rules of that section, and I still get the message.
Is there a separate configuration window for rules coded in java?
OK, how about adding something like this to the java code you mentioned?
// exception case for spaced ellipsis, i.e. " . . . "
if (i + 4 < tokens.length
&& isDot(tokens[i + 2].getToken())
&& isDot(tokens[i + 4].getToken()) ) {
msg = null;
}
// exception case for spaced end ellipsis, i.e. " . . . ."
if (i + 6 < tokens.length
&& isDot(tokens[i + 2].getToken())
&& isDot(tokens[i + 4].getToken())
&& isDot(tokens[i + 6].getToken()) ) {
msg = null;
}
You would also need to define the isDot() function.
static boolean isDot(final String str) {
final char c = str.charAt(0);
return (c == ‘.’ );
}
This is, of course, a style issue. The wiki page, Ellipsis - Wikipedia , says the following:
“The Chicago Manual of Style recommends that an ellipsis be formed by typing three periods, each with a space on both sides.”
I suppose I could just ignore the blue wavy lines indicating this is an error. I don’t really want to turn off the full CommaWhitespaceRule because there is a lot of other good stuff in there.
The rule is called “Use of whitespace before comma and before/after parentheses” and it should be in the Miscellaneous section. If it isn’t, are you using the latest version of LanguageTool (1.8)?
That’s strange, it works for me with your original example. Does restarting
OpenOffice help? Does it save the setting, i.e. does the checkbox keep its
state?
Yes, thanks for looking into it. I forwarded this to our development
mailing list to see if there are any objections. If not, I’ll add your code
for the next release.
It seems nobody on the development list has a problem with this change (as long as it’s specific to English and doesn’t affect other languages). Are you interested in submitting a complete patch?
For some strange reason, it worked in my local development environment. But now I see what the problem is: " . . . " is also a sentence delimiter (actually each dot is). So we’d have to change the way sentences are detected, as the rules only work on single sentences. The question is whether " . . . " only occurs in a sentence or whether it can also end a sentence?
I suppose this isn’t critical. It’s a style issue, only. The Chicago Manual of Style isn’t necessarily the only way to do it. I particularly like the spaced out ellipses, but others like SmartEllipses, and still others like three (or four) dots without spaces.
Which means that if you drop this issue, I won’t lose sleep over it. Your tool has already helped me a lot.