Sha256: 9bad17452f471f13587fd6a57ccd92f50ad59ef7a72b0bb94a42e1fe949b5833

Contents?: true

Size: 536 Bytes

Versions: 30

Compression:

Stored size: 536 Bytes

Contents

module Picky

  # encoding: utf-8
  #
  module Generators

    module Similarity

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

        # Encodes the given symbol.
        #
        # Returns a symbol.
        #
        def encoded sym
          code = Text::Metaphone.metaphone sym.to_s
          code.to_sym if code
        end

      end

    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
picky-3.1.2 lib/picky/generators/similarity/metaphone.rb
picky-3.1.1 lib/picky/generators/similarity/metaphone.rb
picky-3.1.0 lib/picky/generators/similarity/metaphone.rb
picky-3.0.1 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0.pre5 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0.pre4 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0.pre3 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0.pre2 lib/picky/generators/similarity/metaphone.rb
picky-3.0.0.pre1 lib/picky/generators/similarity/metaphone.rb