Class AsciiChars

java.lang.Object
opennlp.tools.util.normalizer.AsciiChars

final class AsciiChars extends Object
ASCII character helpers shared by the normalizer implementations of this package, so the character definitions cannot drift apart between classes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final CodePointSet
    The ASCII letters and digits.
    (package private) static final CodePointSet
    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).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static boolean
    caseInsensitiveEquals(char a, char b)
    Returns whether a and b are equal, comparing ASCII letters case-insensitively.
    (package private) static boolean
    caseInsensitiveEquals(int a, int b)
    Returns whether a and b are equal, comparing ASCII letters case-insensitively.
    (package private) static boolean
    regionMatches(CharSequence text, int at, String literal)
    Returns whether the chars of text at at equal literal exactly.
    (package private) static char
    toLower(char c)
    Returns c lower cased if it is an ASCII capital letter, otherwise c unchanged.
    (package private) static int
    toLower(int codePoint)
    Returns codePoint lower cased if it is an ASCII capital letter, otherwise codePoint unchanged.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • WHITESPACE

      static final CodePointSet 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

      static final CodePointSet ALPHANUMERIC
      The ASCII letters and digits.
  • Constructor Details

    • AsciiChars

      private AsciiChars()
  • Method Details

    • toLower

      static char toLower(char c)
      Returns c lower cased if it is an ASCII capital letter, otherwise c unchanged.
      Parameters:
      c - The char to lower case.
      Returns:
      c lower cased if it is an ASCII capital letter, otherwise c unchanged
    • toLower

      static int toLower(int codePoint)
      Returns codePoint lower cased if it is an ASCII capital letter, otherwise codePoint unchanged.
      Parameters:
      codePoint - The code point to lower case.
      Returns:
      codePoint lower cased if it is an ASCII capital letter, otherwise codePoint unchanged
    • caseInsensitiveEquals

      static boolean caseInsensitiveEquals(char a, char b)
      Returns whether a and b are equal, comparing ASCII letters case-insensitively.
      Parameters:
      a - The first char.
      b - The second char.
      Returns:
      whether a and b are equal, comparing ASCII letters case-insensitively
    • caseInsensitiveEquals

      static boolean caseInsensitiveEquals(int a, int b)
      Returns whether a and b are equal, comparing ASCII letters case-insensitively.
      Parameters:
      a - The first code point.
      b - The second code point.
      Returns:
      whether a and b are equal, comparing ASCII letters case-insensitively
    • regionMatches

      static boolean regionMatches(CharSequence text, int at, String literal)
      Returns whether the chars of text at at equal literal exactly.
      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 text at at equal literal exactly