public class Name extends Object
Name object contains a single String, a Span, a
startOffset and the length of the String. These attributes are set or
returned in response to requests.| Constructor and Description |
|---|
Name()
Create a new
Name with a null content (i.e., str). |
Name(String aStr,
String aType)
Create a new
Name with the given string. |
Name(String aStr,
String aType,
int aStartOffset,
int aNameLength)
Creates a new
Name with the given content. |
Name(String aStr,
String aType,
opennlp.tools.util.Span aNeSpan)
Create a new
Name with the given string and Span. |
Name(String aStr,
String aType,
opennlp.tools.util.Span aNeSpan,
int aStartOffset,
int aNameLength)
Creates a new
Name with the given content. |
| Modifier and Type | Method and Description |
|---|---|
opennlp.tools.util.Span |
getSpan()
Return the Span (or null if none).
|
String |
getType()
Return the type of the Name.
|
int |
nameLength() |
void |
setFromString(String aStr)
Set the label from a String.
|
void |
setNameLength(int aNameLength) |
void |
setSpan(opennlp.tools.util.Span span)
Set the Span for the Name.
|
void |
setStartOffset(int beginPosition) |
void |
setType(String neType)
Set type of the Name.
|
void |
setValue(String value)
Set the value for the label.
|
int |
startOffset() |
String |
toString() |
String |
value()
Return the word value of the label (or null if none).
|
public Name()
Name with a null content (i.e., str).public Name(String aStr, String aType)
Name with the given string.aStr - the new label's contentaType - the class of the namepublic Name(String aStr, String aType, opennlp.tools.util.Span aNeSpan)
Name with the given string and Span.aStr - the new label's contentaType - the Named Entity class of the NameaNeSpan - the span of the Namepublic Name(String aStr, String aType, int aStartOffset, int aNameLength)
Name with the given content.aStr - The new label's contentaType - Named Entity class of the NameaStartOffset - Start offset in original textaNameLength - End offset in original textpublic Name(String aStr, String aType, opennlp.tools.util.Span aNeSpan, int aStartOffset, int aNameLength)
Name with the given content.aStr - The new label's contentaType - Name Entity class of the NameaNeSpan - the name spanaStartOffset - Start offset in original textaNameLength - End offset in original textpublic final String value()
public final String getType()
public final opennlp.tools.util.Span getSpan()
public final void setValue(String value)
value - The value for the labelpublic final void setType(String neType)
neType - the class of the Namepublic final void setSpan(opennlp.tools.util.Span span)
span - the Span of the namepublic final void setFromString(String aStr)
aStr - The str for the labelpublic final int startOffset()
public final int nameLength()
public final void setStartOffset(int beginPosition)
beginPosition - the starting characterpublic final void setNameLength(int aNameLength)
aNameLength - the length of the nameCopyright © 2015 IXA pipes. All rights reserved.