Class: LanguageTools::AlchemyLanguage

Inherits:
Object
  • Object
show all
Includes:
APISmith::Client
Defined in:
lib/esendex4soap.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ AlchemyLanguage

Returns a new instance of AlchemyLanguage.



29
30
31
32
# File 'lib/esendex4soap.rb', line 29

def initialize(api_key)
  @api_key = api_key
  add_query_options! :outputMode => 'json', :apikey => @api_key
end

Instance Method Details

#detect(text) ⇒ Object



34
35
36
# File 'lib/esendex4soap.rb', line 34

def detect(text)
  (post "TextGetLanguage", :extra_query => {:text => text})["language"]
end