amatch 0.4.0 → 0.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7b803c4146ba8acd2a3904a4c0606134d4c8c900
4
- data.tar.gz: e023e563833563d061b1975208a1d38a9018cac0
2
+ SHA256:
3
+ metadata.gz: 588c17ff90e55b20273ef43b5b492e53e6792e2159115f68cd5c51ae587e7419
4
+ data.tar.gz: 329159a6723b97a7f4d2faa0a5e580f1e812156d7c391f0e580a918b2df84d22
5
5
  SHA512:
6
- metadata.gz: c58d3ad1d3f411402e3b332fc539eff6eab6d7657222b63dc47d25db07270ba6da2350f0bcfb7a4f75a516551a9f2f065e4dd1ffcd40d2f16ed0dc61639a2292
7
- data.tar.gz: c7d5c32a7c8b7034f51c11b2c3a1db98a44abce81e95194c27de1d825a48d97782ea523b099bbaad44b833e946432a89a1879e40a746df7153e6b59f61be09d9
6
+ metadata.gz: 8cb9a9986c94a1b0cf1ec84be77d5aa6d53e454843a92334c99a7b2103bd75e03804c539555aeb5b66c6332f44e2bb21053b612f87c62ab0eeddd63f2eeb441f
7
+ data.tar.gz: e656d288645b309eac412b65e3126843921c248dd56bd3ece8cdc9e7d619a1744bed01274183d08708c92cb386f099b7be6f52c497fb779286f0d6e4b83a6d44
data/CHANGES.md ADDED
@@ -0,0 +1,111 @@
1
+ # Changes
2
+
3
+ ## 2025-07-10 v0.4.2
4
+
5
+ * Single-character identical strings now return a similarity score of `1.0`.
6
+ * Updated C extension to handle this edge case.
7
+ * Added tests for Jaro and Jaro-Winkler algorithms.
8
+ * Thx to Jared Nielson for the fix.
9
+
10
+ ## 2022-05-15 v0.4.1
11
+
12
+ * **Moved CI testing from Travis to All Images**
13
+ + Updated configuration to use `all_images` instead of Travis for continuous integration testing.
14
+
15
+ ## 2017-07-04 v0.4.0
16
+
17
+ * Officially support DamerauLevenshtein matching algorithm.
18
+ * Change license to Apache 2.0
19
+
20
+ ## 2017-05-23 v0.3.1
21
+
22
+ * Include PairDistance fix from dominikgrygiel, Thx.
23
+
24
+ ## 2014-03-27 v0.3.0
25
+
26
+ * Update some dependencies
27
+
28
+ ## 2013-10-14 v0.2.12
29
+
30
+ * Include test fix from Juanito Fatas <katehuang0320@gmail.com>. Thx!
31
+
32
+ ## 2013-01-16 v0.2.11
33
+
34
+ * Include some fixes from Jason Colburne <jason@redbeardenterprises.com>.
35
+ Thx!
36
+
37
+ ## 2012-02-06 v0.2.10
38
+
39
+ * Use xfree instead of free to avoid (possible) problems.
40
+
41
+ ## 2011-11-15 v0.2.9
42
+
43
+ * Provide amatch/rude and amatch/polite for require (the latter doesn't
44
+ extend ::String on its own)
45
+ * `pair_distance_similar` method now can take an optional regexp argument for
46
+ tokenizing.
47
+
48
+ ## 2011-08-06 v0.2.8
49
+
50
+ * Depend on tins library.
51
+
52
+ ## 2011-08-06 v0.2.7
53
+
54
+ * Fix some violations of ISO C90 standard.
55
+
56
+ ## 2011-07-16 v0.2.6
57
+
58
+ * Applied patch by Kevin J. Lynagh <kevin@keminglabs.com> fixing memory
59
+ leak in Jaro match.
60
+
61
+ ## 2009-09-25 v0.2.5
62
+
63
+ * Added lib to gem's require_paths.
64
+ * Using rake-compiler now.
65
+
66
+ ## 2009-08-25 v0.2.4
67
+
68
+ * Included Jaro and Jaro-Winkler metrics implementation of Kevin Ballard
69
+ <kevin@rapleaf.com>. Thanks a lot.
70
+ * Made the extension compile under Ruby 1.9.
71
+
72
+ ## 2006-06-25 v0.2.3
73
+
74
+ * Fixed agrep.rb to use the new API.
75
+
76
+ ## 2005-10-11 v0.2.2
77
+ * Fixed a typo in extconf.rb that prohibitted compiling on
78
+ non-gcc compilers.
79
+
80
+ ## 2005-09-12 v0.2.1
81
+
82
+ * Bugfix: Wrong type for pattern length corrected. Thanks to David
83
+ Heinemeier Hansson for reporting it.
84
+
85
+ ## 2005-06-01 v0.2.0
86
+
87
+ * Major changes in API and implementation:
88
+ Now the Levenshtein edit distance, Sellers edit distance, the Hamming
89
+ distance, the longest common subsequence length, the longest common
90
+ substring length, and the pair distance metric can be computed.
91
+
92
+ ## 2005-01-20 v0.1.4
93
+
94
+ * Better argument handling in initialization method
95
+ * Minor changes in Rakefile and README.en
96
+
97
+ ## 2004-09-27 v0.1.3
98
+
99
+ * Rakefile and gem support added.
100
+
101
+ ## 2004-09-24 v0.1.2
102
+
103
+ * Uses Test::Unit for regression tests now.
104
+
105
+ ## 2002-04-21 v0.1.1
106
+
107
+ * Minor changes: documentation, more test cases and exceptions.
108
+
109
+ ## 2009-08-26 v0.1.0
110
+
111
+ * Initial Version
data/Rakefile CHANGED
@@ -16,12 +16,16 @@ EOT
16
16
  executables << 'agrep' << 'dupfind'
