Search in sources :

Example 1 with Romanian

use of org.languagetool.language.Romanian in project languagetool by languagetool-org.

the class CompoundRuleTest method setUp.

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

Example 2 with Romanian

use of org.languagetool.language.Romanian in project languagetool by languagetool-org.

the class GenericUnpairedBracketsRuleTest method testRomanianRule.

@Test
public void testRomanianRule() throws IOException {
    langTool = new JLanguageTool(new Romanian());
    rule = org.languagetool.rules.GenericUnpairedBracketsRuleTest.getBracketsRule(langTool);
    // correct sentences:
    assertMatches("A fost plecat (pentru puțin timp).", 0);
    assertMatches("Nu's de prin locurile astea.", 0);
    assertMatches("A fost plecat pentru „puțin timp”.", 0);
    assertMatches("A fost plecat „pentru... puțin timp”.", 0);
    assertMatches("A fost plecat „pentru... «puțin» timp”.", 0);
    // correct sentences ( " is _not_ a Romanian symbol - just
    // ignore it, the correct form is [„] (start quote) and [”] (end quote)
    assertMatches("A fost plecat \"pentru puțin timp.", 0);
    // incorrect sentences:
    assertMatches("A fost )plecat( pentru (puțin timp).", 2);
    assertMatches("A fost {plecat) pentru (puțin timp}.", 4);
    assertMatches("A fost plecat „pentru... puțin timp.", 1);
    assertMatches("A fost plecat «puțin.", 1);
    assertMatches("A fost plecat „pentru «puțin timp”.", 3);
    assertMatches("A fost plecat „pentru puțin» timp”.", 3);
    assertMatches("A fost plecat „pentru... puțin» timp”.", 3);
    assertMatches("A fost plecat „pentru... «puțin” timp».", 4);
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) Romanian(org.languagetool.language.Romanian) Test(org.junit.Test)

Example 3 with Romanian

use of org.languagetool.language.Romanian in project languagetool by languagetool-org.

the class SimpleReplaceRuleTest method setUp.

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

Example 4 with Romanian

use of org.languagetool.language.Romanian in project languagetool by languagetool-org.

the class RomanianRuleDisambiguatorTest method setUp.

@Before
public void setUp() {
    tagger = new RomanianTagger();
    tokenizer = new RomanianWordTokenizer();
    Romanian language = new Romanian();
    sentenceTokenizer = new SRXSentenceTokenizer(language);
    disambiguator = new XmlRuleDisambiguator(language);
    disamb2 = new DemoDisambiguator();
}
Also used : RomanianTagger(org.languagetool.tagging.ro.RomanianTagger) DemoDisambiguator(org.languagetool.tagging.disambiguation.xx.DemoDisambiguator) Romanian(org.languagetool.language.Romanian) RomanianWordTokenizer(org.languagetool.tokenizers.ro.RomanianWordTokenizer) XmlRuleDisambiguator(org.languagetool.tagging.disambiguation.rules.XmlRuleDisambiguator) SRXSentenceTokenizer(org.languagetool.tokenizers.SRXSentenceTokenizer) Before(org.junit.Before)

Aggregations

Romanian (org.languagetool.language.Romanian)4 Before (org.junit.Before)3 JLanguageTool (org.languagetool.JLanguageTool)3 Test (org.junit.Test)1 XmlRuleDisambiguator (org.languagetool.tagging.disambiguation.rules.XmlRuleDisambiguator)1 DemoDisambiguator (org.languagetool.tagging.disambiguation.xx.DemoDisambiguator)1 RomanianTagger (org.languagetool.tagging.ro.RomanianTagger)1 SRXSentenceTokenizer (org.languagetool.tokenizers.SRXSentenceTokenizer)1 RomanianWordTokenizer (org.languagetool.tokenizers.ro.RomanianWordTokenizer)1