public ServiceCall<Void> addWord(AddWordOptions addWordOptions) {
    Validator.notNull(addWordOptions, "addWordOptions cannot be null");
    String[] pathSegments = { "v1/customizations", "words" };
    String[] pathParameters = { addWordOptions.customizationId(), addWordOptions.wordName() };
    RequestBuilder builder = RequestBuilder.put(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
        pathParameters));
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("speech_to_text", "v1", "addWord");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    final JsonObject contentJson = new JsonObject();
    if (addWordOptions.word() != null) {
      contentJson.addProperty("word", addWordOptions.word());
    }
    if (addWordOptions.soundsLike() != null) {
      contentJson.add("sounds_like", GsonSingleton.getGson().toJsonTree(addWordOptions.soundsLike()));
    }
    if (addWordOptions.displayAs() != null) {
      contentJson.addProperty("display_as", addWordOptions.displayAs());
    }
    builder.bodyJson(contentJson);
    return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
  }
public ServiceCall < Void > addWord ( AddWordOptions addWordOptions ) { Validator . notNull ( addWordOptions , "addWordOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { addWordOptions . customizationId ( ) , addWordOptions . wordName ( ) } ; RequestBuilder builder = RequestBuilder . put ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "speech_to_text" , "v1" , "addWord" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; if ( addWordOptions . word ( ) != null ) { contentJson . addProperty ( "word" , addWordOptions . word ( ) ) ; } if ( addWordOptions . soundsLike ( ) != null ) { contentJson . add ( "sounds_like" , GsonSingleton . getGson ( ) . toJsonTree ( addWordOptions . soundsLike ( ) ) ) ; } if ( addWordOptions . displayAs ( ) != null ) { contentJson . addProperty ( "display_as" , addWordOptions . displayAs ( ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; }
Add a custom word.

Adds a custom word to a custom language model. The service populates the words resource for a custom model with
out-of-vocabulary (OOV) words from each corpus or grammar that is added to the model. You can use this method to
add a word or to modify an existing word in the words resource. The words resource for a model can contain a
maximum of 30 thousand custom (OOV) words. This includes words that the service extracts from corpora and grammars
and words that you add directly.

You must use credentials for the instance of the service that owns a model to add or modify a custom word for the
model. Adding or modifying a custom word does not affect the custom model until you train the model for the new
data by using the **Train a custom language model** method.

Use the `word_name` parameter to specify the custom word that is to be added or modified. Use the `CustomWord`
object to provide one or both of the optional `sounds_like` and `display_as` fields for the word.
* The `sounds_like` field provides an array of one or more pronunciations for the word. Use the parameter to
specify how the word can be pronounced by users. Use the parameter for words that are difficult to pronounce,
foreign words, acronyms, and so on. For example, you might specify that the word `IEEE` can sound like `i triple
e`. You can specify a maximum of five sounds-like pronunciations for a word.
* The `display_as` field provides a different way of spelling the word in a transcript. Use the parameter when you
want the word to appear different from its usual representation or from its spelling in training data. For example,
you might indicate that the word `IBM(trademark)` is to be displayed as `IBM&trade;`.

If you add a custom word that already exists in the words resource for the custom model, the new definition
overwrites the existing data for the word. If the service encounters an error, it does not add the word to the
words resource. Use the **List a custom word** method to review the word that you add.

**See also:**
* [Working with custom
words](https://cloud.ibm.com/docs/services/speech-to-text/language-resource.html#workingWords)
* [Add words to the custom language
model](https://cloud.ibm.com/docs/services/speech-to-text/language-create.html#addWords).

@param addWordOptions the {@link AddWordOptions} containing the options for the call
@return a {@link ServiceCall} with a response type of Void