Class: Smshelper::Languagetools::AlchemyLanguage

Inherits:
Base
  • Object
show all
Includes:
APISmith::Client
Defined in:
lib/smshelper/languagetools/languagetools.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Smshelper::Languagetools::Base

Instance Method Details

#detect(text) ⇒ Object



27
28
29
30
# File 'lib/smshelper/languagetools/languagetools.rb', line 27

def detect(text)
  add_query_options! :outputMode => 'json', :apikey => @api_key
  (post "TextGetLanguage", :extra_query => {:text => text})["language"]
end