17
17
  bindir 'bin'
18
18
  test_dir 'tests'
19
- ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.rbx', 'Makefile'
19
+ ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.rbx',
20
+ 'Makefile', '*.bundle', '*.o', '*.so'
21
+ package_ignore '.all_images.yml', '.gitignore', 'VERSION'
20
22
  title "#{name.camelize} - Approximate Matching"
21
23
  readme 'README.md'
22
24
  require_paths %w[lib ext]
23
25
  dependency 'tins', '~>1.0'
24
26
  dependency 'mize'
25
27
  development_dependency 'test-unit', '~>3.0'
28
+ development_dependency 'all_images'
29
+ required_ruby_version '>=2.4'
26
30
  licenses << 'Apache-2.0'
27
31
  end
data/amatch.gemspec CHANGED
Binary file
data/ext/amatch_ext.c CHANGED
@@ -790,7 +790,11 @@ static VALUE LongestSubstring_similar(General *amatch, VALUE string)
790
790
  } \
791
791
  } \
792
792
  if (m == 0) { \
793
- result = 0.0; \
793
+ if(a_len == b_len && a_len == 1 && a_ptr[0] == b_ptr[0]) { \
794
+ result = 1.0; \
795
+ } else { \
796
+ result = 0.0; \
797
+ } \
794
798
  } else { \
795
799
  k = t = 0; \
796
800
  for (i = 0; i < a_len; i++) { \
@@ -1,6 +1,6 @@
1
1
  module Amatch
2
2
  # Amatch version
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.2'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/tests/test_jaro.rb CHANGED
@@ -11,6 +11,7 @@ class TestJaro < Test::Unit::TestCase
11
11
  @dwayne = Jaro.new('dwayne')
12
12
  @dixon = Jaro.new('DIXON')
13
13
  @one = Jaro.new('one')
14
+ @single = Jaro.new('a')
14
15
  end
15
16
 
16
17
  def test_case
@@ -25,5 +26,6 @@ class TestJaro < Test::Unit::TestCase
25
26
  assert_in_delta 0.822, @dwayne.match('DUANE'), D
26
27
  assert_in_delta 0.767, @dixon.match('DICKSONX'), D
27
28
  assert_in_delta 0.667, @one.match('orange'), D
29
+ assert_in_delta 1.0, @single.match('a')
28
30
  end
29
31
  end
@@ -11,6 +11,7 @@ class TestJaroWinkler < Test::Unit::TestCase
11
11
  @dwayne = JaroWinkler.new('dwayne')
12
12
  @dixon = JaroWinkler.new('DIXON')
13
13
  @one = JaroWinkler.new("one")
14
+ @single = JaroWinkler.new("a")
14
15
  end
15
16
 
16
17
  def test_case
@@ -26,6 +27,7 @@ class TestJaroWinkler < Test::Unit::TestCase
26
27
  assert_in_delta 0.813, @dixon.match('DICKSONX'), D
27
28
  assert_in_delta 0, @one.match('two'), D
28
29
  assert_in_delta 0.700, @one.match('orange'), D
30
+ assert_in_delta 1.0, @single.match("a")
29
31
  end
30
32
 
31
33
  def test_scaling_factor
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gem_hadar
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 1.9.1
18
+ version: '1.20'
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 1.9.1
25
+ version: '1.20'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: test-unit
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +37,20 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '3.0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: all_images
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
41
54
  - !ruby/object:Gem::Dependency
42
55
  name: tins
43
56
  requirement: !ruby/object:Gem::Requirement
@@ -78,21 +91,18 @@ extensions:
78
91
  - ext/extconf.rb
79
92
  extra_rdoc_files:
80
93
  - README.md
94
+ - ext/amatch_ext.c
95
+ - ext/pair.c
81
96
  - lib/amatch.rb
82
97
  - lib/amatch/polite.rb
83
98
  - lib/amatch/rude.rb
84
99
  - lib/amatch/version.rb
85
- - ext/amatch_ext.c
86
- - ext/pair.c
87
100
  files:
88
- - ".gitignore"
89
- - ".travis.yml"
90
- - CHANGES
101
+ - CHANGES.md
91
102
  - COPYING
92
103
  - Gemfile
93
104
  - README.md
94
105
  - Rakefile
95
- - VERSION
96
106
  - amatch.gemspec
97
107
  - bin/agrep
98
108
  - bin/dupfind
@@ -121,7 +131,6 @@ homepage: http://github.com/flori/amatch
121
131
  licenses:
122
132
  - Apache-2.0
123
133
  metadata: {}
124
- post_install_message:
125
134
  rdoc_options:
126
135
  - "--title"
127
136
  - Amatch - Approximate Matching
@@ -134,16 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
143
  requirements:
135
144
  - - ">="
136
145
  - !ruby/object:Gem::Version
137
- version: '0'
146
+ version: '2.4'
138
147
  required_rubygems_version: !ruby/object:Gem::Requirement
139
148
  requirements:
140
149
  - - ">="
141
150
  - !ruby/object:Gem::Version
142
151
  version: '0'
143
152
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.6.11
146
- signing_key:
153
+ rubygems_version: 3.6.9
147
154
  specification_version: 4
148
155
  summary: Approximate String Matching library
149
156
  test_files:
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- .*.sw[pon]
2
- .AppleDouble
3
- .rbx
4
- Gemfile.lock
5
- Makefile
6
- pkg
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- rvm:
2
- - 2.0
3
- - 2.1
4
- - 2.2
5
- - 2.3
6
- - 2.4.1
7
- - ruby-head
8
- matrix:
9
- allow_failures:
10
- - rvm: ruby-head
data/CHANGES DELETED
@@ -1,57 +0,0 @@
1
- 2017-07-04 (0.4.0)
2
- * Officially support DamerauLevenshtein matching algorithm.
3
- * Change license to Apache 2.0
4
- 2017-05-23 (0.3.1)
5
- * Include PairDistance fix from dominikgrygiel, Thx.
6
- 2017-03-27 (0.3.0)
7
- * Update some dependencies
8
- 2013-10-14 (0.2.12)
9
- * Include test fix from Juanito Fatas <katehuang0320@gmail.com>. Thx!
10
- 2013-01-16 (0.2.11)
11
- * Include some fixes from Jason Colburne <jason@redbeardenterprises.com>.
12
- Thx!
13
- 2012-02-06 (0.2.10)
14
- * Use xfree instead of free to avoid (possible) problems.
15
- 2011-11-14 (0.2.9)
16
- * Provide amatch/rude and amatch/polite for require (the latter doesn't
17
- extend ::String on its own)
18
- * pair_distance_similar method now can take an optional regexp argument for
19
- tokenizing.
20
- 2011-09-26 (0.2.8)
21
- * Depend on tins library.
22
- 2011-08-06 (0.2.7)
23
- * Fix some violations of ISO C90 standard.
24
- 2011-07-16 (0.2.6)
25
- * Applied patch by Kevin J. Lynagh <kevin@keminglabs.com> fixing memory
26
- leak in Jaro match.
27
- 2009-09-23 (0.2.5)
28
- * Added lib to gem's require_paths.
29
- * Using rake-compiler now.
30
- 2009-08-25 (0.2.4)
31
- * Included Jaro and Jaro-Winkler metrics implementation of Kevin Ballard
32
- <kevin@rapleaf.com>. Thanks a lot.
33
- * Made the extension compile under Ruby 1.9.
34
- 2006-06-25 (0.2.3)
35
- * Fixed agrep.rb to use the new API.
36
- 2005-10-11 (0.2.2)
37
- * Fixed a typo in extconf.rb that prohibitted compiling on
38
- non-gcc compilers.
39
- 2005-09-12 (0.2.1)
40
- * Bugfix: Wrong type for pattern length corrected. Thanks to David
41
- Heinemeier Hansson for reporting it.
42
- 2005-06-01 (0.2.0)
43
- * Major changes in API and implementation:
44
- Now the Levenshtein edit distance, Sellers edit distance, the Hamming
45
- distance, the longest common subsequence length, the longest common
46
- substring length, and the pair distance metric can be computed.
47
- 2005-01-20 (0.1.4)
48
- * Better argument handling in initialization method
49
- * Minor changes in Rakefile and README.en
50
- 2004-09-27 (0.1.3)
51
- * Rakefile and gem support added.
52
- 2004-09-24 (0.1.2)
53
- * Uses Test::Unit for regression tests now.
54
- 2002-04-21 (0.1.1)
55
- * Minor changes: documentation, more test cases and exceptions.
56
- 2002-03-14 (0.1.0)
57
- * Initial Version
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.0