Class: Dandelionapi::LanguageDetection
- Defined in:
- lib/dandelionapi/language_detection.rb
Constant Summary collapse
- ENDPOINT =
"/datatxt/li/v1"
Instance Attribute Summary collapse
-
#clean ⇒ Object
Returns the value of attribute clean.
-
#html ⇒ Object
Returns the value of attribute html.
-
#html_fragment ⇒ Object
Returns the value of attribute html_fragment.
-
#text ⇒ Object
Returns the value of attribute text.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#clean ⇒ Object
Returns the value of attribute clean.
13 14 15 |
# File 'lib/dandelionapi/language_detection.rb', line 13 def clean @clean end |
#html ⇒ Object
Returns the value of attribute html.
13 14 15 |
# File 'lib/dandelionapi/language_detection.rb', line 13 def html @html end |
#html_fragment ⇒ Object
Returns the value of attribute html_fragment.
13 14 15 |
# File 'lib/dandelionapi/language_detection.rb', line 13 def html_fragment @html_fragment end |
#text ⇒ Object
Returns the value of attribute text.
13 14 15 |
# File 'lib/dandelionapi/language_detection.rb', line 13 def text @text end |
#url ⇒ Object
Returns the value of attribute url.
13 14 15 |
# File 'lib/dandelionapi/language_detection.rb', line 13 def url @url end |
Instance Method Details
#analyze(options) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/dandelionapi/language_detection.rb', line 15 def analyze() raise MissingParameters.new("Please provide one of the following parameters: text, url, html or html_fragment") if ([:text, :url, :html, :html_fragment] & .keys).empty? params = call(ENDPOINT, params) end |