Sha256: 7f7dfb33cc7d275b0bc940b001961a9b18f0e871a531dfd4a73e694038bf917b

Contents?: true

Size: 270 Bytes

Versions: 11

Compression:

Stored size: 270 Bytes

Contents

class Cl
  module Suggest
    def suggest(dict, value)
      return [] unless defined?(DidYouMean::SpellChecker)
      Array(value).map do |value|
        DidYouMean::SpellChecker.new(dictionary: dict.map(&:to_s)).correct(value.to_s)
      end.flatten
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
travis-cl-1.2.4 lib/cl/helper/suggest.rb
cl-1.2.4 lib/cl/helper/suggest.rb
cl-1.2.3 lib/cl/helper/suggest.rb
cl-1.2.2 lib/cl/helper/suggest.rb
cl-1.2.1 lib/cl/helper/suggest.rb
cl-1.2.0 lib/cl/helper/suggest.rb
cl-1.1.5 lib/cl/helper/suggest.rb
cl-1.1.4 lib/cl/helper/suggest.rb
cl-1.1.3 lib/cl/helper/suggest.rb
cl-1.1.2 lib/cl/helper/suggest.rb
cl-1.1.1 lib/cl/helper/suggest.rb