CharacterUtils

Utility class to write tokenizers or token filters.

Types

Link copied to clipboard

A simple IO buffer to use with CharacterUtils.fill.

Functions

Link copied to clipboard
fun fill(buffer: CharacterUtils.CharacterBuffer, reader: Reader, numChars: Int = buffer.buffer.size): Boolean

Convenience method which calls fill(buffer, reader, buffer.buffer.length).

Link copied to clipboard

Creates a new CharacterBuffer and allocates a char[] of the given bufferSize.

Link copied to clipboard
fun readFully(reader: Reader, dest: CharArray, offset: Int, len: Int): Int
Link copied to clipboard
fun toChars(src: IntArray, srcOff: Int, srcLen: Int, dest: CharArray, destOff: Int): Int

Converts a sequence of unicode code points to a sequence of Java characters.

Link copied to clipboard
fun toCodePoints(src: CharArray, srcOff: Int, srcLen: Int, dest: IntArray, destOff: Int): Int

Converts a sequence of Java characters to a sequence of unicode code points.

Link copied to clipboard
fun toLowerCase(buffer: CharArray, offset: Int, limit: Int)

Converts each unicode codepoint to lowerCase via Character.toLowerCase starting at the given offset.

Link copied to clipboard
fun toUpperCase(buffer: CharArray, offset: Int, limit: Int)

Converts each unicode codepoint to UpperCase via Character.toUpperCase starting at the given offset.