Sha256: 2852db600a199578d89f9338cd4f13eda99e7b0acf2e651b79cca66c0641228d

Contents?: true

Size: 583 Bytes

Versions: 15

Compression:

Stored size: 583 Bytes

Contents

# encoding: utf-8
#
module Internals

  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

15 entries across 15 versions & 1 rubygems

Version Path
picky-2.5.2 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.5.1 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.5.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.4.3 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.4.2 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.4.1 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.4.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.3.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.2.1 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.2.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.1.2 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.1.1 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.1.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.0.0 lib/picky/internals/generators/similarity/double_metaphone.rb
picky-2.0.0.pre3 lib/picky/internals/generators/similarity/double_metaphone.rb