Class ArabicMorphoAnalysis.Builder

Enclosing class:
ArabicMorphoAnalysis

public static class ArabicMorphoAnalysis.Builder extends MorphoAnalysis.Builder<ArabicMorphoAnalysis,ArabicMorphoAnalysis.Builder>
Builder class for ArabicMorphoAnalysis.
  • Constructor Details

    • Builder

      public Builder()
      Constructs an empty builder.
    • Builder

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

    • lengths

      public ArabicMorphoAnalysis.Builder lengths(int prefixLength, int stemLength)
      Sets the decomposition lengths. The suffix length is implied by the other two.
      Parameters:
      prefixLength - the number of characters in the prefix
      stemLength - the number of characters in the stem
      Returns:
      this
    • root

      Sets the root for the word.
      Parameters:
      root - the root, according to semitic linguistics
      Returns:
      this
    • definiteArticle

      public ArabicMorphoAnalysis.Builder definiteArticle(boolean definiteArticle)
      Specifies whether the word has an attached definite article.
      Parameters:
      definiteArticle - true for a definite article
      Returns:
      this
    • strippablePrefix

      public ArabicMorphoAnalysis.Builder strippablePrefix(boolean strippablePrefix)
      Specifies whether the prefixes are strippable (e.g. prepositions).
      Parameters:
      strippablePrefix - true if strippable
      Returns:
      this
    • addPrefix

      public ArabicMorphoAnalysis.Builder addPrefix(String prefix, String prefixTag)
      Adds a prefix.
      Parameters:
      prefix - the prefix
      prefixTag - the part-of-speech for the prefix
      Returns:
      this
    • prefixes

      public ArabicMorphoAnalysis.Builder prefixes(List<String> prefixes, List<String> prefixTags)
      Set all the prefixes and their tags. The two lists must be the same length.
      Parameters:
      prefixes - the prefixes.
      prefixTags - the tags for the prefixes.
      Returns:
      this
    • addStem

      public ArabicMorphoAnalysis.Builder addStem(String stem, String stemTag)
      Adds a stem.
      Parameters:
      stem - the stem
      stemTag - the part-of-speech for the stem
      Returns:
      this
    • stems

      public ArabicMorphoAnalysis.Builder stems(List<String> stems, List<String> stemTags)
      Set all the stems and their tags. The two lists must be the same length.
      Parameters:
      stems - the prefixes.
      stemTags - the tags for the prefixes.
      Returns:
      this
    • addSuffix

      public ArabicMorphoAnalysis.Builder addSuffix(String suffix, String suffixTag)
      Adds a suffix.
      Parameters:
      suffix - the suffix
      suffixTag - the part-of-speech for the suffix
      Returns:
      this
    • suffixes

      public ArabicMorphoAnalysis.Builder suffixes(List<String> suffixes, List<String> suffixTags)
      Set all the suffixes and their tags. The two lists must be the same length.
      Parameters:
      suffixes - the prefixes.
      suffixTags - the tags for the prefixes.
      Returns:
      this
    • build

      public ArabicMorphoAnalysis build()
      Constructs the analysis from the current state of the builder.
      Overrides:
      build in class MorphoAnalysis.Builder<ArabicMorphoAnalysis,ArabicMorphoAnalysis.Builder>
      Returns:
      the new analysis object