Sha256: b4293a7754885157baef601599040d9c93acd1e4bf7c21b7b748e02c7dc8f2a8

Contents?: true

Size: 536 Bytes

Versions: 1

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.intern if code
        end

      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picky-3.5.0 lib/picky/generators/similarity/metaphone.rb