Search in sources :

Example 6 with Rule

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

the class AmericanEnglish method getRelevantRules.

@Override
public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
    List<Rule> rules = new ArrayList<>();
    rules.addAll(super.getRelevantRules(messages));
    rules.add(new MorfologikAmericanSpellerRule(messages, this));
    return rules;
}
Also used : ArrayList(java.util.ArrayList) MorfologikAmericanSpellerRule(org.languagetool.rules.en.MorfologikAmericanSpellerRule) Rule(org.languagetool.rules.Rule) MorfologikAmericanSpellerRule(org.languagetool.rules.en.MorfologikAmericanSpellerRule)

Example 7 with Rule

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

the class NewZealandEnglish method getRelevantRules.

@Override
public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
    List<Rule> rules = new ArrayList<>();
    rules.addAll(super.getRelevantRules(messages));
    rules.add(new MorfologikNewZealandSpellerRule(messages, this));
    rules.add(new NewZealandReplaceRule(messages));
    return rules;
}
Also used : ArrayList(java.util.ArrayList) NewZealandReplaceRule(org.languagetool.rules.en.NewZealandReplaceRule) MorfologikNewZealandSpellerRule(org.languagetool.rules.en.MorfologikNewZealandSpellerRule) Rule(org.languagetool.rules.Rule) MorfologikNewZealandSpellerRule(org.languagetool.rules.en.MorfologikNewZealandSpellerRule) NewZealandReplaceRule(org.languagetool.rules.en.NewZealandReplaceRule)

Example 8 with Rule

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

the class MorfologikAmericanSpellerRuleTest method testSuggestions.

@Test
public void testSuggestions() throws IOException {
    Language language = new AmericanEnglish();
    Rule rule = new MorfologikAmericanSpellerRule(TestTools.getMessages("en"), language);
    super.testNonVariantSpecificSuggestions(rule, language);
}
Also used : Language(org.languagetool.Language) AmericanEnglish(org.languagetool.language.AmericanEnglish) Rule(org.languagetool.rules.Rule) Test(org.junit.Test)

Example 9 with Rule

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

the class MorfologikAustralianSpellerRuleTest method testSuggestions.

@Test
public void testSuggestions() throws IOException {
    Language language = new AustralianEnglish();
    Rule rule = new MorfologikAustralianSpellerRule(TestTools.getMessages("en"), language);
    super.testNonVariantSpecificSuggestions(rule, language);
}
Also used : Language(org.languagetool.Language) Rule(org.languagetool.rules.Rule) AustralianEnglish(org.languagetool.language.AustralianEnglish) Test(org.junit.Test)

Example 10 with Rule

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

the class MorfologikNewZealandSpellerRuleTest method testSuggestions.

@Test
public void testSuggestions() throws IOException {
    Language language = new NewZealandEnglish();
    Rule rule = new MorfologikNewZealandSpellerRule(TestTools.getMessages("en"), language);
    super.testNonVariantSpecificSuggestions(rule, language);
}
Also used : Language(org.languagetool.Language) NewZealandEnglish(org.languagetool.language.NewZealandEnglish) Rule(org.languagetool.rules.Rule) Test(org.junit.Test)

Aggregations

Rule (org.languagetool.rules.Rule)67 JLanguageTool (org.languagetool.JLanguageTool)16 PatternRule (org.languagetool.rules.patterns.PatternRule)15 ArrayList (java.util.ArrayList)14 RuleMatch (org.languagetool.rules.RuleMatch)14 AbstractPatternRule (org.languagetool.rules.patterns.AbstractPatternRule)12 Test (org.junit.Test)11 Language (org.languagetool.Language)11 IncorrectExample (org.languagetool.rules.IncorrectExample)8 English (org.languagetool.language.English)7 SpellingCheckRule (org.languagetool.rules.spelling.SpellingCheckRule)7 File (java.io.File)6 PatternToken (org.languagetool.rules.patterns.PatternToken)6 AnalyzedSentence (org.languagetool.AnalyzedSentence)5 AmericanEnglish (org.languagetool.language.AmericanEnglish)5 BitextRule (org.languagetool.rules.bitext.BitextRule)5 GermanSpellerRule (org.languagetool.rules.de.GermanSpellerRule)4 DisambiguationPatternRule (org.languagetool.tagging.disambiguation.rules.DisambiguationPatternRule)4 FileReader (java.io.FileReader)3 IOException (java.io.IOException)3