|
29 | 29 | 'User-Agent' => @user_agent, |
30 | 30 | 'X-Rosetteapi-Key' => '0123456789', |
31 | 31 | 'X-Rosetteapi-Binding' => 'ruby', |
32 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 32 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
33 | 33 | .to_return(status: 200, body: '{"test": "language"}', headers: {}) |
34 | 34 | end |
35 | 35 | it 'test language' do |
|
63 | 63 | 'User-Agent' => @user_agent, |
64 | 64 | 'X-Rosetteapi-Key' => '0123456789', |
65 | 65 | 'X-Rosetteapi-Binding' => 'ruby', |
66 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 66 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
67 | 67 | .to_return(status: 200, body: '{"test": "morphology/complete"}', headers: {}) |
68 | 68 | end |
69 | 69 | it 'test morphology complete' do |
|
84 | 84 | 'User-Agent' => @user_agent, |
85 | 85 | 'X-Rosetteapi-Key' => '0123456789', |
86 | 86 | 'X-Rosetteapi-Binding' => 'ruby', |
87 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 87 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
88 | 88 | .to_return(status: 200, body: '{"test": "morphology/compound-components"}', headers: {}) |
89 | 89 | end |
90 | 90 | it 'test morphology compound components' do |
|
105 | 105 | 'User-Agent' => @user_agent, |
106 | 106 | 'X-Rosetteapi-Key' => '0123456789', |
107 | 107 | 'X-Rosetteapi-Binding' => 'ruby', |
108 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 108 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
109 | 109 | .to_return(status: 200, body: '{"test": "morphology/han-readings"}', headers: {}) |
110 | 110 | end |
111 | 111 | it 'test morphology han readings' do |
|
126 | 126 | 'User-Agent' => @user_agent, |
127 | 127 | 'X-Rosetteapi-Key' => '0123456789', |
128 | 128 | 'X-Rosetteapi-Binding' => 'ruby', |
129 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 129 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
130 | 130 | .to_return(status: 200, body: '{"test": "morphology/parts-of-speech"}', headers: {}) |
131 | 131 | end |
132 | 132 | it 'test morphology parts of speech' do |
|
147 | 147 | 'User-Agent' => @user_agent, |
148 | 148 | 'X-Rosetteapi-Key' => '0123456789', |
149 | 149 | 'X-Rosetteapi-Binding' => 'ruby', |
150 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 150 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
151 | 151 | .to_return(status: 200, body: '{"test": "morphology/lemmas"}', headers: {}) |
152 | 152 | end |
153 | 153 | it 'test morphology lemmas' do |
|
168 | 168 | 'User-Agent' => @user_agent, |
169 | 169 | 'X-Rosetteapi-Key' => '0123456789', |
170 | 170 | 'X-Rosetteapi-Binding' => 'ruby', |
171 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 171 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
172 | 172 | .to_return(status: 200, body: '{"test": "entities"}', headers: {}) |
173 | 173 | end |
174 | 174 | it 'test entities' do |
|
190 | 190 | 'User-Agent' => @user_agent, |
191 | 191 | 'X-Rosetteapi-Key' => '0123456789', |
192 | 192 | 'X-Rosetteapi-Binding' => 'ruby', |
193 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 193 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
194 | 194 | .to_return(status: 200, body: '{"test": "entities"}', headers: {}) |
195 | 195 | end |
196 | 196 | it 'test entities without qids' do |
|
221 | 221 | 'User-Agent' => @user_agent, |
222 | 222 | 'X-Rosetteapi-Key' => '0123456789', |
223 | 223 | 'X-Rosetteapi-Binding' => 'ruby', |
224 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 224 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
225 | 225 | .to_return(status: 200, body: '{"test": "categories"}', headers: {}) |
226 | 226 | end |
227 | 227 | it 'test categories' do |
|
242 | 242 | 'User-Agent' => @user_agent, |
243 | 243 | 'X-Rosetteapi-Key' => '0123456789', |
244 | 244 | 'X-Rosetteapi-Binding' => 'ruby', |
245 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 245 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
246 | 246 | .to_return(status: 200, body: '{"test": "relationships"}', headers: {}) |
247 | 247 | end |
248 | 248 | it 'test relationships' do |
|
264 | 264 | 'User-Agent' => @user_agent, |
265 | 265 | 'X-Rosetteapi-Key' => '0123456789', |
266 | 266 | 'X-Rosetteapi-Binding' => 'ruby', |
267 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 267 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
268 | 268 | .to_return(status: 200, body: '{"test": "name-translation"}', headers: {}) |
269 | 269 | end |
270 | 270 | it 'test name translation' do |
|
291 | 291 | 'User-Agent' => @user_agent, |
292 | 292 | 'X-Rosetteapi-Key' => '0123456789', |
293 | 293 | 'X-Rosetteapi-Binding' => 'ruby', |
294 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 294 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
295 | 295 | .to_return(status: 200, body: '{"test": "name-similarity"}', headers: {}) |
296 | 296 | end |
297 | 297 | it 'test name similarity' do |
|
329 | 329 | 'User-Agent' => @user_agent, |
330 | 330 | 'X-Rosetteapi-Key' => '0123456789', |
331 | 331 | 'X-Rosetteapi-Binding' => 'ruby', |
332 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 332 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
333 | 333 | .to_return(status: 200, body: '{"test": "name-deduplication"}', headers: {}) |
334 | 334 |
|
335 | 335 | nothresh_json = { names: names.map(&:load_param) }.to_json |
|
342 | 342 | 'User-Agent' => @user_agent, |
343 | 343 | 'X-Rosetteapi-Key' => '0123456789', |
344 | 344 | 'X-Rosetteapi-Binding' => 'ruby', |
345 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 345 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
346 | 346 | .to_return(status: 200, body: '{"test": "name-deduplication"}', headers: {}) |
347 | 347 | end |
348 | 348 | it 'test name deduplication' do |
|
393 | 393 | 'User-Agent' => @user_agent, |
394 | 394 | 'X-Rosetteapi-Key' => '0123456789', |
395 | 395 | 'X-Rosetteapi-Binding' => 'ruby', |
396 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 396 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
397 | 397 | .to_return(status: 200, body: '{"test": "transliteration"}', headers: {}) |
398 | 398 | end |
399 | 399 | it 'test transliteration' do |
|
426 | 426 | 'User-Agent' => @user_agent, |
427 | 427 | 'X-Rosetteapi-Key' => '0123456789', |
428 | 428 | 'X-Rosetteapi-Binding' => 'ruby', |
429 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 429 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
430 | 430 | .to_return(status: 200, body: '{"test": "tokens"}', headers: {}) |
431 | 431 | end |
432 | 432 | it 'test tokens' do |
|
447 | 447 | 'User-Agent' => @user_agent, |
448 | 448 | 'X-Rosetteapi-Key' => '0123456789', |
449 | 449 | 'X-Rosetteapi-Binding' => 'ruby', |
450 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 450 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
451 | 451 | .to_return(status: 200, body: '{"test": "topics"}', headers: {}) |
452 | 452 | end |
453 | 453 | it 'test topics' do |
|
468 | 468 | 'User-Agent' => @user_agent, |
469 | 469 | 'X-Rosetteapi-Key' => '0123456789', |
470 | 470 | 'X-Rosetteapi-Binding' => 'ruby', |
471 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 471 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
472 | 472 | .to_return(status: 200, body: '{"test": "sentences"}', headers: {}) |
473 | 473 | end |
474 | 474 | it 'test sentences' do |
|
519 | 519 | 'User-Agent' => @user_agent, |
520 | 520 | 'X-Rosetteapi-Key' => '0123456789', |
521 | 521 | 'X-Rosetteapi-Binding' => 'ruby', |
522 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2', |
| 522 | + 'X-Rosetteapi-Binding-Version' => '1.12.1', |
523 | 523 | 'X-RosetteApi-App' => 'ruby-app' }) |
524 | 524 | .to_return(status: 200, body: '{"test": "language"}', headers: {}) |
525 | 525 | end |
|
546 | 546 | end |
547 | 547 | end |
548 | 548 |
|
549 | | - describe '.get_text_embedding' do |
| 549 | + describe '.get_similar_terms' do |
550 | 550 | before do |
551 | | - stub_request(:post, 'https://api.rosette.com/rest/v1/text-embedding') |
| 551 | + stub_request(:post, 'https://api.rosette.com/rest/v1/semantics/similar') |
552 | 552 | .with(body: @json, |
553 | 553 | headers: { 'Accept' => 'application/json', |
554 | 554 | 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', |
555 | 555 | 'Content-Type' => 'application/json', |
556 | 556 | 'User-Agent' => @user_agent, |
557 | 557 | 'X-Rosetteapi-Key' => '0123456789', |
558 | 558 | 'X-Rosetteapi-Binding' => 'ruby', |
559 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 559 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
560 | 560 | .to_return(status: 200, body: '{"test": "language"}', headers: {}) |
561 | 561 | end |
562 | | - it 'test text_embedding' do |
| 562 | + it 'test similar_terms' do |
| 563 | + params = DocumentParameters.new(content: @content, options: { "resultLanguages" => [ "spa", "deu", "jpn" ] }) |
| 564 | + response = RosetteAPI.new('0123456789').get_similar_terms(params) |
| 565 | + expect(response).instance_of? Hash |
| 566 | + end |
| 567 | + end |
| 568 | + |
| 569 | + describe '.get_semantic_vectors' do |
| 570 | + before do |
| 571 | + stub_request(:post, 'https://api.rosette.com/rest/v1/semantics/vector') |
| 572 | + .with(body: @json, |
| 573 | + headers: { 'Accept' => 'application/json', |
| 574 | + 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', |
| 575 | + 'Content-Type' => 'application/json', |
| 576 | + 'User-Agent' => @user_agent, |
| 577 | + 'X-Rosetteapi-Key' => '0123456789', |
| 578 | + 'X-Rosetteapi-Binding' => 'ruby', |
| 579 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
| 580 | + .to_return(status: 200, body: '{"test": "language"}', headers: {}) |
| 581 | + end |
| 582 | + it 'test semantic_vectors' do |
563 | 583 | params = DocumentParameters.new |
564 | 584 | params.content = @content |
565 | | - response = RosetteAPI.new('0123456789').get_text_embedding(params) |
| 585 | + response = RosetteAPI.new('0123456789').get_semantic_vectors(params) |
566 | 586 | expect(response).instance_of? Hash |
567 | 587 | end |
568 | 588 | end |
|
577 | 597 | 'User-Agent' => @user_agent, |
578 | 598 | 'X-Rosetteapi-Key' => '0123456789', |
579 | 599 | 'X-Rosetteapi-Binding' => 'ruby', |
580 | | - 'X-Rosetteapi-Binding-Version' => '1.9.2' }) |
| 600 | + 'X-Rosetteapi-Binding-Version' => '1.12.1' }) |
581 | 601 | .to_return(status: 200, body: '{"test": "language"}', headers: {}) |
582 | 602 | end |
583 | 603 | it 'test syntax_dependencies' do |
|
0 commit comments