Class MorphoAnalysis.Builder<T extends MorphoAnalysis,B extends MorphoAnalysis.Builder<T,B>>

Direct Known Subclasses:
ArabicMorphoAnalysis.Builder, HanMorphoAnalysis.Builder, KoreanMorphoAnalysis.Builder
Enclosing class:
MorphoAnalysis

public static class MorphoAnalysis.Builder<T extends MorphoAnalysis,B extends MorphoAnalysis.Builder<T,B>> extends BaseAttribute.Builder<MorphoAnalysis,MorphoAnalysis.Builder<T,B>>
Builder for MorphoAnalysis.
  • Field Details

    • partOfSpeech

      protected String partOfSpeech
    • lemma

      protected String lemma
    • components

      protected List<Token> components
    • raw

      protected String raw
    • tagSet

      protected TagSet tagSet
  • Constructor Details

    • Builder

      public Builder()
      Constructs a builder with default values.
    • Builder

      public Builder(MorphoAnalysis toCopy)
      Constructs a builder from an existing analysis.
      Parameters:
      toCopy - the object to copy
  • Method Details

    • partOfSpeech

      public B partOfSpeech(String partOfSpeech)
      Specifies the part-of-speech.
      Parameters:
      partOfSpeech - the part-of-speech
      Returns:
      this
    • lemma

      public B lemma(String lemma)
      Specifies the lemma.
      Parameters:
      lemma - the lemma
      Returns:
      this
    • raw

      public B raw(String raw)
      Specifies the raw analysis.
      Parameters:
      raw - the raw analysis
      Returns:
      this
    • tagSet

      public B tagSet(TagSet tagSet)
      Specifies the tag set.
      Parameters:
      tagSet - the tag set
      Returns:
      this
    • addComponent

      public B addComponent(Token component)
      Adds a compound component.
      Parameters:
      component - the component
      Returns:
      this
    • components

      public B components(List<Token> components)
      Sets all of the compound components.
      Parameters:
      components - the components.
      Returns:
      this.
    • build

      public MorphoAnalysis build()
      Builds a new immutable morpho analysis from the current state of the builder.
      Returns:
      the new analysis
    • getThis

      protected B getThis()
      Specified by:
      getThis in class BaseAttribute.Builder<MorphoAnalysis,MorphoAnalysis.Builder<T extends MorphoAnalysis,B extends MorphoAnalysis.Builder<T,B>>>