Module: ODDB::Text::Soundex

Defined in:
src/util/soundex.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) get_code(char)



64
65
66
# File 'src/util/soundex.rb', line 64

def get_code(char)
  char.tr! "AEIOUYWHBPFVCSKGJQXZDTLMNR", "00000000111122222222334556"
end

- (Object) prepare(str)



69
70
71
# File 'src/util/soundex.rb', line 69

def prepare(str)
  ODDB.search_term(str)
end

- (Object) soundex(str_or_arr)



19
20
21
22
23
24
25
26
27
28
# File 'src/util/soundex.rb', line 19

def soundex(str_or_arr)
  case str_or_arr
  when String
    soundex_str(str_or_arr)
  when Array
    str_or_arr.collect{|ele| soundex_str(ele)}
  else
    nil
  end
end