rosette_api 1.14.4 → 1.37.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +23 -16
  4. data/examples/README.md +2 -2
  5. data/examples/address_similarity.rb +7 -6
  6. data/examples/categories.rb +9 -8
  7. data/examples/entities.rb +8 -8
  8. data/examples/events.rb +23 -0
  9. data/examples/info.rb +7 -6
  10. data/examples/language.rb +7 -6
  11. data/examples/language_multilingual.rb +7 -6
  12. data/examples/morphology_complete.rb +7 -6
  13. data/examples/morphology_compound-components.rb +7 -6
  14. data/examples/morphology_han-readings.rb +7 -6
  15. data/examples/morphology_lemmas.rb +7 -6
  16. data/examples/morphology_parts-of-speech.rb +7 -6
  17. data/examples/multipart_language_file.rb +29 -0
  18. data/examples/name_deduplication.rb +7 -6
  19. data/examples/name_similarity.rb +9 -7
  20. data/examples/name_translation.rb +7 -6
  21. data/examples/ping.rb +7 -6
  22. data/examples/record_similarity.rb +114 -0
  23. data/examples/relationships.rb +7 -6
  24. data/examples/semantic_vectors.rb +7 -6
  25. data/examples/sentences.rb +7 -6
  26. data/examples/sentiment.rb +8 -7
  27. data/examples/similar_terms.rb +7 -6
  28. data/examples/syntax_dependencies.rb +7 -6
  29. data/examples/tokens.rb +7 -6
  30. data/examples/topics.rb +7 -6
  31. data/examples/transliteration.rb +7 -6
  32. data/lib/address_parameter.rb +3 -4
  33. data/lib/address_similarity_parameters.rb +13 -6
  34. data/lib/bad_request_error.rb +3 -3
  35. data/lib/bad_request_format_error.rb +3 -3
  36. data/lib/document_parameters.rb +10 -12
  37. data/lib/name_deduplication_parameters.rb +5 -8
  38. data/lib/name_parameter.rb +22 -5
  39. data/lib/name_similarity_parameters.rb +51 -21
  40. data/lib/name_translation_parameters.rb +17 -10
  41. data/lib/record_similarity_parameters.rb +68 -0
  42. data/lib/request_builder.rb +94 -54
  43. data/lib/rosette_api.rb +90 -50
  44. data/lib/rosette_api_error.rb +5 -4
  45. metadata +28 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b38b4872ea8951d43abf562f7feed44bf672e2508ec78e34c6e05327293b8c35
4
- data.tar.gz: 5608e8136b43a67a771fe860f51deee5c14da58aefa90211d6bb0be77a14834a
3
+ metadata.gz: 648715b05a66f8b54708e36ae3a6548d8a07c0e06f5c225060a1a7c02fea6208
4
+ data.tar.gz: 15a9eb85d4df30ee6b6de01fb2f0b4ca48863b3da492c95793784b46a514c58d
5
5
  SHA512:
6
- metadata.gz: 85f6244f0c40958eabe5165b85dc2ee13e849924f9a500404391541bfb490291e46b8461dcc4f3bfd90ca54ff04ba5585d3b9654d4df8b9b3d2d7c72a4f031ae
7
- data.tar.gz: 2dea9f348e81a32fa8f6e692f66385fe0b4143b34902d03765d027087f0b83f670bb428845d77afded27a12bfa013a52b806d042e233266e3cd5924a805bcd64
6
+ metadata.gz: d9f43d9d0333720b3ad08e7460ea92fbeffbd22b3e4f445b21b51f50a74b14ee3b5eb7677a0af8a444f0aa3f718d0e7ca8ad59ff3f3187ae665b2f81f0a83adf
7
+ data.tar.gz: 5b404dd299bc6e06964d19cbe51c71b3f1efa266d631ac462d31be85f058dfbdba130964092572df5596988b97367f605377f0ab31a17da689ead9ba04e34fe0
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2019 Basis Technology Corporation.
1
+ Copyright (c) 2016-2026 Babel Street Rosette Ltd.
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,18 +1,26 @@
1
- <a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
1
+ <a href="https://www.babelstreet.com/modules">
2
+ <img src="https://charts.babelstreet.com/icon.png" width="48" height="48" alt="Babel Street Logo"/>
3
+ </a>
2
4
 
3
- ---
5
+ # Analytics by Babel Street
4
6
 
5
- [![Build Status](https://travis-ci.org/rosette-api/ruby.svg?branch=develop)](https://travis-ci.org/rosette-api/ruby) [![Gem Version](https://badge.fury.io/rb/rosette_api.svg)](https://badge.fury.io/rb/rosette_api)
7
+ [![Gem Version](https://badge.fury.io/rb/rosette_api.svg)](https://badge.fury.io/rb/rosette_api)
6
8
 
7
- ## Rosette API
8
- The Rosette Text Analytics Platform uses natural language processing, statistical modeling, and machine learning to
9
- analyze unstructured and semi-structured text across 364 language-encoding-script combinations, revealing valuable
10
- information and actionable data. Rosette provides endpoints for extracting entities and relationships, translating and
11
- comparing the similarity of names, categorizing and adding linguistic tags to text and more.
9
+ Our product is a full text processing pipeline from data preparation to extracting the most relevant information and
10
+ analysis utilizing precise, focused AI that has built-in human understanding. Text Analytics provides foundational
11
+ linguistic analysis for identifying languages and relating words. The result is enriched and normalized text for
12
+ high-speed search and processing without translation.
12
13
 
13
- ## Rosette API Access
14
- - Rosette Cloud [Sign Up](https://developer.rosette.com/signup)
15
- - Rosette Enterprise [Evaluation](https://www.rosette.com/product-eval/)
14
+ Text Analytics extracts events and entities — people, organizations, and places — from unstructured text and adds the
15
+ structure of associating those entities into events that deliver only the necessary information for near real-time
16
+ decision making. Accompanying tools shorten the process of training AI models to recognize domain-specific events.
17
+
18
+ The product delivers a multitude of ways to sharpen and expand search results. Semantic similarity expands search
19
+ beyond keywords to words with the same meaning, even in other languages. Sentiment analysis and topic extraction help
20
+ filter results to what’s relevant.
21
+
22
+ ## Analytics API Access
23
+ - Analytics Cloud [Sign Up](https://developer.babelstreet.com/signup)
16
24
 
17
25
  ## Quick Start
18
26
 
@@ -21,16 +29,15 @@ comparing the similarity of names, categorizing and adding linguistic tags to te
21
29
  `gem install rosette_api`
22
30
 
23
31
  #### Examples
24
- View small example programs for each Rosette endpoint
32
+ View small example programs for each Analytics endpoint
25
33
  in the [examples](https://github.com/rosette-api/ruby/tree/develop/examples) directory.
26
34
 
27
35
  #### Documentation & Support
28
36
  - [Binding API](https://rosette-api.github.io/ruby/)
29
- - [Rosette Platform API](https://developer.rosette.com/features-and-functions)
37
+ - [Analytics Platform API](https://documentation.babelstreet.com/analytics)
30
38
  - [Binding Release Notes](https://github.com/rosette-api/ruby/wiki/Release-Notes)
31
- - [Rosette Platform Release Notes](https://support.rosette.com/hc/en-us/articles/360018354971-Release-Notes)
32
- - [Binding/Rosette Platform Compatibility](https://developer.rosette.com/features-and-functions?ruby#)
33
- - [Support](https://support.rosette.com)
39
+ - [Analytics Platform Release Notes](https://docs.babelstreet.com/r/Hosted-Services-Release-Notes)
40
+ - [Support](https://babelstreet.my.site.com/support/s/contactsupport)
34
41
  - [Binding License: Apache 2.0](https://github.com/rosette-api/ruby/blob/develop/LICENSE)
35
42
 
36
43
  ## Binding Developer Information
data/examples/README.md CHANGED
@@ -13,7 +13,7 @@ A note on prerequisites. Rosette API only suports TLS 1.2 so ensure your toolcha
13
13
  ```
14
14
  git clone git@github.com:rosette-api/ruby.git
15
15
  cd ruby
16
- docker run -it -v $(pwd):/source --entrypoint bash ruby:2.6-slim-stretch
16
+ docker run -it -v $(pwd):/source --entrypoint bash ruby:3.4-slim
17
17
 
18
18
  gem install rosette_api
19
19
 
@@ -25,7 +25,7 @@ ruby ping.rb $API_KEY
25
25
  ```
26
26
  git clone git@github.com:rosette-api/ruby.git
27
27
  cd ruby
28
- docker run -it -v $(pwd):/source --entrypoint bash ruby:2.6-slim-stretch
28
+ docker run -it -v $(pwd):/source --entrypoint bash ruby:3.4-slim
29
29
 
30
30
  cd /source
31
31
  gem build rosette_api.gemspec
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  begin
14
15
  address1 = AddressParameter.new(
@@ -20,7 +21,7 @@ begin
20
21
  )
21
22
  address2 = '160 Pennsilvana Avenue, Washington, D.C., 20500'
22
23
  params = AddressSimilarityParameters.new(address1, address2)
23
- response = rosette_api.get_address_similarity(params)
24
+ response = analytics_api.get_address_similarity(params)
24
25
  puts JSON.pretty_generate(response)
25
26
  rescue RosetteAPIError => e
26
27
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
- categories_url_data = 'https://onlocationvacations.com/2018/02/06/downton-abbey-exhibition-extended-april-2-nyc/'
14
+ categories_text_data = 'If you are a fan of the British television series Downton Abbey and you are planning to be in New York anytime before April 2nd, there is a perfect stop for you while in town.'
14
15
  begin
15
- params = DocumentParameters.new(content_uri: categories_url_data)
16
- response = rosette_api.get_categories(params)
16
+ params = DocumentParameters.new(content: categories_text_data)
17
+ response = analytics_api.get_categories(params)
17
18
  puts JSON.pretty_generate(response)
18
19
  rescue RosetteAPIError => e
19
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
data/examples/entities.rb CHANGED
@@ -1,20 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  entities_text_data = 'The Securities and Exchange Commission today announced the leadership of the agency\'s trial unit. Bridget Fitzpatrick has been named Chief Litigation Counsel of the SEC and David Gottesman will continue to serve as the agency\'s Deputy Chief Litigation Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief Litigation Counsel. In that role, they were jointly responsible for supervising the trial unit at the agency\'s Washington D.C. headquarters as well as coordinating with litigators in the SEC\'s 11 regional offices around the country.'
14
15
  begin
15
- params = DocumentParameters.new(content: entities_text_data,
16
- genre: 'social-media')
17
- response = rosette_api.get_entities(params)
16
+ params = DocumentParameters.new(content: entities_text_data)
17
+ response = analytics_api.get_entities(params)
18
18
  puts JSON.pretty_generate(response)
19
19
  rescue RosetteAPIError => e
20
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+ require 'rosette_api'
5
+
6
+ api_key, url = ARGV
7
+
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
13
+
14
+ events_text_data = 'Bill Gates went to the store.'
15
+ begin
16
+ params = DocumentParameters.new(content: events_text_data)
17
+ response = analytics_api.get_events(params)
18
+ puts JSON.pretty_generate(response)
19
+ rescue RosetteAPIError => e
20
+ printf('Rosette API Error (%<status_code>s): %<message>s',
21
+ status_code: e.status_code,
22
+ message: e.message)
23
+ end
data/examples/info.rb CHANGED
@@ -1,16 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
- response = rosette_api.info
14
+ response = analytics_api.info
14
15
  begin
15
16
  puts JSON.pretty_generate(response)
16
17
  rescue RosetteAPIError => e
data/examples/language.rb CHANGED
@@ -1,20 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  language_data = 'Por favor Señorita, says the man.'
14
15
  begin
15
16
  params = DocumentParameters.new(content: language_data)
16
17
  params.custom_headers = { 'X-RosetteAPI-App' => 'ruby-app' }
17
- response = rosette_api.get_language(params)
18
+ response = analytics_api.get_language(params)
18
19
  puts JSON.pretty_generate(response)
19
20
  rescue RosetteAPIError => e
20
21
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  language_multilingual_data = 'On Thursday, as protesters gathered in Washington D.C., the United States Federal Communications Commission under Chairman Ajit Pai voted 3-2 to overturn a 2015 decision, commonly called Net Neutrality, that forbade Internet service providers (ISPs) such as Verizon, Comcast, and AT&T from blocking individual websites or charging websites or customers more for faster load times. Quatre femmes ont été nommées au Conseil de rédaction de la loi du Qatar. Jeudi, le décret royal du Qatar a annoncé que 28 nouveaux membres ont été nommés pour le Conseil de la Choura du pays. ذكرت مصادر أمنية يونانية، أن 9 موقوفين من منظمة \"د هـ ك ب ج\" الذين كانت قد أوقفتهم الشرطة اليونانية في وقت سابق كانوا يخططون لاغتيال الرئيس التركي رجب طيب أردوغان.'
14
15
 
@@ -16,7 +17,7 @@ begin
16
17
  params = DocumentParameters.new(content: language_multilingual_data)
17
18
  params.rosette_options = { 'multilingual' => 'true' }
18
19
  params.custom_headers = { 'X-RosetteAPI-App' => 'ruby-app' }
19
- response = rosette_api.get_language(params)
20
+ response = analytics_api.get_language(params)
20
21
  puts JSON.pretty_generate(response)
21
22
  rescue RosetteAPIError => e
22
23
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  morphology_complete_data = 'The quick brown fox jumped over the lazy dog. 👍🏾 Yes he did. B)'
14
15
  begin
15
16
  params = DocumentParameters.new(content: morphology_complete_data)
16
- response = rosette_api.get_morphology_complete(params)
17
+ response = analytics_api.get_morphology_complete(params)
17
18
  puts JSON.pretty_generate(response)
18
19
  rescue RosetteAPIError => e
19
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,21 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  morphology_compound_components_data = 'Rechtsschutzversicherungsgesellschaften'
14
15
  begin
15
16
  params = DocumentParameters.new(
16
17
  content: morphology_compound_components_data
17
18
  )
18
- response = rosette_api.get_compound_components(params)
19
+ response = analytics_api.get_compound_components(params)
19
20
  puts JSON.pretty_generate(response)
20
21
  rescue RosetteAPIError => e
21
22
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  morphology_han_readings_data = '北京大学生物系主任办公室内部会议'
14
15
  begin
15
16
  params = DocumentParameters.new(content: morphology_han_readings_data)
16
- response = rosette_api.get_han_readings(params)
17
+ response = analytics_api.get_han_readings(params)
17
18
  puts JSON.pretty_generate(response)
18
19
  rescue RosetteAPIError => e
19
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  morphology_lemmas_data = 'The fact is that the geese just went back to get a rest and I\'m not banking on their return soon'
14
15
  begin
15
16
  params = DocumentParameters.new(content: morphology_lemmas_data)
16
- response = rosette_api.get_lemmas(params)
17
+ response = analytics_api.get_lemmas(params)
17
18
  puts JSON.pretty_generate(response)
18
19
  rescue RosetteAPIError => e
19
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  morphology_parts_of_speech_data = 'The fact is that the geese just went back to get a rest and I\'m not banking on their return soon'
14
15
  begin
15
16
  params = DocumentParameters.new(content: morphology_parts_of_speech_data)
16
- response = rosette_api.get_parts_of_speech(params)
17
+ response = analytics_api.get_parts_of_speech(params)
17
18
  puts JSON.pretty_generate(response)
18
19
  rescue RosetteAPIError => e
19
20
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require 'json'
5
+ require 'rosette_api'
6
+
7
+ api_key, url = ARGV
8
+
9
+ analytics_api = if url
10
+ RosetteAPI.new(api_key, url)
11
+ else
12
+ RosetteAPI.new(api_key)
13
+ end
14
+
15
+ begin
16
+ # Create a sample file to upload (so the example is runnable as-is).
17
+ file_path = File.expand_path('sample.txt', __dir__)
18
+ File.write(file_path, "Bonjour tout le monde.\n")
19
+
20
+ params = DocumentParameters.new(file_path: file_path)
21
+ response = analytics_api.get_language(params)
22
+ puts JSON.pretty_generate(response)
23
+ rescue RosetteAPIError => e
24
+ printf('Rosette API Error (%<status_code>s): %<message>s',
25
+ status_code: e.status_code,
26
+ message: e.message)
27
+ ensure
28
+ FileUtils.rm_f(file_path)
29
+ end
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  name_dedupe_data = 'Alice Terry,Alice Thierry,Betty Grable,Betty Gable,Norma Shearer,Norm Shearer,Brigitte Helm,Bridget Helem,Judy Holliday,Julie Halliday'
14
15
 
@@ -16,7 +17,7 @@ threshold = 0.75
16
17
  names = name_dedupe_data.split(',').map { |n| NameParameter.new(n) }
17
18
  begin
18
19
  params = NameDeduplicationParameters.new(names, threshold)
19
- response = rosette_api.get_name_deduplication(params)
20
+ response = analytics_api.get_name_deduplication(params)
20
21
  puts JSON.pretty_generate(response)
21
22
  rescue RosetteAPIError => e
22
23
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  matched_name_data1 = 'Michael Jackson'
14
15
  matched_name_data2 = '迈克尔·杰克逊'
@@ -18,8 +19,9 @@ begin
18
19
  entity_type: 'PERSON',
19
20
  language: 'eng'
20
21
  )
21
- params = NameSimilarityParameters.new(name1, matched_name_data2)
22
- response = rosette_api.get_name_similarity(params)
22
+ match_parameters = { conflictScore: '0.35' }
23
+ params = NameSimilarityParameters.new(name1, matched_name_data2, match_parameters)
24
+ response = analytics_api.get_name_similarity(params)
23
25
  puts JSON.pretty_generate(response)
24
26
  rescue RosetteAPIError => e
25
27
  printf('Rosette API Error (%<status_code>s): %<message>s',
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  translated_name_data = 'معمر محمد أبو منيار القذاف'
14
15
  begin
@@ -17,7 +18,7 @@ begin
17
18
  'eng',
18
19
  target_script: 'Latn'
19
20
  )
20
- response = rosette_api.get_name_translation(params)
21
+ response = analytics_api.get_name_translation(params)
21
22
  puts JSON.pretty_generate(response)
22
23
  rescue RosetteAPIError => e
23
24
  printf('Rosette API Error (%<status_code>s): %<message>s',
data/examples/ping.rb CHANGED
@@ -1,17 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require 'rosette_api'
4
5
 
5
6
  api_key, url = ARGV
6
7
 
7
- rosette_api = if url
8
- RosetteAPI.new(api_key, url)
9
- else
10
- RosetteAPI.new(api_key)
11
- end
8
+ analytics_api = if url
9
+ RosetteAPI.new(api_key, url)
10
+ else
11
+ RosetteAPI.new(api_key)
12
+ end
12
13
 
13
14
  begin
14
- response = rosette_api.ping
15
+ response = analytics_api.ping
15
16
  puts JSON.pretty_generate(response)
16
17
  rescue RosetteAPIError => e
17
18
  printf('Rosette API Error (%<status_code>s): %<message>s',