Package opennlp.tools.util.normalizer
Class AsciiChars
java.lang.Object
opennlp.tools.util.normalizer.AsciiChars
ASCII character helpers shared by the normalizer implementations of this package, so the
character definitions cannot drift apart between classes.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final CodePointSetThe ASCII letters and digits.(package private) static final CodePointSetThe six ASCII whitespace characters: tab (U+0009), line feed (U+000A), vertical tab (U+000B), form feed (U+000C), carriage return (U+000D), and space (U+0020). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleancaseInsensitiveEquals(char a, char b) Returns whetheraandbare equal, comparing ASCII letters case-insensitively.(package private) static booleancaseInsensitiveEquals(int a, int b) Returns whetheraandbare equal, comparing ASCII letters case-insensitively.(package private) static booleanregionMatches(CharSequence text, int at, String literal) Returns whether the chars oftextatatequalliteralexactly.(package private) static chartoLower(char c) Returnsclower cased if it is an ASCII capital letter, otherwisecunchanged.(package private) static inttoLower(int codePoint) ReturnscodePointlower cased if it is an ASCII capital letter, otherwisecodePointunchanged.
-
Field Details
-
WHITESPACE
The six ASCII whitespace characters: tab (U+0009), line feed (U+000A), vertical tab (U+000B), form feed (U+000C), carriage return (U+000D), and space (U+0020). -
ALPHANUMERIC
The ASCII letters and digits.
-
-
Constructor Details
-
AsciiChars
private AsciiChars()
-
-
Method Details
-
toLower
static char toLower(char c) Returnsclower cased if it is an ASCII capital letter, otherwisecunchanged.- Parameters:
c- The char to lower case.- Returns:
clower cased if it is an ASCII capital letter, otherwisecunchanged
-
toLower
static int toLower(int codePoint) ReturnscodePointlower cased if it is an ASCII capital letter, otherwisecodePointunchanged.- Parameters:
codePoint- The code point to lower case.- Returns:
codePointlower cased if it is an ASCII capital letter, otherwisecodePointunchanged
-
caseInsensitiveEquals
static boolean caseInsensitiveEquals(char a, char b) Returns whetheraandbare equal, comparing ASCII letters case-insensitively.- Parameters:
a- The first char.b- The second char.- Returns:
- whether
aandbare equal, comparing ASCII letters case-insensitively
-
caseInsensitiveEquals
static boolean caseInsensitiveEquals(int a, int b) Returns whetheraandbare equal, comparing ASCII letters case-insensitively.- Parameters:
a- The first code point.b- The second code point.- Returns:
- whether
aandbare equal, comparing ASCII letters case-insensitively
-
regionMatches
Returns whether the chars oftextatatequalliteralexactly.- Parameters:
text- The text to look into.at- The index the comparison starts at.literal- The chars to compare against.- Returns:
- whether the chars of
textatatequalliteralexactly
-