/
/
opt
/
alt
/
ruby32
/
share
/
ruby
/
did_you_mean
/
spell_checkers
Server: server63.web-hosting.com (198.54.116.184)
You: 216.73.216.187
PHP 7.4.33
Dir:
/opt/alt/ruby32/share/ruby/did_you_mean/spell_checkers
Edit:
/opt/alt/ruby32/share/ruby/did_you_mean/spell_checkers/pattern_key_name_checker.rb
require_relative "../spell_checker" module DidYouMean class PatternKeyNameChecker def initialize(no_matching_pattern_key_error) @key = no_matching_pattern_key_error.key @keys = no_matching_pattern_key_error.matchee.keys end def corrections @corrections ||= exact_matches.empty? ? SpellChecker.new(dictionary: @keys).correct(@key).map(&:inspect) : exact_matches end private def exact_matches @exact_matches ||= @keys.select { |word| @key == word.to_s }.map(&:inspect) end end end
Ukuran: 539 B