Examples of English


Examples of org.languagetool.language.English

import org.languagetool.rules.WordRepeatRule;

public class RuleLinkTest extends TestCase {

  public void testBuildDeactivationLink() {
    final Language language = new English();
    final RuleLink ruleLink = RuleLink.buildDeactivationLink(new WordRepeatRule(TestTools.getMessages(language.getShortName()), language));
    assertEquals("WORD_REPEAT_RULE", ruleLink.getId());
    assertEquals("http://languagetool.org/deactivate/WORD_REPEAT_RULE", ruleLink.toString());
  }
View Full Code Here

Examples of org.languagetool.language.English

    assertEquals("WORD_REPEAT_RULE", ruleLink.getId());
    assertEquals("http://languagetool.org/deactivate/WORD_REPEAT_RULE", ruleLink.toString());
  }

  public void testBuildReactivationLink() {
    final Language language = new English();
    final RuleLink ruleLink = RuleLink.buildReactivationLink(new WordRepeatRule(TestTools.getMessages(language.getShortName()), language));
    assertEquals("WORD_REPEAT_RULE", ruleLink.getId());
    assertEquals("http://languagetool.org/reactivate/WORD_REPEAT_RULE", ruleLink.toString());
  }
View Full Code Here

Examples of org.languagetool.language.English

public class FalseFriendsAsBitextLoaderTest extends TestCase {

  public void testHintsForPolishTranslators() throws IOException, ParserConfigurationException, SAXException {
    final Polish polish = new Polish();
    final English english = new English();
    final JLanguageTool langTool = new JLanguageTool(english, polish);
    final JLanguageTool trgTool = new JLanguageTool(polish);
   
    final FalseFriendsAsBitextLoader ruleLoader = new FalseFriendsAsBitextLoader();
    final String name = "/false-friends.xml";
View Full Code Here

Examples of org.languagetool.language.English

    System.setOut(this.stdout);
    System.setErr(this.stderr);
  }
 
  public void testBitextCheck() throws IOException, ParserConfigurationException, SAXException {
    final English english = new English();
    final JLanguageTool srcTool = new JLanguageTool(english);
    final Polish polish = new Polish();
    final JLanguageTool trgTool = new JLanguageTool(polish);
    trgTool.activateDefaultPatternRules();
   
View Full Code Here

Examples of org.languagetool.language.English

    if (!isStdIn(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 (no spell checking active, " +
                "specify a language variant like 'en-GB' if available)");
      }
      options.setLanguage(new English());
    } else if (!options.isApiFormat() && !options.isApplySuggestions()) {
      languageHint = "Expected text language: " + options.getLanguage().getName();
    }

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

Examples of org.languagetool.language.English

 
  @Override
  public void setUp() {
    tagger = new EnglishTagger();
    tokenizer = new WordTokenizer();
    sentenceTokenizer = new SRXSentenceTokenizer(new English());
    disambiguator = new XmlRuleDisambiguator(new English());
    disamb2 = new DemoDisambiguator();
  }
View Full Code Here

Examples of org.languagetool.language.English

        // this doesn't work because the output rules file is not a legit rules file
        //TODO: fix this so we can have this functionality
        try {
          if (args[0].equals("--check")) {
            RuleCoverage checker = new RuleCoverage(new English());
            String inFile = args[1];
            checker.evaluateRules(inFile);
            System.exit(1);
          }
        } catch (Exception e) {
View Full Code Here

Examples of org.languagetool.language.English

public class WikipediaSentenceSourceTest {
 
  @Test
  public void testWikipediaSource() throws XMLStreamException, IOException {
    InputStream stream = WikipediaSentenceSourceTest.class.getResourceAsStream("/org/languagetool/dev/wikipedia/wikipedia-en.xml");
    WikipediaSentenceSource source = new WikipediaSentenceSource(stream, new English());
    assertTrue(source.hasNext());
    assertThat(source.next().getText(), is("This is the first document."));
    assertThat(source.next().getText(), is("It has three sentences."));
    assertThat(source.next().getText(), is("Here's the last sentence."));
   
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.