Package org.tribuo.util.tokens.universal
Class Range
java.lang.Object
org.tribuo.util.tokens.universal.Range
- All Implemented Interfaces:
CharSequence
A range currently being segmented.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) intlength()voidpunct(char p, int start) Sets this range to represent a punctuation character.voidset(char[] buff, int len, int start) Sets the character range.voidset(char c1, char c2, int start) Sets the first two characters in the range, and the type to NGRAM.voidset(char c, int start) Sets the first character in the range.voidsetType(Token.TokenType type) Sets the token type.subSequence(int start, int end) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Field Details
-
buff
The character buffer. -
len
The token length. -
start
The start index. -
end
The end index. -
incr
The value to increment by. -
type
The current token type.
-
-
Method Details
-
set
Sets the first two characters in the range, and the type to NGRAM.- Parameters:
c1- The first character.c2- The second character.start- The start value.
-
set
Sets the first character in the range.- Parameters:
c- The first character.start- The start value.
-
set
Sets the character range.- Parameters:
buff- The characters.len- The length of the character buffer.start- The start index.
-
punct
Sets this range to represent a punctuation character.- Parameters:
p- The punctuation character.start- The start index.
-
setType
Sets the token type.- Parameters:
type- The token type.
-
length
- Specified by:
lengthin interfaceCharSequence
-
charAt
- Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-