ibm_watson 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/ibm_watson/speech_to_text_v1.rb +8 -3
- data/lib/ibm_watson/version.rb +1 -1
- data/rakefile +12 -2
- data/test/appveyor_status.rb +32 -0
- data/test/integration/test_natural_language_understanding_v1.rb +1 -0
- data/test/test_helper.rb +7 -0
- data/test/unit/test_speech_to_text_v1.rb +1 -1
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b87852bad66c7293b30582cf1132423fa52c44c8807265bc7ac51a0347937734
|
4
|
+
data.tar.gz: db46dca5381564614209204d1a0ad2211e34e3b5a08bdf353d50fc40bdd898cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f106391369de42ea88b9d017833a0d434723e5854e5d732d12b8392536529e9d4fa75567980e3cbe00269f0a90d33f1f1cd00ebb8880a376caca0e070a2ec1
|
7
|
+
data.tar.gz: 4bdd105efcda1ddd1b7d9f464a703c576d463cd2da8ad332df772159fc55267d1c1243557146ec4c5beeb3b9d3811c8204b5268eb890bc99968a795b57c39368
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# IBM Watson Ruby SDK
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/watson-developer-cloud/ruby-sdk.svg)](https://travis-ci.org/watson-developer-cloud/ruby-sdk)
|
4
|
+
[![Build status](https://ci.appveyor.com/api/projects/status/ir3k0ue138o4u67e?svg=true)](https://ci.appveyor.com/project/maxnussbaum/ruby-sdk)
|
4
5
|
[![Slack](https://wdc-slack-inviter.mybluemix.net/badge.svg)](https://wdc-slack-inviter.mybluemix.net)
|
5
6
|
[![codecov.io](https://codecov.io/github/watson-developer-cloud/ruby-sdk/coverage.svg)](https://codecov.io/github/watson-developer-cloud/ruby-sdk)
|
6
7
|
[![Gem Version](https://badge.fury.io/rb/ibm_watson.svg)](https://badge.fury.io/rb/ibm_watson)
|
@@ -275,7 +276,9 @@ Note: `recognize_with_websocket` has been **deprecated** in favor of **`recogniz
|
|
275
276
|
|
276
277
|
## Ruby version
|
277
278
|
|
278
|
-
Tested on
|
279
|
+
Tested on:
|
280
|
+
* MRI Ruby (RVM): 2.3.7, 2.4.4, 2.5.1
|
281
|
+
* RubyInstaller (Windows x64): 2.3.3, 2.4.4, 2.5.1
|
279
282
|
|
280
283
|
## Contributing
|
281
284
|
|
@@ -1537,7 +1537,7 @@ module IBMWatson
|
|
1537
1537
|
end
|
1538
1538
|
|
1539
1539
|
##
|
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)
|
1541
1541
|
# Add a custom word.
|
1542
1542
|
# Adds a custom word to a custom language model. The service populates the words
|
1543
1543
|
# resource for a custom model with out-of-vocabulary (OOV) words found in each
|
@@ -1579,6 +1579,11 @@ module IBMWatson
|
|
1579
1579
|
# @param word_name [String] The custom word for the custom language model. When you add or update a custom
|
1580
1580
|
# word with the **Add a custom word** method, do not include spaces in the word. Use
|
1581
1581
|
# 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.
|
1582
1587
|
# @param sounds_like [Array[String]] An array of sounds-like pronunciations for the custom word. Specify how words that
|
1583
1588
|
# are difficult to pronounce, foreign words, acronyms, and so on can be pronounced
|
1584
1589
|
# by users. For a word that is not in the service's base vocabulary, omit the
|
@@ -1593,13 +1598,13 @@ module IBMWatson
|
|
1593
1598
|
# the parameter when you want the word to have a spelling that is different from its
|
1594
1599
|
# usual representation or from its spelling in corpora training data.
|
1595
1600
|
# @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)
|
1597
1602
|
raise ArgumentError("customization_id must be provided") if customization_id.nil?
|
1598
1603
|
raise ArgumentError("word_name must be provided") if word_name.nil?
|
1599
1604
|
headers = {
|
1600
1605
|
}
|
1601
1606
|
data = {
|
1602
|
-
"word" =>
|
1607
|
+
"word" => word,
|
1603
1608
|
"sounds_like" => sounds_like,
|
1604
1609
|
"display_as" => display_as
|
1605
1610
|
}
|
data/lib/ibm_watson/version.rb
CHANGED
data/rakefile
CHANGED
@@ -16,6 +16,7 @@ namespace :test do
|
|
16
16
|
t.test_files = FileList["test/unit/*.rb"]
|
17
17
|
t.verbose = true
|
18
18
|
t.warning = true
|
19
|
+
t.deps = [:rubocop]
|
19
20
|
end
|
20
21
|
|
21
22
|
Rake::TestTask.new do |t|
|
@@ -25,7 +26,16 @@ namespace :test do
|
|
25
26
|
t.test_files = FileList["test/integration/*.rb"]
|
26
27
|
t.verbose = true
|
27
28
|
t.warning = true
|
28
|
-
t.deps = [
|
29
|
+
t.deps = %i[dotenv rubocop]
|
30
|
+
end
|
31
|
+
|
32
|
+
Rake::TestTask.new do |t|
|
33
|
+
t.name = "appveyor_status"
|
34
|
+
t.description = "Checks to ensure that AppVeyor tests pass before deploying from Travis"
|
35
|
+
t.libs << "test"
|
36
|
+
t.test_files = FileList["test/appveyor_status.rb"]
|
37
|
+
t.verbose = false
|
38
|
+
t.warning = false
|
29
39
|
end
|
30
40
|
end
|
31
41
|
|
@@ -41,5 +51,5 @@ task :coverage do
|
|
41
51
|
Rake::Task["test"].execute
|
42
52
|
end
|
43
53
|
|
44
|
-
task def: %i[
|
54
|
+
task def: %i[coverage] do
|
45
55
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require("minitest/reporters")
|
4
|
+
require("minitest/autorun")
|
5
|
+
require("minitest/retry")
|
6
|
+
require("http")
|
7
|
+
require("json")
|
8
|
+
|
9
|
+
Minitest::Retry.use!
|
10
|
+
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true), Minitest::Reporters::SpecReporter.new]
|
11
|
+
|
12
|
+
# Test to run from Travis to ensure that AppVeyor tests pass before attempting to deploy to RubyGems
|
13
|
+
class AppVeyorStatusTest < Minitest::Test
|
14
|
+
def test_appveyor_status
|
15
|
+
skip "Branch is NOT master and/or Ruby != 2.5.1, so AppVeyor check before deployment will not be run." if ENV["TRAVIS_BRANCH"] != "master" || ENV["TRAVIS_RUBY_VERSION"] != "2.5.1"
|
16
|
+
client = HTTP::Client.new
|
17
|
+
attempts = 0
|
18
|
+
status = JSON.parse(client.get("https://ci.appveyor.com/api/projects/maxnussbaum/ruby-sdk").body.to_s)["build"]["status"]
|
19
|
+
puts("0 AppVeyor Status: #{status}")
|
20
|
+
while status != "success" && status != "failed" && status != "cancelled"
|
21
|
+
attempts += 1
|
22
|
+
sleep(15)
|
23
|
+
status = JSON.parse(client.get("https://ci.appveyor.com/api/projects/maxnussbaum/ruby-sdk").body.to_s)["build"]["status"]
|
24
|
+
puts("#{attempts} AppVeyor Status: #{status}")
|
25
|
+
end
|
26
|
+
if status == "success"
|
27
|
+
assert(true)
|
28
|
+
else
|
29
|
+
assert(false, "AppVeyor tests have NOT passed! Please ensure that AppVeyor passes before deploying")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -82,6 +82,7 @@ unless ENV["NATURAL_LANGUAGE_UNDERSTANDING_USERNAME"].nil? || ENV["NATURAL_LANGU
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_list_models
|
85
|
+
skip
|
85
86
|
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
86
87
|
version: "2018-03-16",
|
87
88
|
username: ENV["NATURAL_LANGUAGE_UNDERSTANDING_USERNAME"],
|
data/test/test_helper.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require("simplecov")
|
4
4
|
require("codecov")
|
5
|
+
require("minitest/reporters")
|
5
6
|
|
6
7
|
if ENV["COVERAGE"]
|
7
8
|
SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV["CI"]
|
@@ -19,3 +20,9 @@ end
|
|
19
20
|
|
20
21
|
require("minitest/autorun")
|
21
22
|
require_relative("./../lib/ibm_watson.rb")
|
23
|
+
require("minitest/retry")
|
24
|
+
|
25
|
+
Minitest::Retry.use!
|
26
|
+
|
27
|
+
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true, slow_count: 10), Minitest::Reporters::SpecReporter.new, Minitest::Reporters::HtmlReporter.new] if ENV["CI"].nil?
|
28
|
+
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true, slow_count: 10), Minitest::Reporters::SpecReporter.new] if ENV["CI"]
|
@@ -408,7 +408,7 @@ class SpeechToTextV1Test < Minitest::Test
|
|
408
408
|
)
|
409
409
|
stub_request(:put, "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/custid/words/IEEE")
|
410
410
|
.with(
|
411
|
-
body: "{\"
|
411
|
+
body: "{\"sounds_like\":[\"i triple e\"],\"display_as\":\"IEEE\"}",
|
412
412
|
headers: {
|
413
413
|
"Accept" => "application/json",
|
414
414
|
"Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibm_watson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Nussbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07
|
11
|
+
date: 2018-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -150,6 +150,34 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '1.5'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: minitest-reporters
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.3'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.3'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: minitest-retry
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.1'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.1'
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
182
|
name: rake
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,6 +262,7 @@ files:
|
|
234
262
|
- lib/ibm_watson/websocket/recognize_callback.rb
|
235
263
|
- lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb
|
236
264
|
- rakefile
|
265
|
+
- test/appveyor_status.rb
|
237
266
|
- test/integration/test_assistant_v1.rb
|
238
267
|
- test/integration/test_discovery_v1.rb
|
239
268
|
- test/integration/test_iam_assistant_v1.rb
|