public class Span extends Object
| Constructor and Description |
|---|
Span(int s,
int e)
Initializes a new Span Object.
|
Span(int s,
int e,
double prob) |
Span(int s,
int e,
String type)
Initializes a new Span Object.
|
Span(int s,
int e,
String type,
double prob) |
Span(Span span,
double prob)
Creates a new immutable span based on an existing span, where the
existing span did not include the prob
|
Span(Span span,
int offset)
Initializes a new Span object with an existing Span which is shifted by
an offset.
|
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
getCoveredText(CharSequence text) |
int |
getEnd() |
double |
getProb() |
int |
getStart() |
String |
getType() |
static String[] |
spansToStrings(Span[] spans,
CharSequence s) |
public Span(int s,
int e,
String type)
s - start of span.e - end of span, which is +1 more than the last element in the
span.type - the type of the spanpublic Span(int s,
int e,
String type,
double prob)
public Span(int s,
int e)
s - start of span.e - end of span.public Span(int s,
int e,
double prob)
s - the start of the span (the token index, not the char index)e - the end of the span (the token index, not the char index)prob - The probability of the span.public Span(Span span, int offset)
span - The Span.offset - Shift the span by this offset.public Span(Span span, double prob)
span - the span that has no prob or the prob is incorrect and a new
Span must be generatedprob - the probability of the spanpublic static String[] spansToStrings(Span[] spans, CharSequence s)
public CharSequence getCoveredText(CharSequence text)
public int getStart()
public int getEnd()
public String getType()
public double getProb()
Copyright © 2018. All rights reserved.