public class CoreLabelSequence extends Object
| Modifier and Type | Field and Description |
|---|---|
static CoreLabelSequence |
EMPTY_SEQUENCE |
static int |
IGNORE_SENTENCE |
| Constructor and Description |
|---|
CoreLabelSequence(edu.stanford.nlp.ling.CoreLabel... labels) |
CoreLabelSequence(List<edu.stanford.nlp.ling.CoreLabel> labels) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsLabel(edu.stanford.nlp.ling.CoreLabel label) |
boolean |
containsLabel(int sentIndex,
String text,
int index)
Checks if label is part of current sequence
|
static CoreLabelSequence |
from(edu.stanford.nlp.ling.CoreLabel... labels) |
List<edu.stanford.nlp.ling.CoreLabel> |
getLabels() |
boolean |
isEmpty() |
Optional<String> |
toLabelString()
Returns the sequence in the String format like "United_States-3"
|
String |
toText()
Converts the sequence to text representation using "_" as a separator
|
public static final CoreLabelSequence EMPTY_SEQUENCE
public static final int IGNORE_SENTENCE
public CoreLabelSequence(List<edu.stanford.nlp.ling.CoreLabel> labels)
public CoreLabelSequence(edu.stanford.nlp.ling.CoreLabel... labels)
public static CoreLabelSequence from(edu.stanford.nlp.ling.CoreLabel... labels)
public List<edu.stanford.nlp.ling.CoreLabel> getLabels()
public boolean containsLabel(edu.stanford.nlp.ling.CoreLabel label)
public boolean isEmpty()
public boolean containsLabel(int sentIndex,
String text,
int index)
sentIndex - can be CoreLabelSequence.IGNORE_SENTENCEpublic String toText()
Copyright © 2015. All rights reserved.