edu.stanford.nlp.ie.machinereading.structure
Class EntityMention

java.lang.Object
  extended by edu.stanford.nlp.ie.machinereading.structure.ExtractionObject
      extended by edu.stanford.nlp.ie.machinereading.structure.EntityMention
All Implemented Interfaces:
java.io.Serializable

public class EntityMention
extends ExtractionObject

Each entity mention is described by a type (possibly subtype) and a span of text

Author:
Andrey Gusev, Mihai
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.nlp.ie.machinereading.structure.ExtractionObject
attributeMap, extentTokenSpan, objectId, sentence, subType, type, typeProbabilities
 
Constructor Summary
EntityMention(java.lang.String objectId, CoreMap sentence, Span extentSpan, Span headSpan, java.lang.String type, java.lang.String subtype, java.lang.String mentionType)
           
 
Method Summary
 boolean equals(EntityMention otherEnt, boolean useSubType)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getCorefID()
           
 Span getHead()
           
 int getHeadTokenEnd()
           
 int getHeadTokenStart()
           
 java.lang.String getMentionType()
           
 java.lang.String getNormalizedName()
           
 CoreLabel getSyntacticHeadToken()
           
 int getSyntacticHeadTokenPosition()
           
 Tree getSyntacticHeadTree()
           
 java.lang.String getValue()
          Get the text value of this entity.
 boolean headIncludes(EntityMention otherEnt, boolean useSubType)
           
 boolean labelEquals(EntityMention otherEnt, boolean useSubType)
          Compares the labels of the two mentions
static java.lang.String makeUniqueId()
          Creates a new unique id for an entity mention
 void setCorefID(java.lang.String id)
           
 void setHeadTokenPosition(int i)
           
 void setHeadTokenSpan(Span s)
           
 void setNormalizedName(java.lang.String n)
           
static void sortByHeadSpan(java.util.List<EntityMention> mentions)
           
 boolean textEquals(EntityMention otherEnt)
          Compares the text spans of the two entity mentions
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.nlp.ie.machinereading.structure.ExtractionObject
attributeMap, concatenateTypes, getDocumentId, getExtent, getExtentString, getExtentTokenEnd, getExtentTokenStart, getFullValue, getObjectId, getSentence, getSpan, getSubType, getType, getTypeProbabilities, printableObject, setExtent, setSentence, setType, setTypeProbabilities, sortByExtent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityMention

public EntityMention(java.lang.String objectId,
                     CoreMap sentence,
                     Span extentSpan,
                     Span headSpan,
                     java.lang.String type,
                     java.lang.String subtype,
                     java.lang.String mentionType)
Method Detail

getCorefID

public java.lang.String getCorefID()

setCorefID

public void setCorefID(java.lang.String id)

getMentionType

public java.lang.String getMentionType()

getHead

public Span getHead()

getHeadTokenStart

public int getHeadTokenStart()

getHeadTokenEnd

public int getHeadTokenEnd()

setHeadTokenSpan

public void setHeadTokenSpan(Span s)

setHeadTokenPosition

public void setHeadTokenPosition(int i)

getSyntacticHeadTokenPosition

public int getSyntacticHeadTokenPosition()

getSyntacticHeadToken

public CoreLabel getSyntacticHeadToken()

getSyntacticHeadTree

public Tree getSyntacticHeadTree()

getNormalizedName

public java.lang.String getNormalizedName()

setNormalizedName

public void setNormalizedName(java.lang.String n)

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class ExtractionObject

headIncludes

public boolean headIncludes(EntityMention otherEnt,
                            boolean useSubType)

equals

public boolean equals(EntityMention otherEnt,
                      boolean useSubType)

labelEquals

public boolean labelEquals(EntityMention otherEnt,
                           boolean useSubType)
Compares the labels of the two mentions

Parameters:
otherEnt -
useSubType -

textEquals

public boolean textEquals(EntityMention otherEnt)
Compares the text spans of the two entity mentions

Parameters:
otherEnt -

getValue

public java.lang.String getValue()
Get the text value of this entity. The headTokenSpan MUST be set before calling this method!

Overrides:
getValue in class ExtractionObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sortByHeadSpan

public static void sortByHeadSpan(java.util.List<EntityMention> mentions)

makeUniqueId

public static java.lang.String makeUniqueId()
Creates a new unique id for an entity mention

Returns:
the new id


Stanford NLP Group