Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
ruby /
vendor_ruby /
did_you_mean /
Delete
Unzip
Name
Size
Permission
Date
Action
core_ext
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
extra_features
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
spell_checkers
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
extra_features.rb
453
B
-rwxrwxrwx
2016-03-01 19:31
formatter.rb
319
B
-rwxrwxrwx
2016-03-01 19:31
jaro_winkler.rb
1.79
KB
-rwxrwxrwx
2016-03-01 19:31
levenshtein.rb
1.27
KB
-rwxrwxrwx
2016-03-01 19:31
spell_checkable.rb
1.43
KB
-rwxrwxrwx
2016-03-01 19:31
verbose_formatter.rb
355
B
-rwxrwxrwx
2016-03-01 19:31
version.rb
42
B
-rwxrwxrwx
2016-03-01 19:31
Save
Rename
# -*- frozen-string-literal: true -*- require "did_you_mean/levenshtein" require "did_you_mean/jaro_winkler" module DidYouMean module SpellCheckable def corrections @corrections ||= candidates.flat_map do |input, candidates| input = normalize(input) threshold = input.length > 3 ? 0.834 : 0.77 seed = candidates.select {|candidate| JaroWinkler.distance(normalize(candidate), input) >= threshold } .sort_by! {|candidate| JaroWinkler.distance(candidate.to_s, input) } .reverse! # Correct mistypes threshold = (input.length * 0.25).ceil has_mistype = seed.rindex {|c| Levenshtein.distance(normalize(c), input) <= threshold } corrections = if has_mistype seed.take(has_mistype + 1) else # Correct misspells seed.select do |candidate| candidate = normalize(candidate) length = input.length < candidate.length ? input.length : candidate.length Levenshtein.distance(candidate, input) < length end.first(1) end corrections end end def candidates raise NotImplementedError end private def normalize(str_or_symbol) #:nodoc: str = if str_or_symbol.is_a?(String) str_or_symbol.dup else str_or_symbol.to_s end str.downcase! str.tr!("@", "") str end end end