azure_stt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/ci.yml +33 -0
  4. data/.gitignore +56 -0
  5. data/.rubocop.yml +22 -0
  6. data/CHANGELOG.md +28 -0
  7. data/CODE_OF_CONDUCT.md +74 -0
  8. data/Gemfile +24 -0
  9. data/Gemfile.lock +141 -0
  10. data/LICENSE +21 -0
  11. data/README.md +129 -0
  12. data/Rakefile +27 -0
  13. data/azure_stt.gemspec +29 -0
  14. data/bin/console +15 -0
  15. data/bin/setup +8 -0
  16. data/docs/AzureBatchTranscription.html +301 -0
  17. data/docs/AzureBatchTranscription/Configuration.html +212 -0
  18. data/docs/AzureSTT.html +305 -0
  19. data/docs/AzureSTT/Client.html +1008 -0
  20. data/docs/AzureSTT/Configuration.html +282 -0
  21. data/docs/AzureSTT/Error.html +305 -0
  22. data/docs/AzureSTT/Models.html +135 -0
  23. data/docs/AzureSTT/Models/Base.html +139 -0
  24. data/docs/AzureSTT/Models/CombinedRecognizedPhrases.html +538 -0
  25. data/docs/AzureSTT/Models/File.html +794 -0
  26. data/docs/AzureSTT/Models/RecognizedPhrase.html +769 -0
  27. data/docs/AzureSTT/Models/Report.html +384 -0
  28. data/docs/AzureSTT/Models/Result.html +796 -0
  29. data/docs/AzureSTT/Models/Sentence.html +615 -0
  30. data/docs/AzureSTT/Models/Transcription.html +1415 -0
  31. data/docs/AzureSTT/Models/Word.html +615 -0
  32. data/docs/AzureSTT/NetError.html +159 -0
  33. data/docs/AzureSTT/Parsers.html +128 -0
  34. data/docs/AzureSTT/Parsers/Base.html +404 -0
  35. data/docs/AzureSTT/Parsers/CombinedRecognizedPhrases.html +156 -0
  36. data/docs/AzureSTT/Parsers/File.html +156 -0
  37. data/docs/AzureSTT/Parsers/RecognizedPhrase.html +156 -0
  38. data/docs/AzureSTT/Parsers/Report.html +156 -0
  39. data/docs/AzureSTT/Parsers/Result.html +156 -0
  40. data/docs/AzureSTT/Parsers/Sentence.html +156 -0
  41. data/docs/AzureSTT/Parsers/Transcription.html +156 -0
  42. data/docs/AzureSTT/Parsers/Word.html +156 -0
  43. data/docs/AzureSTT/ServiceError.html +159 -0
  44. data/docs/AzureSTT/Session.html +767 -0
  45. data/docs/AzureSTT/Transcription.html +635 -0
  46. data/docs/AzureSTT/Types.html +116 -0
  47. data/docs/AzureStt_.html +121 -0
  48. data/docs/_index.html +392 -0
  49. data/docs/class_list.html +51 -0
  50. data/docs/css/common.css +1 -0
  51. data/docs/css/full_list.css +58 -0
  52. data/docs/css/style.css +497 -0
  53. data/docs/file.README.html +201 -0
  54. data/docs/file_list.html +56 -0
  55. data/docs/frames.html +17 -0
  56. data/docs/index.html +201 -0
  57. data/docs/js/app.js +314 -0
  58. data/docs/js/full_list.js +216 -0
  59. data/docs/js/jquery.js +4 -0
  60. data/docs/method_list.html +707 -0
  61. data/docs/top-level-namespace.html +110 -0
  62. data/env.sample +2 -0
  63. data/lib/azure_stt.rb +20 -0
  64. data/lib/azure_stt/client.rb +189 -0
  65. data/lib/azure_stt/configuration.rb +28 -0
  66. data/lib/azure_stt/errors.rb +25 -0
  67. data/lib/azure_stt/models.rb +30 -0
  68. data/lib/azure_stt/models/base.rb +27 -0
  69. data/lib/azure_stt/models/combined_recognized_phrases.rb +48 -0
  70. data/lib/azure_stt/models/file.rb +72 -0
  71. data/lib/azure_stt/models/recognized_phrase.rb +70 -0
  72. data/lib/azure_stt/models/report.rb +31 -0
  73. data/lib/azure_stt/models/result.rb +76 -0
  74. data/lib/azure_stt/models/sentence.rb +53 -0
  75. data/lib/azure_stt/models/transcription.rb +185 -0
  76. data/lib/azure_stt/models/word.rb +54 -0
  77. data/lib/azure_stt/parsers.rb +19 -0
  78. data/lib/azure_stt/parsers/base.rb +42 -0
  79. data/lib/azure_stt/parsers/combined_recognized_phrases.rb +28 -0
  80. data/lib/azure_stt/parsers/file.rb +28 -0
  81. data/lib/azure_stt/parsers/recognized_phrase.rb +45 -0
  82. data/lib/azure_stt/parsers/report.rb +25 -0
  83. data/lib/azure_stt/parsers/result.rb +56 -0
  84. data/lib/azure_stt/parsers/sentence.rb +45 -0
  85. data/lib/azure_stt/parsers/transcription.rb +34 -0
  86. data/lib/azure_stt/parsers/word.rb +28 -0
  87. data/lib/azure_stt/session.rb +100 -0
  88. data/lib/azure_stt/version.rb +5 -0
  89. metadata +158 -0
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ desc 'Run RSpec code examples (unit & integration tests, needs live instance)'
6
+ RSpec::Core::RakeTask.new('spec:all') do |task|
7
+ task.pattern = './spec/**/*_spec.rb'
8
+ task.rspec_opts = '-O .rspec-no-tags'
9
+ end
10
+
11
+ desc 'Run RSpec code examples (unit tests only)'
12
+ RSpec::Core::RakeTask.new(:spec) do |task|
13
+ task.pattern = './spec/**/*_spec.rb'
14
+ task.exclude_pattern = './spec/integration/**/*_spec.rb'
15
+ task.rspec_opts = '-O .rspec'
16
+ end
17
+
18
+ desc 'Run RSpec code examples (integration tests only, needs live instance)'
19
+ RSpec::Core::RakeTask.new('spec:integration') do |task|
20
+ task.pattern = './spec/**/*_spec.rb'
21
+ task.rspec_opts = '-O .rspec --tag integration'
22
+ end
23
+
24
+ desc 'Run CI tests'
25
+ task ci: %i[spec:all]
26
+
27
+ task default: :spec
data/azure_stt.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'azure_stt/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'azure_stt'
9
+ spec.version = AzureStt::VERSION
10
+ spec.authors = ['François Pouly']
11
+ spec.email = ['francois.pouly@perfect-memory.com']
12
+
13
+ spec.summary = 'API Wrapper for the Microsoft Translator Text API 3.0'
14
+ spec.description = 'API Wrapper for the Microsoft Translator Text API 3.0 (Cognitive Services)'
15
+ spec.homepage = 'https://github.com/PerfectMemory/azure_stt'
16
+ spec.license = 'MIT'
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.required_ruby_version = '>= 2.6'
27
+ spec.add_dependency 'dry_struct', '~> 1'
28
+ spec.add_dependency 'httparty', '~> 0.17'
29
+ end
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'azure_stt'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,301 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: AzureBatchTranscription
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "AzureBatchTranscription";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (A)</a> &raquo;
40
+
41
+
42
+ <span class="title">AzureBatchTranscription</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: AzureBatchTranscription
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/azure_batch_transcription.rb<span class="defines">,<br />
82
+ lib/azure_batch_transcription/configuration.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>Top level module for Azure Batch Transcription</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div><h2>Defined Under Namespace</h2>
100
+ <p class="children">
101
+
102
+
103
+
104
+
105
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="AzureBatchTranscription/Configuration.html" title="AzureBatchTranscription::Configuration (class)">Configuration</a></span>
106
+
107
+
108
+ </p>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ <h2>
118
+ Class Method Summary
119
+ <small><a href="#" class="summary_toggle">collapse</a></small>
120
+ </h2>
121
+
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#configuration-class_method" title="configuration (class method)">.<strong>configuration</strong> &#x21d2; Configuration </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'>
142
+ <p>Get the configuration for Azure Batch Transcription.</p>
143
+ </div></span>
144
+
145
+ </li>
146
+
147
+
148
+ <li class="public ">
149
+ <span class="summary_signature">
150
+
151
+ <a href="#configure-class_method" title="configure (class method)">.<strong>configure</strong> {|configuration| ... } &#x21d2; Object </a>
152
+
153
+
154
+
155
+ </span>
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <span class="summary_desc"><div class='inline'>
166
+ <p>Modify the configuration.</p>
167
+ </div></span>
168
+
169
+ </li>
170
+
171
+
172
+ </ul>
173
+
174
+
175
+
176
+
177
+ <div id="class_method_details" class="method_details_list">
178
+ <h2>Class Method Details</h2>
179
+
180
+
181
+ <div class="method_details first">
182
+ <h3 class="signature first" id="configuration-class_method">
183
+
184
+ .<strong>configuration</strong> &#x21d2; <tt><span class='object_link'><a href="AzureBatchTranscription/Configuration.html" title="AzureBatchTranscription::Configuration (class)">Configuration</a></span></tt>
185
+
186
+
187
+
188
+
189
+
190
+ </h3><div class="docstring">
191
+ <div class="discussion">
192
+
193
+ <p>Get the configuration for Azure Batch Transcription</p>
194
+
195
+
196
+ </div>
197
+ </div>
198
+ <div class="tags">
199
+
200
+ <p class="tag_title">Returns:</p>
201
+ <ul class="return">
202
+
203
+ <li>
204
+
205
+
206
+ <span class='type'>(<tt><span class='object_link'><a href="AzureBatchTranscription/Configuration.html" title="AzureBatchTranscription::Configuration (class)">Configuration</a></span></tt>)</span>
207
+
208
+
209
+
210
+ </li>
211
+
212
+ </ul>
213
+
214
+ </div><table class="source_code">
215
+ <tr>
216
+ <td>
217
+ <pre class="lines">
218
+
219
+
220
+ 17
221
+ 18
222
+ 19</pre>
223
+ </td>
224
+ <td>
225
+ <pre class="code"><span class="info file"># File 'lib/azure_batch_transcription/configuration.rb', line 17</span>
226
+
227
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span>
228
+ <span class='ivar'>@configuration</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="AzureBatchTranscription/Configuration.html" title="AzureBatchTranscription::Configuration (class)">Configuration</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
229
+ <span class='kw'>end</span></pre>
230
+ </td>
231
+ </tr>
232
+ </table>
233
+ </div>
234
+
235
+ <div class="method_details ">
236
+ <h3 class="signature " id="configure-class_method">
237
+
238
+ .<strong>configure</strong> {|configuration| ... } &#x21d2; <tt>Object</tt>
239
+
240
+
241
+
242
+
243
+
244
+ </h3><div class="docstring">
245
+ <div class="discussion">
246
+
247
+ <p>Modify the configuration</p>
248
+
249
+
250
+ </div>
251
+ </div>
252
+ <div class="tags">
253
+
254
+ <p class="tag_title">Yields:</p>
255
+ <ul class="yield">
256
+
257
+ <li>
258
+
259
+
260
+ <span class='type'>(<tt><span class='object_link'><a href="#configuration-class_method" title="AzureBatchTranscription.configuration (method)">configuration</a></span></tt>)</span>
261
+
262
+
263
+
264
+ </li>
265
+
266
+ </ul>
267
+
268
+ </div><table class="source_code">
269
+ <tr>
270
+ <td>
271
+ <pre class="lines">
272
+
273
+
274
+ 24
275
+ 25
276
+ 26</pre>
277
+ </td>
278
+ <td>
279
+ <pre class="code"><span class="info file"># File 'lib/azure_batch_transcription/configuration.rb', line 24</span>
280
+
281
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span>
282
+ <span class='kw'>yield</span> <span class='id identifier rubyid_configuration'>configuration</span>
283
+ <span class='kw'>end</span></pre>
284
+ </td>
285
+ </tr>
286
+ </table>
287
+ </div>
288
+
289
+ </div>
290
+
291
+ </div>
292
+
293
+ <div id="footer">
294
+ Generated on Fri Jun 18 13:42:58 2021 by
295
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
296
+ 0.9.26 (ruby-2.6.6).
297
+ </div>
298
+
299
+ </div>
300
+ </body>
301
+ </html>
@@ -0,0 +1,212 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: AzureBatchTranscription::Configuration
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "AzureBatchTranscription::Configuration";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../AzureBatchTranscription.html" title="AzureBatchTranscription (module)">AzureBatchTranscription</a></span></span>
41
+ &raquo;
42
+ <span class="title">Configuration</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: AzureBatchTranscription::Configuration
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">AzureBatchTranscription::Configuration</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/azure_batch_transcription/configuration.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Configurator pattern to be able to change the subscription key. By default the key is in a .env file</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#subscription_key-instance_method" title="#subscription_key (instance method)">#<strong>subscription_key</strong> &#x21d2; Object </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'>
141
+ <p>Returns the value of attribute subscription_key.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ </ul>
148
+
149
+
150
+
151
+
152
+
153
+ <div id="instance_attr_details" class="attr_details">
154
+ <h2>Instance Attribute Details</h2>
155
+
156
+
157
+ <span id="subscription_key=-instance_method"></span>
158
+ <div class="method_details first">
159
+ <h3 class="signature first" id="subscription_key-instance_method">
160
+
161
+ #<strong>subscription_key</strong> &#x21d2; <tt>Object</tt>
162
+
163
+
164
+
165
+
166
+
167
+ </h3><div class="docstring">
168
+ <div class="discussion">
169
+
170
+ <p>Returns the value of attribute subscription_key.</p>
171
+
172
+
173
+ </div>
174
+ </div>
175
+ <div class="tags">
176
+
177
+
178
+ </div><table class="source_code">
179
+ <tr>
180
+ <td>
181
+ <pre class="lines">
182
+
183
+
184
+ 9
185
+ 10
186
+ 11</pre>
187
+ </td>
188
+ <td>
189
+ <pre class="code"><span class="info file"># File 'lib/azure_batch_transcription/configuration.rb', line 9</span>
190
+
191
+ <span class='kw'>def</span> <span class='id identifier rubyid_subscription_key'>subscription_key</span>
192
+ <span class='ivar'>@subscription_key</span>
193
+ <span class='kw'>end</span></pre>
194
+ </td>
195
+ </tr>
196
+ </table>
197
+ </div>
198
+
199
+ </div>
200
+
201
+
202
+ </div>
203
+
204
+ <div id="footer">
205
+ Generated on Fri Jun 18 13:42:58 2021 by
206
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
207
+ 0.9.26 (ruby-2.6.6).
208
+ </div>
209
+
210
+ </div>
211
+ </body>
212
+ </html>