Package opennlp.tools.tokenize.uax29
Class WordBreakProperty
java.lang.Object
opennlp.tools.tokenize.uax29.WordBreakProperty
Looks up the Unicode
Word_Break property of a code point.
The data is loaded once from the WordBreakProperty.txt resource of the Unicode
Character Database (parsed with simple cursor scanning, no regular expression). Lookup is O(1)
for the Basic Multilingual Plane (a direct array index) and O(log n) for supplementary code
points (a binary search over a small sorted range table), so it imposes no per-character
allocation on the word boundary algorithm.
-
Method Summary
-
Method Details
-
of
Returns theWordBreakvalue of a code point.- Parameters:
codePoint- The code point. Values outside[0, U+10FFFF]returnWordBreak.OTHER.- Returns:
- the
WordBreakvalue of a code point
-
ordinalOf
public static int ordinalOf(int codePoint) Returns theordinalof a code point'sWordBreakvalue. This is the allocation-free form ofof(int)for hot loops that work with ordinals.- Parameters:
codePoint- The code point. Values outside[0, U+10FFFF]return the ordinal ofWordBreak.OTHER.- Returns:
- the
ordinalof a code point'sWordBreakvalue
-