Back to LanguageTool Homepage - Privacy - Imprint

Don't put a space before a full stop


(Tone) #1

I cannot find the rule that creates the message: "Don't put a space before a full stop."

I can create the issue by using an ellipsis, for example:

Jan was born on . . . Street in Warsaw.

I have always preferred to use dot space dot space dot space rather than dot dot dot.

That is, I prefer:

. . .
instead of
...

Where can I find this rule?


(Daniel Naber) #2

Am Di 11.09.2012, 17:52:22 schrieben Sie:

I cannot find the rule that creates the message: "Don't put a space
before a full stop."

That's a rule coded in Java. The source code is here:

http://languagetool.svn.sourceforge.net/viewvc/languagetool/trunk/JLanguageTool/src/main/java/org/languagetool/rules/CommaWhitespaceRule.java?view=markup

Of course, if you just want to disable that rule, you can do so in the
configuration dialog.

Regards
Daniel

--
http://www.danielnaber.de


(Tone) #3

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?


(Tone) #4

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, http://en.wikipedia.org/wiki/Ellipsis , 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.

Thoughts?


(Daniel Naber) #5

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)?


(Tone) #6

That rule does nothing to turn off the warning.

Regards.


(Tone) #7

And yes, I am using version 1.8.


(Daniel Naber) #8

On Do 13.09.2012, 08:38:14 you wrote:

That rule does nothing to turn off the warning.

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?

Regards
Daniel

--
http://www.danielnaber.de


(Tone) #9

I needed to turn off the AOO QuickStart to get that rule to work.

So, yes, that rule turns it off, but it turns off other important stuff.

For example, the following sentence SHOULD give a warning:

"This should , give a warning."

Did you look at the code snippet I suggested?


(Daniel Naber) #10

On Do 13.09.2012, 10:12:02 you wrote:

Did you look at the code snippet I suggested?

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.

Regards
Daniel

--
http://www.danielnaber.de


(Tone) #11

Thank you.


(Daniel Naber) #12

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?


(Tone) #13

Hi

I wrote this by hand by just looking at the source code. I don't have a development environment for java.

Could you add it, then test it? It seems pretty straightforward.

Regards,

\Tone


(Daniel Naber) #14

This has now been added and it's available in the latest snapshot at http://www.languagetool.org/download/snapshots/?C=M;O=D

Thanks for your report again and please let us know if there's a problem with the feature.


(Tone) #15

1.9-dev

This is a screenshot that shows the issue still occurs.


(Daniel Naber) #16

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?


(Tone) #17

Three dots can only exist within a sentence.

Four dots can only 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.

:smile:

Regards


(Daniel Naber) #18

On Fr 14.09.2012, 16:55:48 you wrote:

Which means that if you drop this issue, I won't lose sleep over it. Your
tool has already helped me a lot.

Indeed I have to give up for now, changing the sentence splitting is now
becoming a bit too complex for this feature, sorry.

Regards
Daniel

--
http://www.danielnaber.de