Package org.languagetool.rules

Examples of org.languagetool.rules.MultipleWhitespaceRule


  @Override
  public List<Rule> getRelevantRules(ResourceBundle messages) {
    return Arrays.asList(
            new DoublePunctuationRule(messages),
            new MultipleWhitespaceRule(messages, this)
    );
  }
View Full Code Here


        //            new DoublePunctuationRule(messages),
        new MorfologikUkrainianSpellerRule(messages, this),
        new MixedAlphabetsRule(messages),
        // TODO: does not handle dot in abbreviations in the middle of the sentence, and also !.., ?..         
        //            new UppercaseSentenceStartRule(messages),
        new MultipleWhitespaceRule(messages, this),
        // specific to Ukrainian:
        new SimpleReplaceRule(messages),
        new TokenAgreementRule(messages)
    );
  }
View Full Code Here

import java.io.IOException;

public class MultipleWhitespaceRuleTest extends TestCase {

  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);
  }
View Full Code Here

  @Override
  public List<Rule> getRelevantRules(ResourceBundle messages) {
    return Arrays.asList(
            new DoublePunctuationRule(messages),
            new MultipleWhitespaceRule(messages, this)
    );
  }
View Full Code Here

TOP

Related Classes of org.languagetool.rules.MultipleWhitespaceRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.