Package com.complexible.stardog.docs.nlp
Class Span
- java.lang.Object
-
- com.complexible.stardog.docs.nlp.Annotated
-
- com.complexible.stardog.docs.nlp.Span
-
public class Span extends Annotated
- Since:
- 5.2
- Version:
- 5.2
- Author:
- Pedro Oliveira
-
-
Field Summary
-
Fields inherited from class com.complexible.stardog.docs.nlp.Annotated
mAnnotations
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Token
first()
First tokenint
hashCode()
Token
last()
Last tokenint
size()
Number of tokensSpan
subspan(int theBegin, int theEnd)
Returns aSpan
that is a subspan of this onejava.lang.String
text()
Tokens in the span as a space separated stringjava.lang.String
text(java.lang.String theDelimiter)
Tokens in the span as a delimiter separated stringToken
token(int theIndex)
Token at indexToken[]
tokens()
The tokens as an arrayjava.lang.String
toString()
-
-
-
Constructor Detail
-
Span
public Span(Document theDocument, int theSentence, int theBegin, int theEnd)
-
-
Method Detail
-
tokens
public Token[] tokens()
The tokens as an array
-
token
public Token token(int theIndex)
Token at index
-
first
public Token first()
First token
-
last
public Token last()
Last token
-
size
public int size()
Number of tokens
-
text
public java.lang.String text()
Tokens in the span as a space separated string
-
text
public java.lang.String text(java.lang.String theDelimiter)
Tokens in the span as a delimiter separated string
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-