Module: MoneyHeuristics::Heuristics

Defined in:
lib/money-heuristics/heuristics.rb

Instance Method Summary collapse

Instance Method Details

#analyze(str, filters: []) ⇒ Object

An robust and efficient algorithm for finding currencies in text. Using several algorithms it can find symbols, iso codes and even names of currencies. Although not recommendable, it can also attempt to find the given currency in an entire sentence

Returns: Array (matched results)



13
14
15
16
17
# File 'lib/money-heuristics/heuristics.rb', line 13

def analyze(str, filters: [])
  @_heuristics_search_tree ||= MoneyHeuristics::SearchTree.new(table).build

  return MoneyHeuristics::Analyzer.new(str, @_heuristics_search_tree).process(filters)
end