In response to the answer of Daniel in the bug report (LanguageTool / Bugs / #185 Sentence begin error detection not working in some cases)
Using this testcase I can reproduce the problem:
–TestLanguageToolBug.java–
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.List;
import org.junit.Test;
import org.languagetool.JLanguageTool;
import org.languagetool.language.German;
import org.languagetool.language.GermanyGerman;
import org.languagetool.rules.RuleMatch;
public class TestLanguageToolBug {
@Test
public void testLanguageToolBug() throws IOException {
String txt = " Wir heiraten am 19.09.12 und würden uns freuen, wenn Ihr diesen"
+ " ganz besonderen Tag mit uns feiern würdet. Zur kirchlichen Trauung"
+ " in der St. Wolfgangkirche in Regensburg laden wir um 11:00 Uhr ein."
+ " Danach werden wir gemeinsam im Gasthaus „Zur Post“ auf diesen Tag anstoßen und"
+ " beim gemeinsamen Essen feiern. Bitte gebt uns bis zum 02.09.12"
+ " Bescheid, ob Ihr kommen könnt. Wir freuen uns schon sehr auf Euch! ";
German language = new GermanyGerman();
JLanguageTool langTool = new JLanguageTool(language);
langTool.activateDefaultPatternRules();
langTool.disableRule(“WHITESPACE_RULE”);
List<RuleMatch> result = langTool.check(txt);
assertEquals(1, result.size());
assertEquals("Möglicher Rechtschreibfehler gefunden", result.get(0).getMessage());
}
}
–End TestLanguageToolBug.java–
I expect to get one rule match, because “Wolfgangkirche” is unkown. But instead I get three errors.
The text which I feed into the spellchecker is the result from a html2text transformation, as the user can input the text in a wysiwyg editor in my applicaton. Because of this I ignore the whitespace rule.
I have this maven dependencies in my pom:
<dependency>
<groupId>org.languagetool</groupId>
<artifactId>language-all</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.languagetool</groupId>
<artifactId>languagetool-server</artifactId>
<version>2.2</version>
</dependency>
Can you reproduce the problem using the testcase?
Thank you.
BTW: I did not get a notification that you wrote an anwser to the bug report … do i have to