Class CategoryTable

java.lang.Object
opennlp.tools.tokenize.lattice.CategoryTable

final class CategoryTable extends Object
The char.def code point to category mappings over the Unicode code point range. The first category on a mapping supplies the unknown-word settings. Each listed category can keep a group running while following characters also list it.

The Basic Multilingual Plane is stored in a directly indexed array. The supplementary planes are stored as a sorted, non-overlapping range table searched by binary search, because dictionaries map them in a handful of large blocks.

  • Field Details

  • Constructor Details

    • CategoryTable

      private CategoryTable(CategoryTable.CategoryAssignment[] bmp, int[] rangeStart, int[] rangeEnd, CategoryTable.CategoryAssignment[] rangeCategory)
      Creates a table from resolved BMP entries and supplementary ranges.
      Parameters:
      bmp - The directly indexed BMP assignments.
      rangeStart - The inclusive starts of the supplementary ranges.
      rangeEnd - The inclusive upper bounds of the supplementary ranges.
      rangeCategory - The assignment for each supplementary range.
  • Method Details

    • categoriesOf

      CategoryTable.CategoryAssignment categoriesOf(int codePoint)
      Looks up the categories a char.def mapping gives a code point.
      Parameters:
      codePoint - The code point to classify.
      Returns:
      The assignment, or null when no mapping covers the code point.