Package org.languagetool.rules

Examples of org.languagetool.rules.Category


      .compile("&quot|&gt|&lt|&amp|[0-9].*|"
          + "M*(D?C{0,3}|C[DM])(L?X{0,3}|X[LC])(V?I{0,3}|I[VX])$");

  public RussianWordRepeatRule(final ResourceBundle messages) {
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_misc")));
    }
    setDefaultOff();   // set default off
  }
View Full Code Here


  // space before and after colon ':' in URL with common schemes.
  private static final Pattern urlPattern = Pattern.compile("^(file|s?ftp|finger|git|gopher|hdl|https?|shttp|imap|mailto|mms|nntp|s?news(post|reply)?|prospero|rsync|rtspu|sips?|svn|svn\\+ssh|telnet|wais)$");

  public QuestionWhitespaceRule(final ResourceBundle messages) {
    // super(messages);
    super.setCategory(new Category(messages.getString("category_misc")));
  }
View Full Code Here

 
  private boolean prevSentenceEndsWithNumber = false;

  public SentenceWhitespaceRule(ResourceBundle messages) {
    super(messages);
    super.setCategory(new Category(messages.getString("category_misc")));
    setLocQualityIssueType(ITSIssueType.Whitespace);
  }
View Full Code Here

            new Element("Dank", true, false, false)), "", "", "");
    rule2 = new PatternRule("internal", language, Arrays.asList(
            new Element("Herzlichen", true, false, false),
            new Element("Glückwunsch", true, false, false)), "", "", "");
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_grammar")));
    }
    setDefaultOff();
    addExamplePair(Example.wrong("<marker>In diesem Satz kein Wort.</marker>"),
                   Example.fixed("In diesem Satz <marker>fehlt</marker> kein Wort."));
  }
View Full Code Here

  }

  public SimpleReplaceRule(final ResourceBundle messages) throws IOException {
    super(messages);
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_misc")));
    }
    wrongWords = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream(getFileName()));
  }
View Full Code Here

  public void testRuleMatchesToXMLWithCategory() throws IOException {
    final List<RuleMatch> matches = new ArrayList<>();
    final String text = "This is a test sentence.";
    final List<Element> elements = Collections.emptyList();
    final Rule patternRule = new PatternRule("MY_ID", language, elements, "my description", "my message", "short message");
    patternRule.setCategory(new Category("MyCategory"));
    final RuleMatch match = new RuleMatch(patternRule, 8, 10, "myMessage");
    match.setColumn(99);
    match.setEndColumn(100);
    match.setLine(44);
    match.setEndLine(45);
View Full Code Here

  private static final String FILE_NAME = "/fa/replace.txt";

  public SimpleReplaceRule(ResourceBundle messages) throws IOException {
    super(messages);
    super.setCategory(new Category("‫اشتباه تایپی محتمل‬"));
    setLocQualityIssueType(ITSIssueType.Misspelling);
    addExamplePair(Example.wrong("وی <marker>حاظر</marker> به همکاری شد."),
                   Example.fixed("وی <marker>حاضر</marker> به همکاری شد."));
  }
View Full Code Here

  }

  public SimpleReplaceRule(final ResourceBundle messages) throws IOException {
    super(messages);
    setLocQualityIssueType(ITSIssueType.Misspelling);
    setCategory(new Category("Vergissingen"));
    setCheckLemmas(false);
    addExamplePair(Example.wrong("<marker>ofzo</marker>."),
                   Example.fixed("<marker>of zo</marker>."));
  }
View Full Code Here

*/
public class WiederVsWiderRule extends GermanRule {

  public WiederVsWiderRule(ResourceBundle messages) {
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_typo")));
    }
    addExamplePair(Example.wrong("Das spiegelt die Situation in Deutschland <marker>wieder</marker>."),
                   Example.fixed("Das spiegelt die Situation in Deutschland <marker>wider</marker>."));
  }
View Full Code Here

*/
public class DashRule extends GermanRule {

  public DashRule(final ResourceBundle messages) {
    if (messages != null) {
      super.setCategory(new Category(messages.getString("category_misc")));
    }
    addExamplePair(Example.wrong("Bundestag beschließt <marker>Diäten- Erhöhung</marker>"),
                   Example.fixed("Bundestag beschließt <marker>Diäten-Erhöhung</marker>"));
  }
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.