public class AnnotatedToken
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Annotation[] |
annotations
The list of annotations belonging to the token
|
int |
id
The token uniq identifier
|
int |
kind
The token kind
|
int |
lang
The language code
|
int |
offset
The absolute offset in text
|
java.lang.String |
token
The token value
|
static int |
TOKEN_ALPHA
Token kind alpha [a-zA-Z]+
|
static int |
TOKEN_ALPHANUM
Token kind alphanum [a-zA-Z0-9]+
|
static int |
TOKEN_NUMBER
Token kind number [0-9]+
|
static int |
TOKEN_SEP_DASH
Token kind dash [-]
|
static int |
TOKEN_SEP_IGNORE
Token kind separator [[:ctrl:]]
|
static int |
TOKEN_SEP_PARAGRAPH
Token kind paragraph (\n\n)
|
static int |
TOKEN_SEP_PUNCT
Token kind punct [[:punct:]]
|
static int |
TOKEN_SEP_QUOTE
Token kind quote ["']
|
static int |
TOKEN_SEP_SENTENCE
Token kind sentence
|
static int |
TOKEN_SEP_SPACE
Token kind space [[:space:]]
|
static int |
TOKEN_UNKNOWN
Token kind unknown
|
Constructor and Description |
---|
AnnotatedToken() |
Modifier and Type | Method and Description |
---|---|
java.util.List<Annotation> |
getAnnotationsOfKind(int tid)
Returns the annotations having the given tid
|
java.util.List<Annotation> |
getAnnotationsOfKind(int tid,
java.lang.String display)
Returns the annotations having the given tid and display form
|
java.util.List<Annotation> |
getAnnotationsOfKinds(java.util.Collection<java.lang.Integer> tids)
Returns the annotations having the given tids
|
java.util.List<Annotation> |
getAnnotationsWithTag(java.lang.String tag)
Returns the annotations having the given tag
|
java.util.List<Annotation> |
getAnnotationsWithTagAndDisplay(java.lang.String tag,
java.lang.String display)
Returns the annotations having the given tag and display form
|
java.util.List<Annotation> |
getAnnotationsWithTags(java.util.Collection<java.lang.String> tags)
Returns the annotations having the given tags
|
static java.lang.String |
nameOfKind(int kind)
Get a token kind name from its code
|
java.lang.String |
toString()
Pretty print a token and its annotations
|
public int id
public java.lang.String token
public int kind
public int lang
public int offset
public Annotation[] annotations
public static final int TOKEN_UNKNOWN
public static final int TOKEN_SEP_IGNORE
public static final int TOKEN_SEP_SPACE
public static final int TOKEN_SEP_SENTENCE
public static final int TOKEN_SEP_PARAGRAPH
public static final int TOKEN_SEP_QUOTE
public static final int TOKEN_SEP_DASH
public static final int TOKEN_SEP_PUNCT
public static final int TOKEN_NUMBER
public static final int TOKEN_ALPHANUM
public static final int TOKEN_ALPHA
public static java.lang.String nameOfKind(int kind)
kind
- The token kindpublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<Annotation> getAnnotationsOfKinds(java.util.Collection<java.lang.Integer> tids)
public java.util.List<Annotation> getAnnotationsOfKind(int tid)
public java.util.List<Annotation> getAnnotationsOfKind(int tid, java.lang.String display)
public java.util.List<Annotation> getAnnotationsWithTags(java.util.Collection<java.lang.String> tags)
public java.util.List<Annotation> getAnnotationsWithTag(java.lang.String tag)
public java.util.List<Annotation> getAnnotationsWithTagAndDisplay(java.lang.String tag, java.lang.String display)
Copyright © 2013 Dassault Systèmes, All Rights Reserved.