Class Mention.Builder

Enclosing class:
Mention

public static class Mention.Builder extends Attribute.Builder<Mention,Mention.Builder>
A builder for entity mentions.
  • Constructor Details

    • Builder

      public Builder(int startOffset, int endOffset)
      Constructs a builder with the minimal required information for an entity mention.
      Parameters:
      startOffset - the start offset in the text, in characters
      endOffset - the end offset in the text, in characters
    • Builder

      public Builder(Mention toCopy)
      Constructs a builder initialized with information from an existing entity mention.
      Parameters:
      toCopy - the mention to copy.
  • Method Details

    • confidence

      public Mention.Builder confidence(Double confidence)
      Specifies the confidence.
      Parameters:
      confidence - the confidence, or null to indicate that no confidence is available.
      Returns:
      this
    • linkingConfidence

      public Mention.Builder linkingConfidence(Double linkingConfidence)
      Specifies the linking confidence.
      Parameters:
      linkingConfidence - the linking confidence, or null to indicate that no confidence is available.
      Returns:
      this
    • source

      public Mention.Builder source(String source)
      Specifies the source of this mention.
      Parameters:
      source - the source
      Returns:
      this
    • subsource

      public Mention.Builder subsource(String subsource)
      Specifies the subsource of this mention.
      Parameters:
      subsource - the subsource
      Returns:
      this
    • normalized

      public Mention.Builder normalized(String normalized)
      Specifies the normalized form of this mention.
      Parameters:
      normalized - the normalized form
      Returns:
      this
    • build

      public Mention build()
      Builds the immutable mention.
      Returns:
      the mention
    • getThis

      protected Mention.Builder getThis()
      Specified by:
      getThis in class Attribute.Builder<Mention,Mention.Builder>