simstring_pure 1.0.0 → 1.1.1

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/simstring_pure.rb +12 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9626d0b524a0b66517fb736af6d39d03bf2d61a3
4
- data.tar.gz: 91817a82fc24bda6d383f8c429b3a81cea0989b5
3
+ metadata.gz: 9733d2ee56f3c95d1fc3a483c5fc0791a40f221f
4
+ data.tar.gz: 53e69ca93dae86a227954107a3baca9eddcd0f65
5
5
  SHA512:
6
- metadata.gz: c2182f5348eeadb1ab1f7a9a04cb63117174041a1aab34a411a17c97bc4f585da96099a1b31cfc097696c2295fce2fe040fdcd291df2497660d449a8931a273e
7
- data.tar.gz: 9f548a200810181726e2d9a74155222c0de9a2f74d92803933b35a3f626ca8e183b6d24753a85b4860e80b84017b1b8a1bdcc5d7a5cad38a5819db4187c7ab31
6
+ metadata.gz: 6f90d0c66fc502d749c67e5f12a7241599dd5646337cf664097237762db5773a19540375a200bb110b13ad2977beb486b88171bda3eef7577a77e28f6fd4be14
7
+ data.tar.gz: 50490e3405a21a81d12a17c82f639ae1152939035f7e6acd60083e72aef9f42cc7769d600525de5373656e90758a0a0a54dce0b9adbac116694f1086e572d332
@@ -157,6 +157,18 @@ module SimString
157
157
  end
158
158
  end
159
159
 
160
+ class ComputeSimilarity
161
+ def initialize(feature_extractor, measure)
162
+ @feature_extractor, @measure = feature_extractor, measure
163
+ end
164
+
165
+ def similarity(string1, string2)
166
+ feature_set1 = @feature_extractor.features(string1)
167
+ feature_set2 = @feature_extractor.features(string2)
168
+ @measure.similarity(feature_set1, feature_set2)
169
+ end
170
+ end
171
+
160
172
 
161
173
  class Database
162
174
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simstring_pure
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-08 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby implementation of the SimString approximate string matching algorithm.
14
14
  email: davidkellis@gmail.com
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 2.4.5.1
42
+ rubygems_version: 2.5.1
43
43
  signing_key:
44
44
  specification_version: 4
45
45
  summary: SimString approximate string matching library.