Class TokenDictRule.Builder

java.lang.Object
com.ibm.watson.discovery.v1.model.TokenDictRule.Builder
Enclosing class:
TokenDictRule

public static class TokenDictRule.Builder
extends Object
Builder.
  • Constructor Details

    • Builder

      public Builder()
      Instantiates a new builder.
    • Builder

      public Builder​(String text, List<String> tokens, String partOfSpeech)
      Instantiates a new builder with required properties.
      Parameters:
      text - the text
      tokens - the tokens
      partOfSpeech - the partOfSpeech
  • Method Details

    • build

      public TokenDictRule build()
      Builds a TokenDictRule.
      Returns:
      the new TokenDictRule instance
    • addTokens

      public TokenDictRule.Builder addTokens​(String tokens)
      Adds an tokens to tokens.
      Parameters:
      tokens - the new tokens
      Returns:
      the TokenDictRule builder
    • addReadings

      public TokenDictRule.Builder addReadings​(String readings)
      Adds an readings to readings.
      Parameters:
      readings - the new readings
      Returns:
      the TokenDictRule builder
    • text

      public TokenDictRule.Builder text​(String text)
      Set the text.
      Parameters:
      text - the text
      Returns:
      the TokenDictRule builder
    • tokens

      public TokenDictRule.Builder tokens​(List<String> tokens)
      Set the tokens. Existing tokens will be replaced.
      Parameters:
      tokens - the tokens
      Returns:
      the TokenDictRule builder
    • readings

      public TokenDictRule.Builder readings​(List<String> readings)
      Set the readings. Existing readings will be replaced.
      Parameters:
      readings - the readings
      Returns:
      the TokenDictRule builder
    • partOfSpeech

      public TokenDictRule.Builder partOfSpeech​(String partOfSpeech)
      Set the partOfSpeech.
      Parameters:
      partOfSpeech - the partOfSpeech
      Returns:
      the TokenDictRule builder