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, isEmpty
-
Field Details
-
buff
public char[] buffThe character buffer. -
len
public int lenThe token length. -
start
public int startThe start index. -
end
public int endThe end index. -
incr
public int incrThe value to increment by. -
type
The current token type.
-
-
Method Details
-
set
public void set(char c1, char c2, int start) 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
public void set(char c, int start) Sets the first character in the range.- Parameters:
c- The first character.start- The start value.
-
set
public void set(char[] buff, int len, int start) Sets the character range.- Parameters:
buff- The characters.len- The length of the character buffer.start- The start index.
-
punct
public void punct(char p, int start) Sets this range to represent a punctuation character.- Parameters:
p- The punctuation character.start- The start index.
-
setType
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-