Examples of activateDefaultFalseFriendRules()


Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

    final List<RuleMatch> matches1 = assertErrors(1, "And forDemoOnly.", langTool1);
    assertEquals("DEMO_ENTRY", matches1.get(0).getRule().getId());

    final JLanguageTool langTool2 = new JLanguageTool(new English(), new German());
    langTool2.disableRule(MorfologikBritishSpellerRule.RULE_ID);
    langTool2.activateDefaultFalseFriendRules();
    final List<RuleMatch> matches2 = assertErrors(1, "And forDemoOnly.", langTool2);
    assertEquals("DEMO_ENTRY", matches2.get(0).getRule().getId());

    final JLanguageTool langTool3 = new JLanguageTool(new AmericanEnglish(), new German());
    langTool3.disableRule(MorfologikAmericanSpellerRule.RULE_ID);
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

    final List<RuleMatch> matches2 = assertErrors(1, "And forDemoOnly.", langTool2);
    assertEquals("DEMO_ENTRY", matches2.get(0).getRule().getId());

    final JLanguageTool langTool3 = new JLanguageTool(new AmericanEnglish(), new German());
    langTool3.disableRule(MorfologikAmericanSpellerRule.RULE_ID);
    langTool3.activateDefaultFalseFriendRules();
    assertErrors(0, "And forDemoOnly.", langTool3);
  }

  public void testHintsForEnglishSpeakers() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool langTool = new JLanguageTool(new German(), new English());
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

    assertErrors(0, "And forDemoOnly.", langTool3);
  }

  public void testHintsForEnglishSpeakers() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool langTool = new JLanguageTool(new German(), new English());
    langTool.activateDefaultFalseFriendRules();
    assertErrors(1, "Man sollte ihn nicht so beraten.", langTool);
    assertErrors(0, "Man sollte ihn nicht so beschimpfen.", langTool);
    assertErrors(1, "Ich gehe in Blubbstadt zur Hochschule.", langTool);
  }
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

    assertErrors(1, "Ich gehe in Blubbstadt zur Hochschule.", langTool);
  }

  public void testHintsForPolishSpeakers() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool langTool = new JLanguageTool(new English(), new Polish());
    langTool.activateDefaultFalseFriendRules();
    assertErrors(1, "This is an absurd.", langTool);
    assertErrors(0, "This is absurdity.", langTool);
    assertSuggestions(0, "This is absurdity.", langTool);
    assertErrors(1, "I have to speak to my advocate.", langTool);
    assertSuggestions(3, "My brother is politic.", langTool);
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

      for (int i = 0; i < this.testRuns; i++) {
        try {
          JLanguageTool tool = new JLanguageTool(this.language);
          tool.activateDefaultPatternRules();
          tool.activateDefaultFalseFriendRules();
         
          Assert.assertNotNull(tool.check(this.sampleText));
        } catch (Exception e) {         
          failedTests += 1;
         
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

  }

  public void testCheck() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool tool = new JLanguageTool(TestTools.getDemoLanguage());
    tool.activateDefaultPatternRules();
    tool.activateDefaultFalseFriendRules();

    int matches = CommandLineTools.checkText("Foo.", tool);
    String output = new String(this.out.toByteArray());
    assertEquals(0, output.indexOf("Time:"));
    assertEquals(0, matches);
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

public class ToolsTest extends TestCase {

  public void testCheck() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool tool = new JLanguageTool(new Polish());
    tool.activateDefaultPatternRules();
    tool.activateDefaultFalseFriendRules();

    List<RuleMatch> matches = tool.check("To jest całkowicie prawidłowe zdanie.");
    assertEquals(0, matches.size());

    List<RuleMatch> matches2 = tool.check("To jest problem problem.");
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

  }

  public void testCorrect() throws IOException, ParserConfigurationException, SAXException {
    JLanguageTool tool = new JLanguageTool(new Polish());
    tool.activateDefaultPatternRules();
    tool.activateDefaultFalseFriendRules();

    String correct = Tools.correctText("To jest całkowicie prawidłowe zdanie.", tool);
    assertEquals("To jest całkowicie prawidłowe zdanie.", correct);
    correct = Tools.correctText("To jest jest problem.", tool);
    assertEquals("To jest problem.", correct);
View Full Code Here

Examples of org.languagetool.JLanguageTool.activateDefaultFalseFriendRules()

public class ToolsTest extends TestCase {

  public void testCorrect() throws IOException, ParserConfigurationException, SAXException {
    final JLanguageTool tool = new JLanguageTool(new English());
    tool.activateDefaultPatternRules();
    tool.activateDefaultFalseFriendRules();
    assertEquals("This is a test.", Tools.correctText("This is an test.", tool));
  }
 
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.