Class: MeaningCloud::Topics
- Inherits:
-
Object
- Object
- MeaningCloud::Topics
- Defined in:
- lib/meaning_cloud/topics.rb
Overview
A class to hold all topic extraction related code.
Class Method Summary collapse
Class Method Details
.extract_topics(options = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/meaning_cloud/topics.rb', line 4 def self.extract_topics( = nil) fail(Exception, 'Missing key') if MeaningCloud.configuration.key.nil? ||= {} = { of: :json, key: MeaningCloud.configuration.key, lang: :en, tt: 'ec', uw: 'y' }.merge() query = URI.encode_www_form() result = RestClient.post("#{API_BASE}?#{query}", {}) JSON.parse(result) end |