dynarex-levenshtein 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/dynarexlevenshtein.rb +3 -2
  2. metadata +1 -1
@@ -17,8 +17,8 @@ class DynarexLevenshtein
17
17
  a, b = [a, b].sort_by(&:length)
18
18
  n, m = a.length, b.length
19
19
 
20
- schema = 'table[title,string1,string2]/rows(' + (['line','label'] + (1..n)\
21
- .map{|x| "col%s" % x}).join(',') + ')'
20
+ schema = 'table[title,string1,string2, distance]/rows(' + \
21
+ (['line','label'] + (1..n).map{|x| "col%s" % x}).join(',') + ')'
22
22
  @to_dynarex = Dynarex.new(schema)
23
23
 
24
24
  @to_dynarex.summary[:title] = 'Calculates the Levenshtein distance between a and b.'
@@ -50,6 +50,7 @@ class DynarexLevenshtein
50
50
  h = Hash[([:line, :label] + (0..n).map{|x| ("col%s" % x).to_sym}).zip([(m+1).to_s, label[-1]] + current)]
51
51
  @to_dynarex.create h
52
52
 
53
+ @to_dynarex.summary[:distance] = current[n]
53
54
  current[n]
54
55
  end
55
56
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex-levenshtein
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson