Class: SyllabsApi::Client
- Inherits:
-
Object
- Object
- SyllabsApi::Client
- Defined in:
- lib/syllabs-api/client.rb
Instance Method Summary collapse
- #entities(text) ⇒ Object
- #evaluations(text) ⇒ Object
- #extract_from_url(url) ⇒ Object
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #languages(text) ⇒ Object
- #terms(text) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 |
# File 'lib/syllabs-api/client.rb', line 4 def initialize(api_key) raise InvalidKey if api_key.nil? @api_key = api_key rescue Exception => e raise e end |
Instance Method Details
#entities(text) ⇒ Object
23 24 25 26 27 |
# File 'lib/syllabs-api/client.rb', line 23 def entities(text) Modules::NamedEntityExtraction::Base.process(@api_key, text).entities rescue Exception => e raise e end |
#evaluations(text) ⇒ Object
17 18 19 20 21 |
# File 'lib/syllabs-api/client.rb', line 17 def evaluations(text) Modules::SentimentAnalysis::Base.process(@api_key, text).evaluations rescue Exception => e raise e end |
#extract_from_url(url) ⇒ Object
29 30 31 32 33 |
# File 'lib/syllabs-api/client.rb', line 29 def extract_from_url(url) Modules::Extract::Base.process(@api_key, url).text rescue Exception => e raise e end |
#languages(text) ⇒ Object
35 36 37 38 39 |
# File 'lib/syllabs-api/client.rb', line 35 def languages(text) Modules::LanguageDetection::Base.process(@api_key, text).languages rescue Exception => e raise e end |