public class Constituent extends Object implements Serializable
Relation
s are edges. Each
Constituent corresponds to a set of tokens ina TextAnnotation
.Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
attributes |
protected double |
constituentScore |
protected int |
endCharOffset |
protected List<Relation> |
incomingRelations |
protected int |
label |
protected List<Relation> |
outgoingRelations |
protected edu.illinois.cs.cogcomp.core.datastructures.IntPair |
span |
protected int |
startCharOffset |
protected TextAnnotation |
textAnnotation |
protected String |
viewName
This indicates whether the element
Constituent#constituentTokens
is a two element list consisting of a start and an end tokenId,
specifying a span, instead of explicitly listing the each element. |
Constructor and Description |
---|
Constituent(String label,
double score,
String viewName,
TextAnnotation text,
int start,
int end) |
Constituent(String label,
String viewName,
TextAnnotation text,
int start,
int end) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String key,
String value) |
Constituent |
cloneForNewView(String newViewName) |
boolean |
doesConstituentCover(Constituent other) |
boolean |
doesConstituentCover(int tokenId) |
boolean |
doesConstituentCoverAll(Collection<Integer> tokenIds) |
boolean |
equals(Object obj) |
String |
getAttribute(String key) |
Set<String> |
getAttributeKeys() |
double |
getConstituentScore() |
TreeSet<Integer> |
getConstituentTokens()
Deprecated.
|
int |
getEndCharOffset() |
int |
getEndSpan() |
int |
getInclusiveEndCharOffset() |
int |
getInclusiveStartCharOffset() |
List<Relation> |
getIncomingRelations()
Get a list of relations where the target is this constituent
|
String |
getLabel() |
int |
getNumberOfTokens() |
List<Relation> |
getOutgoingRelations()
Get a list of relations where the source is this constituent.
|
int |
getSentenceId()
Return the identifier of the sentence that contains this constituent.
|
edu.illinois.cs.cogcomp.core.datastructures.IntPair |
getSpan() |
int |
getStartCharOffset() |
int |
getStartSpan() |
String |
getSurfaceString() |
TextAnnotation |
getTextAnnotation() |
View |
getView() |
String |
getViewName() |
boolean |
hasAttribute(String key) |
int |
hashCode() |
boolean |
isConsituentInRange(int start,
int end) |
int |
length() |
int |
size() |
String |
toSExpression()
Convert this constituent into an S-Expression, including relation labels.
|
String |
toSExpression(boolean includeEdgeLabels) |
protected String |
toSExpression(int spaces,
boolean firstChild,
String prefix,
boolean includeEdgeLabels) |
String |
toString() |
protected final double constituentScore
protected final TextAnnotation textAnnotation
protected final edu.illinois.cs.cogcomp.core.datastructures.IntPair span
protected final int startCharOffset
protected final int endCharOffset
protected final int label
protected final String viewName
Constituent#constituentTokens
is a two element list consisting of a start and an end tokenId,
specifying a span, instead of explicitly listing the each element. This
would use less memory.public Constituent(String label, String viewName, TextAnnotation text, int start, int end)
public Constituent(String label, double score, String viewName, TextAnnotation text, int start, int end)
public int getStartCharOffset()
public int getEndCharOffset()
public int getInclusiveStartCharOffset()
public int getInclusiveEndCharOffset()
public boolean doesConstituentCover(int tokenId)
public boolean doesConstituentCover(Constituent other)
public boolean doesConstituentCoverAll(Collection<Integer> tokenIds)
public double getConstituentScore()
public int getEndSpan()
public String getLabel()
public int getNumberOfTokens()
public int size()
public int length()
public int getStartSpan()
public edu.illinois.cs.cogcomp.core.datastructures.IntPair getSpan()
public String getSurfaceString()
public TextAnnotation getTextAnnotation()
public String getViewName()
public View getView()
public boolean hasAttribute(String key)
public boolean isConsituentInRange(int start, int end)
public List<Relation> getOutgoingRelations()
Relation
spublic List<Relation> getIncomingRelations()
Relation
spublic String toSExpression()
public String toSExpression(boolean includeEdgeLabels)
protected String toSExpression(int spaces, boolean firstChild, String prefix, boolean includeEdgeLabels)
public int getSentenceId()
@Deprecated public TreeSet<Integer> getConstituentTokens()
public Constituent cloneForNewView(String newViewName)
Copyright © 2015. All rights reserved.