fuzzy_match 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Gemfile +2 -2
- data/highlevel.graffle +0 -0
- data/highlevel.png +0 -0
- data/lib/fuzzy_match.rb +1 -1
- data/lib/fuzzy_match/version.rb +1 -1
- data/spec/fuzzy_match_spec.rb +4 -4
- metadata +29 -5
- checksums.yaml +0 -15
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/highlevel.graffle
CHANGED
Binary file
|
data/highlevel.png
CHANGED
Binary file
|
data/lib/fuzzy_match.rb
CHANGED
@@ -80,7 +80,7 @@ class FuzzyMatch
|
|
80
80
|
end
|
81
81
|
@default_options = DEFAULT_OPTIONS.merge(o).freeze
|
82
82
|
|
83
|
-
@haystack = haystack.map { |original| Record.new original, stop_words
|
83
|
+
@haystack = haystack.map { |original| Record.new original, :stop_words => @stop_words, :read => @read }
|
84
84
|
end
|
85
85
|
|
86
86
|
def last_result
|
data/lib/fuzzy_match/version.rb
CHANGED
data/spec/fuzzy_match_spec.rb
CHANGED
@@ -87,7 +87,7 @@ describe FuzzyMatch do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
it %{can be used to improve results} do
|
90
|
-
d = FuzzyMatch.new ['BOEING 737-100/200', 'BOEING 737-900'], groupings
|
90
|
+
d = FuzzyMatch.new ['BOEING 737-100/200', 'BOEING 737-900'], :groupings => [ [/boeing/i, /7(\d\d)-?(\d\d\d)?/]]
|
91
91
|
d.find('BOEING 737100 number 900').should == 'BOEING 737-100/200'
|
92
92
|
end
|
93
93
|
end
|
@@ -109,7 +109,7 @@ describe FuzzyMatch do
|
|
109
109
|
two = '2 sauk TWOTWOTWOTWO'
|
110
110
|
d = FuzzyMatch.new([one, two])
|
111
111
|
d.find('1 sauk TWOTWOTWOTWO').should == two # wrong
|
112
|
-
d = FuzzyMatch.new([one, two], identities
|
112
|
+
d = FuzzyMatch.new([one, two], :identities => [/\A(\d+)\s+(\w+)/])
|
113
113
|
d.find('1 sauk TWOTWOTWOTWO').should == one # correct
|
114
114
|
end
|
115
115
|
end
|
@@ -130,7 +130,7 @@ describe FuzzyMatch do
|
|
130
130
|
it %{stays within the group} do
|
131
131
|
d = FuzzyMatch.new [ 'AB', 'CD' ]
|
132
132
|
d.find('ABCDCD').should == 'CD'
|
133
|
-
d = FuzzyMatch.new [ 'AB', 'CD' ], groupings
|
133
|
+
d = FuzzyMatch.new [ 'AB', 'CD' ], :groupings => [/A/]
|
134
134
|
d.find('ABCDCD').should == 'AB'
|
135
135
|
end
|
136
136
|
|
@@ -141,7 +141,7 @@ describe FuzzyMatch do
|
|
141
141
|
@h = 'Hyatt'
|
142
142
|
@hgarden = 'Hyatt Garden'
|
143
143
|
@grandhotel = 'Grand Hotel'
|
144
|
-
@fz = FuzzyMatch.new([@grandh, @h, @hgarden, @grandhotel], groupings
|
144
|
+
@fz = FuzzyMatch.new([@grandh, @h, @hgarden, @grandhotel], :groupings => [ [ /hyatt/i, /garden/i, /grand/i ] ], :stop_words => [ /hotel/i ])
|
145
145
|
end
|
146
146
|
|
147
147
|
it %{works as expected} do
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuzzy_match
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Seamus Abshere
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-06-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: active_record_inline_schema
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: pry
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rspec-core
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,6 +62,7 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rspec-expectations
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
67
|
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
@@ -62,6 +70,7 @@ dependencies:
|
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
75
|
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
@@ -69,6 +78,7 @@ dependencies:
|
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rspec-mocks
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
@@ -76,6 +86,7 @@ dependencies:
|
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
91
|
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
@@ -83,6 +94,7 @@ dependencies:
|
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: activerecord
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -97,6 +110,7 @@ dependencies:
|
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: mysql2
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
115
|
- - ! '>='
|
102
116
|
- !ruby/object:Gem::Version
|
@@ -104,6 +118,7 @@ dependencies:
|
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
123
|
- - ! '>='
|
109
124
|
- !ruby/object:Gem::Version
|
@@ -111,6 +126,7 @@ dependencies:
|
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: cohort_analysis
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
131
|
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
@@ -118,6 +134,7 @@ dependencies:
|
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
139
|
- - ! '>='
|
123
140
|
- !ruby/object:Gem::Version
|
@@ -125,6 +142,7 @@ dependencies:
|
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: weighted_average
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
147
|
- - ! '>='
|
130
148
|
- !ruby/object:Gem::Version
|
@@ -132,6 +150,7 @@ dependencies:
|
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
155
|
- - ! '>='
|
137
156
|
- !ruby/object:Gem::Version
|
@@ -139,6 +158,7 @@ dependencies:
|
|
139
158
|
- !ruby/object:Gem::Dependency
|
140
159
|
name: yard
|
141
160
|
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
142
162
|
requirements:
|
143
163
|
- - ! '>='
|
144
164
|
- !ruby/object:Gem::Version
|
@@ -146,6 +166,7 @@ dependencies:
|
|
146
166
|
type: :development
|
147
167
|
prerelease: false
|
148
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
149
170
|
requirements:
|
150
171
|
- - ! '>='
|
151
172
|
- !ruby/object:Gem::Version
|
@@ -153,6 +174,7 @@ dependencies:
|
|
153
174
|
- !ruby/object:Gem::Dependency
|
154
175
|
name: amatch
|
155
176
|
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
156
178
|
requirements:
|
157
179
|
- - ! '>='
|
158
180
|
- !ruby/object:Gem::Version
|
@@ -160,6 +182,7 @@ dependencies:
|
|
160
182
|
type: :development
|
161
183
|
prerelease: false
|
162
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
163
186
|
requirements:
|
164
187
|
- - ! '>='
|
165
188
|
- !ruby/object:Gem::Version
|
@@ -212,26 +235,27 @@ files:
|
|
212
235
|
- spec/spec_helper.rb
|
213
236
|
homepage: https://github.com/seamusabshere/fuzzy_match
|
214
237
|
licenses: []
|
215
|
-
metadata: {}
|
216
238
|
post_install_message:
|
217
239
|
rdoc_options: []
|
218
240
|
require_paths:
|
219
241
|
- lib
|
220
242
|
required_ruby_version: !ruby/object:Gem::Requirement
|
243
|
+
none: false
|
221
244
|
requirements:
|
222
245
|
- - ! '>='
|
223
246
|
- !ruby/object:Gem::Version
|
224
247
|
version: '0'
|
225
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
226
250
|
requirements:
|
227
251
|
- - ! '>='
|
228
252
|
- !ruby/object:Gem::Version
|
229
253
|
version: '0'
|
230
254
|
requirements: []
|
231
255
|
rubyforge_project: fuzzy_match
|
232
|
-
rubygems_version:
|
256
|
+
rubygems_version: 1.8.25
|
233
257
|
signing_key:
|
234
|
-
specification_version:
|
258
|
+
specification_version: 3
|
235
259
|
summary: Find a needle in a haystack using string similarity and (optionally) regexp
|
236
260
|
rules. Replaces loose_tight_dictionary.
|
237
261
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NDhjZDk1NjAxOTMzMGZkMWU4ODAyNjRmMzA4YzlhNzQwZWIwZGU5MQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OTk5Yjc2NmY4ZTY3NDkyOTFjOGQwYjlhZDgwYjk2NmViMzI0NGYyMQ==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YmE4MjUxNzg0MmFlN2UyMTYxNGJhNGRiZjZmYThjOGYzNDMwYjRjZmVlNTBk
|
10
|
-
MmQzZjE0NWJiN2IzZGY3YzBhZWQzOWVkMTNjZmVhODUwMTk5ODJmMTY0Njk0
|
11
|
-
ODEwMjc2MDc0M2M2YjNmZmY5MmViZGNiOTYzNGQ2MjQxODZkZDQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NGIzYTVmNzk0N2E4YjU4ZDc1MTNiNTU4YmRhMDgxNmM5Y2Q0MWM2NzYzZjhj
|
14
|
-
NTA3ZDg5NWE2ZWM2MWZkNDRjM2I1NWY2NzA4ODAwM2E4NTIwY2NmYWI4MzBm
|
15
|
-
MjliNDZkNzIzMGJhZTVhMzViNThhZjk1MmM1NTViNmQ4ODFjNzM=
|