Class: FeldtRuby::Statistics::StringDistance
- Inherits:
-
Object
- Object
- FeldtRuby::Statistics::StringDistance
show all
- Defined in:
- lib/feldtruby/statistics/distance/string_distance.rb
Instance Method Summary
collapse
Instance Method Details
#compress(s) ⇒ Object
6
7
8
|
# File 'lib/feldtruby/statistics/distance/string_distance.rb', line 6
def compress(s)
Zlib::Deflate.deflate(s, 9)
end
|
#compressed_length(s) ⇒ Object
10
11
12
|
# File 'lib/feldtruby/statistics/distance/string_distance.rb', line 10
def compressed_length(s)
compress(s).length
end
|
#distance(string1, string2) ⇒ Object
14
15
16
|
# File 'lib/feldtruby/statistics/distance/string_distance.rb', line 14
def distance(string1, string2)
raise NotImplementedError
end
|