|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.whatswrong.Edge
public class Edge
An Edge is a labelled and typed pair of tokens. It can represent dependencies edges as well as spans. Along with a start and end (to and from) token an edge has the following three attributes:
Edge.RenderType.dependency
| Nested Class Summary | |
|---|---|
static class |
Edge.RenderType
The RenderType enum can be used to specify how the edge should be rendered. |
| Constructor Summary | |
|---|---|
Edge(Token from,
Token to,
String label,
String type)
Creates a new edge with default render type (dependency). |
|
Edge(Token from,
Token to,
String label,
String type,
Edge.RenderType renderType)
Create new edge. |
|
Edge(Token from,
Token to,
String label,
String note,
String type,
Edge.RenderType renderType)
Create new edge. |
|
Edge(Token from,
Token to,
String label,
String note,
String type,
Edge.RenderType renderType,
String description)
Create new edge. |
|
| Method Summary | |
|---|---|
boolean |
covers(Edge edge)
Check whether this edge completely covers the specified edge. |
boolean |
coversExactly(Edge edge)
Check whether this edge spans the same sequence of tokens as the given edge. |
boolean |
coversSemi(Edge edge)
Checks whether this edge covers the given edge and is aligned with it on one side. |
boolean |
crosses(Edge edge)
Checks whether the given edge crosses this edge. |
boolean |
equals(Object o)
Checks whether to edges are equal |
String |
getDescription()
A description of the edge |
Token |
getFrom()
Returns the start token of the edge. |
String |
getLabel()
Returns the label of the edge. |
String |
getLabelWithNote()
Returns the label with an additional note if available. |
int |
getLength()
Returns the distance between the from and to token. |
int |
getMaxIndex()
Returns the maximal index of both tokens in this edge. |
int |
getMinIndex()
Returns the mimimal index of both tokens in this edge. |
String |
getNote()
Returns the note that is appended to the label. |
Edge.RenderType |
getRenderType()
Returns the render type of this edge. |
Token |
getTo()
Returns the end token of the edge. |
String |
getType()
Returns the type of the edge. |
String |
getTypePostfix()
If the type of label is "prefix:postfix" this method returns "postfix". |
String |
getTypePrefix()
If the type of label is qualified with a "qualifier:" prefix this method returns "qualifier". |
int |
hashCode()
Returns a hashcode based on type, label, note, from and to token. |
boolean |
leftOf(Token token)
Checks whether the edge is to the left of the given token. |
int |
lexicographicOrder(Edge edge)
Compares the type and label of this edge and the passed edge. |
boolean |
overlaps(Edge edge)
Checks whether this edge overlaps the given edge. |
boolean |
rightOf(Token token)
Checks whether the edge is to the right of the given token. |
void |
setDescription(String description)
Sets the description of this edge |
void |
setRenderType(Edge.RenderType renderType)
Sets the render type of this edge. |
boolean |
strictlyCovers(Edge edge)
Checks whether the given edge is covered by this edge and at least one token is not aligned. |
String |
toString()
Returns a string representation of this edge. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Edge(Token from,
Token to,
String label,
String type,
Edge.RenderType renderType)
from - from token.to - to tokenlabel - the label of the edgetype - the type of the edge (say, 'semantic role').renderType - the render type.
public Edge(Token from,
Token to,
String label,
String note,
String type,
Edge.RenderType renderType)
from - from token.to - to tokenlabel - the label of the edgenote - the note to add to the edgetype - the type of the edge (say, 'semantic role').renderType - the render type.
public Edge(Token from,
Token to,
String label,
String note,
String type,
Edge.RenderType renderType,
String description)
from - from token.to - to tokenlabel - the label of the edgenote - the note to add to the edgetype - the type of the edge (say, 'semantic role').renderType - the render type.description - a description of the edge.
public Edge(Token from,
Token to,
String label,
String type)
from - from token.to - to token.label - the label of the edge.type - the type of the edge.| Method Detail |
|---|
public String getTypePrefix()
public String getTypePostfix()
public String getDescription()
public int getMinIndex()
public int getMaxIndex()
public Edge.RenderType getRenderType()
Edge.RenderType.span.
public void setRenderType(Edge.RenderType renderType)
Edge.RenderType.span.
renderType - the render type of this edge.public Token getFrom()
public void setDescription(String description)
description - a text describing this edge.public Token getTo()
public String getLabel()
public String getNote()
public String getLabelWithNote()
public String getType()
public int lexicographicOrder(Edge edge)
edge - the edge to compare to.
public boolean leftOf(Token token)
token - the token to compare to
public boolean rightOf(Token token)
token - the token to compare to
public int getLength()
public boolean covers(Edge edge)
edge - the edge to check whether it is covered by this edge.
public boolean coversExactly(Edge edge)
edge - the edge to compare with.
public boolean coversSemi(Edge edge)
edge - the edge to compare with.
public boolean overlaps(Edge edge)
edge - the edge to compare with.
public boolean strictlyCovers(Edge edge)
edge - the edge to compare with.
public String toString()
toString in class Objectpublic boolean crosses(Edge edge)
edge - the edge to compare to.
public boolean equals(Object o)
equals in class Objecto - the other edge
public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||