Examples of English


Examples of org.languagetool.language.English

  private JLanguageTool langTool;

  @Override
  public void setUp() throws IOException {
    rule = new AvsAnRule(null);
    langTool = new JLanguageTool(new English());
  }
View Full Code Here

Examples of org.languagetool.language.English

  }
 
  public void testPositions() throws IOException {
    final AvsAnRule rule = new AvsAnRule(null);
    RuleMatch[] matches;
    final JLanguageTool langTool = new JLanguageTool(new English());
    // no quotes etc.:
    matches = rule.match(langTool.getAnalyzedSentence("a industry standard."));
    assertEquals(0, matches[0].getFromPos());
    assertEquals(1, matches[0].getToPos());
   
View Full Code Here

Examples of org.languagetool.language.English

  private Rule rule;
  private JLanguageTool langTool;
 
  @Override
  public void setUp() throws IOException {
    rule = new EnglishUnpairedBracketsRule(TestTools.getEnglishMessages(), new English());
    langTool = new JLanguageTool(new English());
  }
View Full Code Here

Examples of org.languagetool.language.English

    final RuleMatch[] matches = rule.match(langTool.getAnalyzedSentence(sentence));
    assertEquals(1, matches.length);
  }
 
  public void testMultipleSentences() throws IOException {
    final JLanguageTool tool = new JLanguageTool(new English());
    tool.enableRule("EN_UNPAIRED_BRACKETS");

    List<RuleMatch> matches;
    matches = tool
        .check("This is multiple sentence text that contains a bracket: "
View Full Code Here

Examples of org.languagetool.language.English

    if (!"-".equals(filename)) {
      if (autoDetect) {
        Language language = detectLanguageOfFile(filename, encoding);
        if (language == null) {
          System.err.println("Could not detect language well enough, using English");
          language = new English();
        }
        changeLanguage(language, motherTongue, disabledRules, enabledRules);
        System.out.println("Using " + language.getName() + " for file " + filename);
      }
      final File file = new File(filename);
View Full Code Here

Examples of org.languagetool.language.English

          // to detect language from the first input line
          if (lineCount == 1 && autoDetect) {
            Language language = detectLanguageOfString(line);
            if (language == null) {
              System.err.println("Could not detect language well enough, using English");
              language = new English();
            }
            System.out.println("Language used is: " + language.getName());
            language.getSentenceTokenizer().setSingleLineBreaksMarksParagraph(
                    singleLineBreakMarksParagraph);
            changeLanguage(language, motherTongue, disabledRules, enabledRules);
View Full Code Here

Examples of org.languagetool.language.English

    if (options.getLanguage() == null) {
      if (!options.isApiFormat() && !options.isAutoDetect()) {
        System.err.println("No language specified, using English");
      }
      options.setLanguage(new English());
    } else if (!options.isApiFormat() && !options.isApplySuggestions()) {
      System.out.println("Expected text language: " + options.getLanguage().getName());
    }

    options.getLanguage().getSentenceTokenizer().setSingleLineBreaksMarksParagraph(
View Full Code Here

Examples of org.languagetool.language.English

public class CompoundRuleTest extends CompoundRuleTestAbs {

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    langTool = new JLanguageTool(new English());
    rule = new CompoundRule(null);
  }
View Full Code Here

Examples of org.languagetool.language.English

  @Test
  public void testGetMessageBundle() throws Exception {
    final ResourceBundle bundle1 = JLanguageTool.getMessageBundle(new German());
    assertThat(bundle1.getString("de"), is("Deutsch"));

    final ResourceBundle bundle2 = JLanguageTool.getMessageBundle(new English());
    assertThat(bundle2.getString("de"), is("German"));

    final ResourceBundle bundle3 = JLanguageTool.getMessageBundle(new AmericanEnglish());
    assertThat(bundle3.getString("de"), is("German"));
  }
View Full Code Here

Examples of org.languagetool.language.English

    assertEquals(4, JLanguageTool.countLineBreaks("\nZweite\nDritte\n\n"));
  }

  @Test
  public void testSentenceTokenize() throws IOException {
    JLanguageTool languageTool = new JLanguageTool(new English());
    List<String> sentences = languageTool.sentenceTokenize("This is a sentence! This is another one.");
    assertEquals(2, sentences.size());
    assertEquals("This is a sentence! ", sentences.get(0));
    assertEquals("This is another one.", sentences.get(1));
  }
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.