Package banner.types

Class 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 a Sentence. Mentions are defined in terms of full tokens, and therefore finding mentions (the job of a Tagger) requires tokenization first.
    Author:
    Bob
    • Method Detail

      • getEntityType

        public EntityType getEntityType()
        Returns:
        A EntityType indicating the type of entity being mentioned
      • length

        public int length()
        Returns:
        The number of tokens this Mention contains
      • getText

        public String getText()
        Returns:
        The original text of this Mention
      • 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)
        Determines whether this Mention overlaps the specified Mention
        Parameters:
        mention2 -
        Returns:
        true if this Mention overlaps with the specified Mention, false otherwise
      • getProbability

        public Double getProbability()
      • setProbability

        public void setProbability​(Double probability)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object