Package banner.types
Class Mention
- java.lang.Object
-
- banner.types.Mention
-
- All Implemented Interfaces:
Comparable<Mention>
public class Mention extends Object implements Comparable<Mention>
Instances of this class represent the mention of an entity within aSentence. Mentions are defined in terms of full tokens, and therefore finding mentions (the job of aTagger) requires tokenization first.- Author:
- Bob
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMention.MentionType
-
Constructor Summary
Constructors Constructor Description Mention(Sentence sentence, int start, int end, EntityType entityType, Mention.MentionType mentionType)Mention(Sentence sentence, int start, int end, EntityType entityType, Mention.MentionType mentionType, Double probability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Mention mention2)booleancontains(int tokenIndex)Mentioncopy(Sentence sentence2)booleanequals(Object obj)intgetEnd()intgetEndChar()intgetEndChar(boolean ignoreWhitespace)EntityTypegetEntityType()Mention.MentionTypegetMentionType()DoublegetProbability()SentencegetSentence()intgetStart()intgetStartChar()intgetStartChar(boolean ignoreWhitespace)StringgetText()List<Token>getTokens()inthashCode()intlength()booleanoverlaps(Mention mention2)voidsetProbability(Double probability)StringtoString()
-
-
-
Constructor Detail
-
Mention
public Mention(Sentence sentence, int start, int end, EntityType entityType, Mention.MentionType mentionType)
-
Mention
public Mention(Sentence sentence, int start, int end, EntityType entityType, Mention.MentionType mentionType, Double probability)
-
-
Method Detail
-
getEntityType
public EntityType getEntityType()
- Returns:
- A
EntityTypeindicating the type of entity being mentioned
-
getMentionType
public Mention.MentionType getMentionType()
-
length
public int length()
- Returns:
- The number of tokens this
Mentioncontains
-
contains
public boolean contains(int tokenIndex)
-
getEnd
public int getEnd()
- Returns:
- The index of the last token in this
Mention
-
getStart
public int getStart()
- Returns:
- The index of the first token in this
Mention
-
getStartChar
public int getStartChar()
-
getEndChar
public int getEndChar()
-
getStartChar
public int getStartChar(boolean ignoreWhitespace)
-
getEndChar
public int getEndChar(boolean ignoreWhitespace)
-
overlaps
public boolean overlaps(Mention mention2)
- Parameters:
mention2-- Returns:
trueif this Mention overlaps with the specifiedMention,falseotherwise
-
getProbability
public Double getProbability()
-
setProbability
public void setProbability(Double probability)
-
compareTo
public int compareTo(Mention mention2)
- Specified by:
compareToin interfaceComparable<Mention>
-
-