lib/ibm_watson/speech_to_text_v1.rb
def add_words(customization_id:, words:)
      raise ArgumentError.new("customization_id must be provided") if customization_id.nil?

      raise ArgumentError.new("words must be provided") if words.nil?

      headers = {
      }
      sdk_headers = Common.new.get_sdk_headers("speech_to_text", "V1", "add_words")
      headers.merge!(sdk_headers)

      data = {
        "words" => words
      }

      method_url = "/v1/customizations/%s/words" % [ERB::Util.url_encode(customization_id)]

      request(
        method: "POST",
        url: method_url,
        headers: headers,
        json: data,
        accept_json: true
      )
      nil
    end
def add_words(customization_id:, words:)
      raise ArgumentError.new("customization_id must be provided") if customization_id.nil?

      raise ArgumentError.new("words must be provided") if words.nil?

      headers = {
      }
      sdk_headers = Common.new.get_sdk_headers("speech_to_text", "V1", "add_words")
      headers.merge!(sdk_headers)

      data = {
        "words" => words
      }

      method_url = "/v1/customizations/%s/words" % [ERB::Util.url_encode(customization_id)]

      request(
        method: "POST",
        url: method_url,
        headers: headers,
        json: data,
        accept_json: true
      )
      nil
    end
@!method add_words(customization_id:, words:)
 Add custom words.
 Adds one or more custom words 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
   additional words or to modify existing words 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 custom words for the model. Adding or modifying custom words does not
   affect the custom model until you train the model for the new data by using the
   **Train a custom language model** method.

   You add custom words by providing a `CustomWords` object, which is an array of
   `CustomWord` objects, one per word. You must use the object's `word` parameter to
   identify the word that is to be added. You can also provide one or both of the
   optional `sounds_like` and `display_as` fields for each 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 with the input data, it returns a failure code and
   does not add any of the words to the words resource.

   The call returns an HTTP 201 response code if the input data is valid. It then
   asynchronously processes the words to add them to the model's words resource. The
   time that it takes for the analysis to complete depends on the number of new words
   that you add but is generally faster than adding a corpus or grammar.

   You can monitor the status of the request by using the **List a custom language
   model** method to poll the model's status. Use a loop to check the status every 10
   seconds. The method returns a `Customization` object that includes a `status`
   field. A status of `ready` means that the words have been added to the custom
   model. The service cannot accept requests to add new data or to train the model
   until the existing request completes.

   You can use the **List custom words** or **List a custom word** method to review
   the words that you add. Words with an invalid `sounds_like` field include an
   `error` field that describes the problem. You can use other words-related methods
   to correct errors, eliminate typos, and modify how words are pronounced as needed.


   **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 customization_id [String] The customization ID (GUID) of the custom language model that is to be used for
   the request. You must make the request with credentials for the instance of the
   service that owns the custom model.
 @param words [Array[CustomWord]] An array of `CustomWord` objects that provides information about each custom word
   that is to be added to or updated in the custom language model.
 @return [nil]