Search in sources :

Example 1 with MultipleWhitespaceRule

use of org.languagetool.rules.MultipleWhitespaceRule in project languagetool by languagetool-org.

the class MultipleWhitespaceRuleTest method testRule.

@Test
public void testRule() throws IOException {
    final MultipleWhitespaceRule rule = new MultipleWhitespaceRule(TestTools.getEnglishMessages(), new Polish());
    final JLanguageTool langTool = new JLanguageTool(new Polish());
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("To jest test.")).length);
    assertEquals(1, rule.match(langTool.getAnalyzedSentence("To jest   test.")).length);
}
Also used : Polish(org.languagetool.language.Polish) JLanguageTool(org.languagetool.JLanguageTool) MultipleWhitespaceRule(org.languagetool.rules.MultipleWhitespaceRule) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 JLanguageTool (org.languagetool.JLanguageTool)1 Polish (org.languagetool.language.Polish)1 MultipleWhitespaceRule (org.languagetool.rules.MultipleWhitespaceRule)1