Class Example

java.lang.Object
org.languagetool.rules.Example

public final class Example extends Object
Helper class to create error examples. For internal use by LanguageTool only.
Since:
2.5
  • Constructor Details

    • Example

      private Example()
  • Method Details

    • wrong

      public static IncorrectExample wrong(String example)
      Create an example text (usually just one sentence) with an error - the error must be marked with <marker>...</marker>.
      Throws:
      IllegalArgumentException - if the <marker>...</marker> is missing
      Since:
      2.5
    • fixed

      public static CorrectExample fixed(String example)
      Create an example text (usually just one sentence) without an error - the fixed error (compared to the text created with wrong(String)) can be marked with <marker>...</marker>.
      Since:
      2.5, return type modified in 3.5
    • requireMarkup

      private static void requireMarkup(String example)