Search in sources :

Example 51 with JLanguageTool

use of org.languagetool.JLanguageTool in project languagetool by languagetool-org.

the class ReflexiveVerbsRuleTest method setUp.

@Before
public void setUp() throws IOException {
    rule = new ReflexiveVerbsRule(TestTools.getEnglishMessages());
    langTool = new JLanguageTool(new Catalan());
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) Catalan(org.languagetool.language.Catalan) Before(org.junit.Before)

Example 52 with JLanguageTool

use of org.languagetool.JLanguageTool in project languagetool by languagetool-org.

the class AgreementRuleTest method testRegression.

@Test
public void testRegression() throws IOException {
    JLanguageTool lt = new JLanguageTool(new GermanyGerman());
    // used to be not detected > 1.0.1:
    String str = "Und so.\r\nDie Bier.";
    List<RuleMatch> matches = lt.check(str);
    assertEquals(1, matches.size());
}
Also used : RuleMatch(org.languagetool.rules.RuleMatch) JLanguageTool(org.languagetool.JLanguageTool) GermanyGerman(org.languagetool.language.GermanyGerman) Test(org.junit.Test)

Example 53 with JLanguageTool

use of org.languagetool.JLanguageTool in project languagetool by languagetool-org.

the class AgreementRuleTest method setUp.

@Before
public void setUp() throws IOException {
    rule = new AgreementRule(TestTools.getMessages("de"), new GermanyGerman());
    lt = new JLanguageTool(new GermanyGerman());
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) GermanyGerman(org.languagetool.language.GermanyGerman) Before(org.junit.Before)

Example 54 with JLanguageTool

use of org.languagetool.JLanguageTool in project languagetool by languagetool-org.

the class CompoundRuleTest method setUp.

@Before
public void setUp() throws Exception {
    lt = new JLanguageTool(new German());
    rule = new CompoundRule(TestTools.getMessages("de"));
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) German(org.languagetool.language.German) Before(org.junit.Before)

Example 55 with JLanguageTool

use of org.languagetool.JLanguageTool in project languagetool by languagetool-org.

the class SimpleReplaceBalearicRuleTest method setUp.

@Before
public void setUp() throws Exception {
    rule = new SimpleReplaceBalearicRule(TestTools.getMessages("ca"));
    langTool = new JLanguageTool(new Catalan());
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) Catalan(org.languagetool.language.Catalan) Before(org.junit.Before)

Aggregations

JLanguageTool (org.languagetool.JLanguageTool)184 Test (org.junit.Test)109 RuleMatch (org.languagetool.rules.RuleMatch)57 Before (org.junit.Before)38 German (org.languagetool.language.German)16 Rule (org.languagetool.rules.Rule)16 Catalan (org.languagetool.language.Catalan)14 Ukrainian (org.languagetool.language.Ukrainian)14 English (org.languagetool.language.English)13 Polish (org.languagetool.language.Polish)12 Language (org.languagetool.Language)10 GermanyGerman (org.languagetool.language.GermanyGerman)9 PatternRule (org.languagetool.rules.patterns.PatternRule)9 AnalyzedSentence (org.languagetool.AnalyzedSentence)8 File (java.io.File)7 AnalyzedTokenReadings (org.languagetool.AnalyzedTokenReadings)6 Dutch (org.languagetool.language.Dutch)5 French (org.languagetool.language.French)5 ArrayList (java.util.ArrayList)4 FakeLanguage (org.languagetool.FakeLanguage)4