class TxNlp::Text
Public Class Methods
new(text, action_type = 'SimilarWords')
click to toggle source
# File lib/tx_nlp/text.rb, line 5 def initialize(text, action_type = 'SimilarWords') @action_type = action_type @encode_text = text.tr("\n", ' ') @escape_text = CGI.escape(@encode_text) end
Public Instance Methods
indent_result()
click to toggle source
# File lib/tx_nlp/text.rb, line 19 def indent_result if json['Response']['Error'] json else new_content = raw_result.join(',') new_content end end
raw_result()
click to toggle source
# File lib/tx_nlp/text.rb, line 11 def raw_result if json['Response']['Error'] json else original_data = json['Response']["SimilarWords"] end end