|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.columbia.cs.ref.model.FeaturableObject
edu.columbia.cs.ref.model.CandidateSentence
public class CandidateSentence
A representation of a candidate sentence. A candidate sentence is the basic structure
that contains the information that is used for most of the classifier based methods.
A candidate sentence is composed by a Sentence from a given document, a list of entities
that are present in the sentence. The order of these entities is very important since it
defines the role that each entity performs in the relationships.
A candidate sentence can also be annotated with several relationships (necessary for
training).
Constructor Summary | |
---|---|
CandidateSentence(Sentence sentence,
java.util.List<Entity> entities)
Candidate sentence constructor. |
Method Summary | |
---|---|
void |
addRelationship(Relationship rel)
This method allows for the annotation of a candidate sentence. |
boolean |
equals(java.lang.Object o)
|
Entity[] |
getEntities()
This method returns an array with the ordered entities that corresponds to the tuple representation of the relationships present in this candidate sentence |
java.lang.String |
getId()
Returns a string that can be used as an unique identifier of the candidate sentence. |
java.util.Set<java.lang.String> |
getLabels()
This method returns all the labels that correspond to the relationships present in this candidate sentence |
Relationship |
getRelationship(RelationshipType t)
Given a relationship type, it returns the relationship between the entities of the candidate sentence |
Entity |
getRole(RelationshipType type,
java.lang.String role)
Given a relationship type and a role, it returns the entity that is fulfilling that role in a relationship of this candidate sentence |
java.util.Collection<java.lang.String> |
getRoles(RelationshipType t)
Given a relationship type, it returns a collection of roles that can be assigned for this candidate sentence |
Sentence |
getSentence()
This methods gets the sentence that the candidate sentence corresponds to. |
int |
hashCode()
|
void |
setSentence(Sentence sentence)
This method sets the sentence that the candidate sentence corresponds to. |
Methods inherited from class edu.columbia.cs.ref.model.FeaturableObject |
---|
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CandidateSentence(Sentence sentence, java.util.List<Entity> entities)
sentence
- entities
- Method Detail |
---|
public void addRelationship(Relationship rel)
rel
- Relationship between some of the entities of this sentencepublic void setSentence(Sentence sentence)
sentence
- Sentence that the candidate sentence corresponds topublic Sentence getSentence()
public Entity[] getEntities()
public java.util.Set<java.lang.String> getLabels()
public java.util.Collection<java.lang.String> getRoles(RelationshipType t)
t
- relationship type that corresponds to a key to the relationship that we are trying to find the roles for
public Entity getRole(RelationshipType type, java.lang.String role)
type
- relationship type that corresponds to a key to the relationshiprole
- role that we want to find out
public Relationship getRelationship(RelationshipType t)
type
- relationship type that corresponds to a key to the relationship
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |