Sha256: 5c5c9221bbe170fe2fb415faf5215c3cfafdc59743d14dc48d662e508558ff48

Contents?: true

Size: 583 Bytes

Versions: 30

Compression:

Stored size: 583 Bytes

Contents

module Picky

  # encoding: utf-8
  #
  module Generators

    module Similarity

      # 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.
      #
      class DoubleMetaphone < Phonetic

        # Encodes the given symbol.
        #
        # Returns a symbol.
        #
        def encoded sym
          codes = Text::Metaphone.double_metaphone sym.to_s
          codes.first.to_sym unless codes.empty?
        end

      end

    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
picky-3.4.3 lib/picky/generators/similarity/double_metaphone.rb
picky-3.4.2 lib/picky/generators/similarity/double_metaphone.rb
picky-3.4.1 lib/picky/generators/similarity/double_metaphone.rb
picky-3.4.0 lib/picky/generators/similarity/double_metaphone.rb
picky-3.3.3 lib/picky/generators/similarity/double_metaphone.rb
picky-3.3.2 lib/picky/generators/similarity/double_metaphone.rb
picky-3.3.1 lib/picky/generators/similarity/double_metaphone.rb
picky-3.3.0 lib/picky/generators/similarity/double_metaphone.rb
picky-3.2.0 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.13 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.12 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.11 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.10 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.9 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.8 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.7 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.6 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.5 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.4 lib/picky/generators/similarity/double_metaphone.rb
picky-3.1.3 lib/picky/generators/similarity/double_metaphone.rb