Skip to content

Commit a3b42fb

Browse files
committed
fix(Speech To Text): Remove post-generation patch for add_word
1 parent 67a2e16 commit a3b42fb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/ibm_watson/speech_to_text_v1.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ def add_words(customization_id:, words:)
15371537
end
15381538

15391539
##
1540-
# @!method add_word(customization_id:, word_name:, sounds_like: nil, display_as: nil)
1540+
# @!method add_word(customization_id:, word_name:, word: nil, sounds_like: nil, display_as: nil)
15411541
# Add a custom word.
15421542
# Adds a custom word to a custom language model. The service populates the words
15431543
# resource for a custom model with out-of-vocabulary (OOV) words found in each
@@ -1579,6 +1579,11 @@ def add_words(customization_id:, words:)
15791579
# @param word_name [String] The custom word for the custom language model. When you add or update a custom
15801580
# word with the **Add a custom word** method, do not include spaces in the word. Use
15811581
# a `-` (dash) or `_` (underscore) to connect the tokens of compound words.
1582+
# @param word [String] For the **Add custom words** method, you must specify the custom word that is to
1583+
# be added to or updated in the custom model. Do not include spaces in the word. Use
1584+
# a `-` (dash) or `_` (underscore) to connect the tokens of compound words.
1585+
#
1586+
# Omit this field for the **Add a custom word** method.
15821587
# @param sounds_like [Array[String]] An array of sounds-like pronunciations for the custom word. Specify how words that
15831588
# are difficult to pronounce, foreign words, acronyms, and so on can be pronounced
15841589
# by users. For a word that is not in the service's base vocabulary, omit the
@@ -1593,13 +1598,13 @@ def add_words(customization_id:, words:)
15931598
# the parameter when you want the word to have a spelling that is different from its
15941599
# usual representation or from its spelling in corpora training data.
15951600
# @return [nil]
1596-
def add_word(customization_id:, word_name:, sounds_like: nil, display_as: nil)
1601+
def add_word(customization_id:, word_name:, word: nil, sounds_like: nil, display_as: nil)
15971602
raise ArgumentError("customization_id must be provided") if customization_id.nil?
15981603
raise ArgumentError("word_name must be provided") if word_name.nil?
15991604
headers = {
16001605
}
16011606
data = {
1602-
"word" => word_name,
1607+
"word" => word,
16031608
"sounds_like" => sounds_like,
16041609
"display_as" => display_as
16051610
}

test/unit/test_speech_to_text_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_custom_words
408408
)
409409
stub_request(:put, "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/custid/words/IEEE")
410410
.with(
411-
body: "{\"word\":\"IEEE\",\"sounds_like\":[\"i triple e\"],\"display_as\":\"IEEE\"}",
411+
body: "{\"sounds_like\":[\"i triple e\"],\"display_as\":\"IEEE\"}",
412412
headers: {
413413
"Accept" => "application/json",
414414
"Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",

0 commit comments

Comments
 (0)