Class: Opener::PolarityTagger

Inherits:
Object
  • Object
show all
Defined in:
lib/opener/polarity_tagger.rb,
lib/opener/polarity_tagger/cli.rb,
lib/opener/polarity_tagger/server.rb,
lib/opener/polarity_tagger/version.rb,
lib/opener/polarity_tagger/external.rb,
lib/opener/polarity_tagger/internal.rb,
lib/opener/polarity_tagger/lexicon_map.rb,
lib/opener/polarity_tagger/lexicons_cache.rb

Defined Under Namespace

Classes: CLI, External, Internal, LexiconMap, LexiconsCache, Server

Constant Summary collapse

VERSION =
'3.5.5'

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PolarityTagger

Returns a new instance of PolarityTagger.



16
17
18
19
20
21
# File 'lib/opener/polarity_tagger.rb', line 16

def initialize options = {}
  @args    = options.delete(:args) || []
  @options = options
  @klass   = if ENV['LEGACY'] then External else Internal end
  @proc    = @klass.new args: @args
end

Instance Method Details

#clear_cache(params = {}) ⇒ Object



23
24
25
# File 'lib/opener/polarity_tagger.rb', line 23

def clear_cache params = {}
  @proc.clear_cache(**params)
end

#run(input, params = {}) ⇒ Object



27
28
29
# File 'lib/opener/polarity_tagger.rb', line 27

def run input, params = {}
  @proc.run input, params
end