From 3a8ca11516110bc31f02190be257b36892837b6b Mon Sep 17 00:00:00 2001 From: Nicolas Cian Date: Thu, 23 Dec 2021 11:00:33 -0300 Subject: [PATCH 1/3] Upgrade Faraday to >= 1.0.0 --- dandelionapi.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dandelionapi.gemspec b/dandelionapi.gemspec index bc3c551..762e990 100644 --- a/dandelionapi.gemspec +++ b/dandelionapi.gemspec @@ -21,8 +21,8 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 1.9.3' - spec.add_dependency "faraday", '~> 0.9', '>= 0.9.0' - spec.add_dependency "faraday_middleware", '~> 0.9', '>= 0.9.1' + spec.add_dependency "faraday", '~> 1.0', '>= 1.0.0' + spec.add_dependency "faraday_middleware", '~> 1.0', '>= 1.0.0' spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.1" From b0b384361bad201ec88718864a9827770dca7c85 Mon Sep 17 00:00:00 2001 From: Nicolas Cian Date: Thu, 23 Dec 2021 11:01:05 -0300 Subject: [PATCH 2/3] Fix tests --- spec/entity_extraction_spec.rb | 4 ++-- spec/language_detection_spec.rb | 4 ++-- spec/sentiment_analysis_spec.rb | 4 ++-- spec/text_similarity_spec.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/entity_extraction_spec.rb b/spec/entity_extraction_spec.rb index 69b69b6..10539e4 100644 --- a/spec/entity_extraction_spec.rb +++ b/spec/entity_extraction_spec.rb @@ -15,7 +15,7 @@ # account: Mario Rossi c.token = "YOUR-TEST-TOKEN" c.endpoint = "https://api.dandelion.eu/" - c.path = "datatxt/" + c.path = "datatxt" end end @@ -43,7 +43,7 @@ it "make a request to nex using a blog url" do element = Dandelionapi::EntityExtraction::Request.new - response = element.analyze(url: "http://blog.andreamostosi.name") + response = element.analyze(url: "https://www.cambridgeenglish.org/blog") expect(response).not_to be_empty expect(response["lang"]).to eq("en") expect(response["annotations"]).to be_an_instance_of(Array) diff --git a/spec/language_detection_spec.rb b/spec/language_detection_spec.rb index c53d1e9..a6490bb 100644 --- a/spec/language_detection_spec.rb +++ b/spec/language_detection_spec.rb @@ -15,7 +15,7 @@ # account: Mario Rossi c.token = "YOUR-TEST-TOKEN" c.endpoint = "https://api.dandelion.eu/" - c.path = "datatxt/" + c.path = "datatxt" end end @@ -41,7 +41,7 @@ it "make a request to li using a blog url" do element = Dandelionapi::LanguageDetection::Request.new - response = element.analyze(url: "http://blog.andreamostosi.name") + response = element.analyze(url: "https://www.cambridgeenglish.org/blog") expect(response).not_to be_empty expect(response["detectedLangs"]).to be_an_instance_of(Array) response["detectedLangs"].each do |a| diff --git a/spec/sentiment_analysis_spec.rb b/spec/sentiment_analysis_spec.rb index 968ee11..06aa308 100644 --- a/spec/sentiment_analysis_spec.rb +++ b/spec/sentiment_analysis_spec.rb @@ -15,7 +15,7 @@ # account: Mario Rossi c.token = "YOUR-TEST-TOKEN" c.endpoint = "https://api.dandelion.eu/" - c.path = "datatxt/" + c.path = "datatxt" end end @@ -40,7 +40,7 @@ it "make a request to sent using a blog url" do element = Dandelionapi::SentimentAnalysis::Request.new - response = element.analyze(url: "http://blog.andreamostosi.name") + response = element.analyze(url: "https://www.cambridgeenglish.org/blog") expect(response).not_to be_empty expect(response["sentiment"]).not_to be_empty expect(response["sentiment"]["score"]).to be >= -1.0 diff --git a/spec/text_similarity_spec.rb b/spec/text_similarity_spec.rb index a8226b5..1b64d41 100644 --- a/spec/text_similarity_spec.rb +++ b/spec/text_similarity_spec.rb @@ -11,7 +11,7 @@ # account: Mario Rossi c.token = "YOUR-TEST-TOKEN" c.endpoint = "https://api.dandelion.eu/" - c.path = "datatxt/" + c.path = "datatxt" end end From 9b249ea9fae08333ea4fcbac154b852f0cc1a0e1 Mon Sep 17 00:00:00 2001 From: Nicolas Cian Date: Thu, 23 Dec 2021 11:02:04 -0300 Subject: [PATCH 3/3] Update documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f76b60b..40ba2c4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Setup configuration parameters Dandelionapi.configure do |c| c.token = "your-token-for-dandelionapi-account" c.endpoint = "https://api.dandelion.eu/" - c.path = "datatxt/" + c.path = "datatxt" end ``` @@ -43,7 +43,7 @@ response = element.analyze(text: "This is a test") ``` element = Dandelionapi::TextSimilarity::Request.new -response = element.analyze(text1: "This is a test", text2: "This is another test") +response = element.compare(text1: "This is a test", text2: "This is another test") ``` **[Language Detection API](https://dandelion.eu/docs/api/datatxt/li/v1/)**: