Class: Picky::Generators::Similarity::DoubleMetaphone

Inherits:
Phonetic show all
Defined in:
lib/picky/generators/similarity/double_metaphone.rb

Overview

It’s actually a combination of double metaphone and Levenshtein.

It uses the double metaphone to get similar words and ranks them using the levenshtein.

Instance Attribute Summary

Attributes inherited from Phonetic

#amount

Instance Method Summary collapse

Methods inherited from Phonetic

#check_gem, #initialize, #prioritize

Methods inherited from Picky::Generators::Strategy

#saved?, #to_s

Constructor Details

This class inherits a constructor from Picky::Generators::Similarity::Phonetic

Instance Method Details

#encode(str_or_sym) ⇒ Object

Encodes the given string/symbol.

Returns a symbol.



21
22
23
# File 'lib/picky/generators/similarity/double_metaphone.rb', line 21

def encode str_or_sym
  str_or_sym.double_metaphone
end