Sha256: 4b4d74ad2b59ddb61d008d7fc08f72bdf481a515b2848aeb2fa26eb1aca459ad

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

Stored size: 547 Bytes

Contents

module Picky

  # encoding: utf-8
  #
  module Generators

    module Similarity

      # It's actually a combination of soundex
      # and Levenshtein.
      #
      # It uses the soundex to get similar words
      # and ranks them using the levenshtein.
      #
      class Soundex < Phonetic

        # Encodes the given string/symbol.
        #
        # Returns a symbol.
        #
        def encoded str_or_sym
          code = Text::Soundex.soundex str_or_sym.to_s
          code.intern if code
        end

      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
picky-3.5.4 lib/picky/generators/similarity/soundex.rb
picky-3.5.3 lib/picky/generators/similarity/soundex.rb
picky-3.5.2 lib/picky/generators/similarity/soundex.rb
picky-3.5.1 lib/picky/generators/similarity/soundex.rb