Package opennlp.tools.tokenize.lattice
Class CategoryTable
java.lang.Object
opennlp.tools.tokenize.lattice.CategoryTable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classCollectschar.defmappings in file order and builds aCategoryTable, giving a later mapping precedence over an earlier one that covers the same code point, which is what direct indexing does for the BMP.(package private) static final classThe categories assigned to one code point, stored both in mapping order and as a mask over the dictionary's dense category ids. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CategoryTable.CategoryAssignment[]private final CategoryTable.CategoryAssignment[]private final int[]private final int[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCategoryTable(CategoryTable.CategoryAssignment[] bmp, int[] rangeStart, int[] rangeEnd, CategoryTable.CategoryAssignment[] rangeCategory) Creates a table from resolved BMP entries and supplementary ranges. -
Method Summary
Modifier and TypeMethodDescription(package private) CategoryTable.CategoryAssignmentcategoriesOf(int codePoint) Looks up the categories achar.defmapping gives a code point.
-
Field Details
-
bmp
-
rangeStart
private final int[] rangeStart -
rangeEnd
private final int[] rangeEnd -
rangeCategory
-
-
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
Looks up the categories achar.defmapping gives a code point.- Parameters:
codePoint- The code point to classify.- Returns:
- The assignment, or
nullwhen no mapping covers the code point.
-