hintable_levenshtein 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -78,9 +78,9 @@ class HintableLevenshtein
78
78
  while matrix[position.x][position.y] != 0
79
79
  previous_position = position.dup
80
80
  if position.x == 0
81
- previous.y -= 1
81
+ position.y -= 1
82
82
  elsif position.y == 0
83
- previous.x -= 1
83
+ position.x -= 1
84
84
  else
85
85
  possible_values = [matrix[position.x - 1][position.y], matrix[position.x][position.y - 1], matrix[position.x - 1][position.y - 1]]
86
86
  case possible_values.min
@@ -1,7 +1,7 @@
1
1
  require 'lib/hintable_levenshtein'
2
2
 
3
3
  describe HintableLevenshtein do
4
- it "should do this thing" do
4
+ it "should calculate example 1" do
5
5
  english_rules = [
6
6
  HintableLevenshtein::RuleSet.new(0.3, HintableLevenshtein::Rule.insert(/[\.,!]/)),
7
7
  HintableLevenshtein::RuleSet.new(0.3, HintableLevenshtein::Rule.delete(/[\.,!]/)),
@@ -27,4 +27,11 @@ describe HintableLevenshtein do
27
27
  HintableLevenshtein.new(english_rules).distance(a, b).should == 7.15
28
28
 
29
29
  end
30
+
31
+ it "should calculate example 2" do
32
+ p = "Recusandae quasi dolore corporis"
33
+ p2 = "... quasi dolore corporis"
34
+ HintableLevenshtein.new.distance(p,p2).should == 10.0
35
+ end
36
+
30
37
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hintable_levenshtein
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 3
9
+ version: 0.0.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - Joshua Hull
@@ -9,7 +14,7 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-18 00:00:00 -05:00
17
+ date: 2010-04-29 00:00:00 -04:00
13
18
  default_executable:
14
19
  dependencies: []
15
20
 
@@ -43,18 +48,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
43
48
  requirements:
44
49
  - - ">="
45
50
  - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
46
53
  version: "0"
47
- version:
48
54
  required_rubygems_version: !ruby/object:Gem::Requirement
49
55
  requirements:
50
56
  - - ">="
51
57
  - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
52
60
  version: "0"
53
- version:
54
61
  requirements: []
55
62
 
56
63
  rubyforge_project: joshbuddy-hintable_levenshtein
57
- rubygems_version: 1.3.5
64
+ rubygems_version: 1.3.6
58
65
  signing_key:
59
66
  specification_version: 3
60
67
  summary: Levenshtein with hints