Enum Class TextPolicy

java.lang.Object
java.lang.Enum<TextPolicy>
org.apache.tika.parser.pages.TextPolicy
All Implemented Interfaces:
Serializable, Comparable<TextPolicy>, Constable

public enum TextPolicy extends Enum<TextPolicy>
Where a page's text comes from: the document's own text, OCR of the rendered page, both, the per-page verdict, or nowhere. The "text" of PagesConfig.
Since:
Apache Tika 4.1
  • Enum Constant Details

    • EXTRACT

      public static final TextPolicy EXTRACT
      The document's own text only; never OCR.
    • AUTO

      public static final TextPolicy AUTO
      The document's own text, OCR where the verdict says the page needs it.
    • EXTRACT_AND_OCR

      public static final TextPolicy EXTRACT_AND_OCR
      Both, every page.
    • OCR

      public static final TextPolicy OCR
      OCR only; the document's own text is not read.
    • NONE

      public static final TextPolicy NONE
      No text from any source; pages are still rendered for annotators, inference and emission.
  • Method Details

    • values

      public static TextPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TextPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • ocrs

      public boolean ocrs()
      Whether a page may be offered to a text recognizer under this policy.