Package org.languagetool.rules

Examples of org.languagetool.rules.Category


    switch (qName) {
      case "category":
        final String catName = attrs.getValue(NAME);
        final String priorityStr = attrs.getValue("priority");
        if (priorityStr == null) {
          category = new Category(catName);
        } else {
          category = new Category(catName, Integer.parseInt(priorityStr));
        }
        if ("off".equals(attrs.getValue(DEFAULT))) {
          category.setDefaultOff();
        }
        if (attrs.getValue(TYPE) != null) {
View Full Code Here


      i++;
    }
  }

  public void testOverlapFilter() throws IOException {
    final Category category = new Category("test category");
    final List<Element> elements1 = Arrays.asList(new Element("one", true, false, false));
    final PatternRule rule1 = new PatternRule("id1", new English(), elements1, "desc1", "msg1", "shortMsg1");
    rule1.setSubId("1");
    rule1.setCategory(category);
View Full Code Here

  private final Set<String> requiresA;
  private final Set<String> requiresAn;

  public AvsAnRule(final ResourceBundle messages) {
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_misc")));
    }
    requiresA = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream(FILENAME_A));
    requiresAn = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream(FILENAME_AN));
    setLocQualityIssueType(ITSIssueType.Misspelling);
    addExamplePair(Example.wrong("The train arrived <marker>a hour</marker> ago."),
View Full Code Here

    return FILE_NAME;
  }

  public ContractionSpellingRule(final ResourceBundle messages) throws IOException {
    super(messages);
    super.setCategory(new Category("Possible Typo"));
    setLocQualityIssueType(ITSIssueType.Misspelling);
    addExamplePair(Example.wrong("We <marker>havent</marker> earned anything."),
                   Example.fixed("We <marker>haven't</marker> earned anything."));
  }
View Full Code Here

TOP

Related Classes of org.languagetool.rules.Category

Copyright © 2018 www.massapicom. 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.