Class: Phonos::Analyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/phonos/analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Analyzer

Returns a new instance of Analyzer.



23
24
25
26
27
28
29
30
# File 'lib/phonos/analyzer.rb', line 23

def initialize(*args)
  @cache = if args.last.kind_of? ActiveSupport::Cache::Store
    args.pop
  else
    ActiveSupport::Cache.lookup_store :memory_store
  end
  @langs = args.clone
end

Instance Method Details

#analyze(raw_text) ⇒ Object



32
33
34
35
# File 'lib/phonos/analyzer.rb', line 32

def analyze raw_text
  data = prepare raw_text
  calculate data, get_stats(data)
end