Module: DamerauLevenshtein::FormatterTag

Defined in:
lib/damerau-levenshtein/formatter.rb

Overview

Outputs strings marked with tags

Class Method Summary collapse

Class Method Details

.show(raw_format, str1, str2) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/damerau-levenshtein/formatter.rb', line 25

def show(raw_format, str1, str2)
  inverted_raw_format = raw_format.map do |e|
    type = invert_type(e[:type])
    { distance: e[:distance], type: type }
  end
  [show_string(raw_format, str1, str2),
   show_string(inverted_raw_format, str2, str1)]
end