amatch 0.6.0 → 0.7.0
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 +4 -4
- data/.envrc +1 -0
- data/CHANGES.md +24 -0
- data/README.md +179 -122
- data/Rakefile +4 -0
- data/amatch.gemspec +0 -0
- data/ext/amatch_ext.c +34 -28
- data/lib/amatch/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee7dfaff2010838080964bb4ba77162407ecf382c3d179950b2ecde3233df3a1
|
|
4
|
+
data.tar.gz: c5e4f46463f7858fd681c8ec2179d0a6245499a73b1188285f40c21535be7bfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 457706eed2e4af628996d96afc4f0296fd713439fd0ebcb04d637649beef6d3a74da0955a5f0fe693bac1a142b3424b77cc59038966454ce022ce668a0c520a2
|
|
7
|
+
data.tar.gz: 88d63c103f527c18ff413f9810ad231ae81a218b8c1f824756d7568a963c2679c6ee28a293bebd68a715e08bfecbedb5da512da09a52ca2114a0cf6ebc902c0c
|
data/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export OLLAMA_CHAT_TOOLS_TEST_RUNNER="bundle exec test-unit"
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-06-05 v0.7.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Improved `README.md` with a project roadmap, better structure, and technical
|
|
7
|
+
clarifications.
|
|
8
|
+
- Documented the `Amatch::DiceCoefficient` alias for `PairDistance`.
|
|
9
|
+
- Clarified that `PairDistance` utilizes multisets for frequency-sensitive
|
|
10
|
+
matching.
|
|
11
|
+
- Added advanced usage examples for regex tokenization in `PairDistance#match`.
|
|
12
|
+
- Added a `changelog` configuration block to the `Rakefile` targeting
|
|
13
|
+
`CHANGES.md` to automate release documentation.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Updated matcher structs to use `TypedData_Make_Struct` and
|
|
18
|
+
`TypedData_Get_Struct`, removing dependency on deprecated `Data_*` accessors.
|
|
19
|
+
- Switched matcher allocation to `Data_Make_Struct` to ensure Ruby manages
|
|
20
|
+
memory immediately upon object creation and prevent buffer leaks.
|
|
21
|
+
- Standardized the CI test runner to use `bundle exec rake clobber test`.
|
|
22
|
+
- Updated CI configuration in `.all_images.yml` with hooks to remove `Gemfile.lock` to prevent conflicts between macOS and Alpine Linux.
|
|
23
|
+
- Added `.envrc` to export `OLLAMA_CHAT_TOOLS_TEST_RUNNER`.
|
|
24
|
+
- Updated the Ruby version used in CI from **4.0-rc-alpine** to **4.0-alpine**.
|
|
25
|
+
- Updated `amatch.gemspec` configuration.
|
|
26
|
+
|
|
3
27
|
## 2025-12-19 v0.6.0
|
|
4
28
|
|
|
5
29
|
- Moved the `debug` gem from regular dependencies to development dependencies
|
data/README.md
CHANGED
|
@@ -1,124 +1,181 @@
|
|
|
1
|
-
# amatch - Approximate Matching Extension for Ruby
|
|
2
|
-
|
|
3
|
-
## Description
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
matching, searching, and comparing
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
# amatch - Approximate Matching Extension for Ruby 📏
|
|
2
|
+
|
|
3
|
+
## Description 📝
|
|
4
|
+
|
|
5
|
+
`amatch` is a high-performance collection of classes used for approximate
|
|
6
|
+
matching, searching, and comparing strings. It provides an efficient Ruby
|
|
7
|
+
interface to several industry-standard algorithms for calculating edit distance
|
|
8
|
+
and string similarity.
|
|
9
|
+
|
|
10
|
+
## Supported Algorithms 🧩
|
|
11
|
+
|
|
12
|
+
The library implements a wide array of metrics to suit different matching needs:
|
|
13
|
+
|
|
14
|
+
* **Levenshtein Distance**: The classic "edit distance" (insertions,
|
|
15
|
+
deletions, substitutions).
|
|
16
|
+
* **Sellers Algorithm**: A variation of Levenshtein optimized for searching a
|
|
17
|
+
pattern within a longer text.
|
|
18
|
+
* **Damerau-Levenshtein**: Similar to Levenshtein but considers
|
|
19
|
+
transpositions of two adjacent characters as a single edit.
|
|
20
|
+
* **Hamming Distance**: Measures the number of positions at which
|
|
21
|
+
corresponding symbols are different (only for strings of equal length).
|
|
22
|
+
* **Jaro-Winkler**: A metric geared towards short strings like names, giving
|
|
23
|
+
more weight to prefix matches.
|
|
24
|
+
* **Pair Distance**: A flexible distance metric based on character pairs
|
|
25
|
+
(also available as `Amatch::DiceCoefficient`). Unlike set-based measures,
|
|
26
|
+
this implementation uses multisets, meaning it is sensitive to the frequency
|
|
27
|
+
of repeated character pairs.
|
|
28
|
+
* **Longest Common Subsequence/Substring**: Finds the longest shared
|
|
29
|
+
sequences between two strings.
|
|
30
|
+
|
|
31
|
+
## Installation 📦
|
|
32
|
+
|
|
33
|
+
You can install the extension as a gem:
|
|
34
|
+
|
|
35
|
+
```shell
|
|
36
|
+
gem install amatch
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Alternatively, if you prefer manual installation:
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
ruby install.rb
|
|
43
|
+
# or
|
|
44
|
+
rake install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage 🛠️
|
|
48
|
+
|
|
49
|
+
### Basic Setup
|
|
50
|
+
|
|
51
|
+
To get started, simply require the library and include the `Amatch` module to
|
|
52
|
+
add similarity methods directly to the `String` class.
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
require 'amatch'
|
|
56
|
+
include Amatch
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Edit Distance Algorithms 📉
|
|
60
|
+
|
|
61
|
+
These algorithms return the "cost" to transform one string into another. Lower
|
|
62
|
+
values indicate higher similarity.
|
|
63
|
+
|
|
64
|
+
#### Levenshtein & Damerau-Levenshtein
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
# Standard Levenshtein
|
|
68
|
+
m = Levenshtein.new("pattern")
|
|
69
|
+
m.match("pattren") # => 2
|
|
70
|
+
"pattern language".levenshtein_similar("language of patterns") # => 0.2
|
|
71
|
+
|
|
72
|
+
# Damerau-Levenshtein (handles transpositions)
|
|
73
|
+
m = Amatch::DamerauLevenshtein.new("pattern")
|
|
74
|
+
m.match("pattren") # => 1
|
|
75
|
+
"pattern language".damerau_levenshtein_similar("language of patterns") # => 0.2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Sellers (Pattern Searching)
|
|
79
|
+
|
|
80
|
+
Sellers is particularly useful for finding the best match of a pattern within a
|
|
81
|
+
larger body of text.
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
m = Sellers.new("pattern")
|
|
85
|
+
m.match("pattren") # => 2.0
|
|
86
|
+
|
|
87
|
+
# You can customize weights for different edit types
|
|
88
|
+
m.substitution = m.insertion = 3
|
|
89
|
+
m.match("pattren") # => 4.0
|
|
90
|
+
|
|
91
|
+
m.reset_weights
|
|
92
|
+
m.search("abcpattrendef") # => 2.0
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Hamming Distance
|
|
96
|
+
|
|
97
|
+
Used primarily for strings of equal length to count substitutions.
|
|
98
|
+
|
|
99
|
+
```ruby
|
|
100
|
+
m = Hamming.new("pattern")
|
|
101
|
+
m.match("pattren") # => 2
|
|
102
|
+
"pattern language".hamming_similar("language of patterns") # => 0.1
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Similarity Metrics 📈
|
|
106
|
+
|
|
107
|
+
These algorithms typically return a score between `0.0` and `1.0`, where `1.0`
|
|
108
|
+
is a perfect match.
|
|
109
|
+
|
|
110
|
+
#### Jaro-Winkler
|
|
111
|
+
|
|
112
|
+
Highly effective for record linkage and matching names.
|
|
113
|
+
|
|
114
|
+
```ruby
|
|
115
|
+
m = JaroWinkler.new("pattern")
|
|
116
|
+
m.match("paTTren") # => 0.9714...
|
|
117
|
+
m.ignore_case = false
|
|
118
|
+
m.match("paTTren") # => 0.7942...
|
|
119
|
+
|
|
120
|
+
# Custom scaling factor for prefix bonus
|
|
121
|
+
m.scaling_factor = 0.05
|
|
122
|
+
m.match("pattren") # => 0.9619...
|
|
123
|
+
|
|
124
|
+
"pattern language".jarowinkler_similar("language of patterns") # => 0.6722...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Jaro
|
|
128
|
+
|
|
129
|
+
The base metric for the Winkler variation.
|
|
130
|
+
|
|
131
|
+
```ruby
|
|
132
|
+
m = Jaro.new("pattern")
|
|
133
|
+
m.match("paTTren") # => 0.9523...
|
|
134
|
+
"pattern language".jaro_similar("language of patterns") # => 0.6722...
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Other Metrics (Pair Distance, LCS, Longest Substring)
|
|
138
|
+
|
|
139
|
+
```ruby
|
|
140
|
+
# Pair Distance
|
|
141
|
+
# Note: This implementation uses multisets, meaning it considers character
|
|
142
|
+
# frequencies rather than just unique pairs.
|
|
143
|
+
m = PairDistance.new("pattern")
|
|
144
|
+
m.match("pattr en") # => 0.5454...
|
|
145
|
+
|
|
146
|
+
# Pro Tip: Pass a regex as the second argument to match based on tokens
|
|
147
|
+
# (e.g., words) rather than individual characters. This is particularly
|
|
148
|
+
# useful for natural language.
|
|
149
|
+
m.match("language of patterns", /\s+/)
|
|
150
|
+
"pattern language".pair_distance_similar("language of patterns", /\s+/) # => 0.9285...
|
|
151
|
+
|
|
152
|
+
# Longest Common Subsequence
|
|
153
|
+
m = LongestSubsequence.new("pattern")
|
|
154
|
+
m.match("pattren") # => 6
|
|
155
|
+
"pattern language".longest_subsequence_similar("language of patterns") # => 0.4
|
|
156
|
+
|
|
157
|
+
# Longest Common Substring
|
|
158
|
+
m = LongestSubstring.new("pattern")
|
|
159
|
+
m.match("pattren") # => 4
|
|
160
|
+
"pattern language".longest_substring_similar("language of patterns") # => 0.4
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Performance ⚡
|
|
164
|
+
|
|
165
|
+
`amatch` is implemented as a C extension to ensure maximum throughput when
|
|
166
|
+
processing large datasets or complex string comparisons.
|
|
167
|
+
|
|
168
|
+

|
|
169
|
+
|
|
170
|
+
## Download 📥
|
|
171
|
+
|
|
172
|
+
The homepage of this library is located at:
|
|
173
|
+
* [https://github.com/flori/amatch](https://github.com/flori/amatch)
|
|
174
|
+
|
|
175
|
+
## Author 👨💻
|
|
176
|
+
|
|
177
|
+
[Florian Frank](mailto:flori@ping.de)
|
|
178
|
+
|
|
179
|
+
## License 📄
|
|
123
180
|
|
|
124
181
|
Apache License, Version 2.0 – See the COPYING file in the source archive.
|
data/Rakefile
CHANGED
data/amatch.gemspec
CHANGED
|
Binary file
|
data/ext/amatch_ext.c
CHANGED
|
@@ -10,23 +10,32 @@ static VALUE rb_mAmatch, rb_mAmatchStringMethods, rb_cLevenshtein,
|
|
|
10
10
|
|
|
11
11
|
static ID id_split, id_to_f;
|
|
12
12
|
|
|
13
|
-
#define GET_STRUCT(klass)
|
|
14
|
-
klass *amatch;
|
|
15
|
-
|
|
13
|
+
#define GET_STRUCT(klass) \
|
|
14
|
+
klass *amatch; \
|
|
15
|
+
TypedData_Get_Struct(self, klass, &rb_##klass##_data_type, \
|
|
16
|
+
amatch);
|
|
16
17
|
|
|
17
|
-
#define
|
|
18
|
-
static
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
#define DEF_DATA_TYPE(type) \
|
|
19
|
+
static size_t rb_##type##_memsize(const void *ptr) \
|
|
20
|
+
{ \
|
|
21
|
+
return ptr ? sizeof(type) : 0; \
|
|
22
|
+
} \
|
|
23
|
+
\
|
|
24
|
+
static const rb_data_type_t rb_##type##_data_type = { \
|
|
25
|
+
"Amatch::" #type, \
|
|
26
|
+
{NULL, rb_##type##_free, rb_##type##_memsize,}, \
|
|
27
|
+
NULL, NULL, 0, \
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
#define MAKE_STRUCT(klass, type, amatch) \
|
|
31
|
+
TypedData_Make_Struct(klass, type, &rb_##type##_data_type, \
|
|
32
|
+
amatch)
|
|
24
33
|
|
|
25
34
|
#define DEF_CONSTRUCTOR(klass, type) \
|
|
26
35
|
static VALUE rb_##klass##_s_allocate(VALUE klass2) \
|
|
27
36
|
{ \
|
|
28
|
-
type *amatch
|
|
29
|
-
return
|
|
37
|
+
type *amatch; \
|
|
38
|
+
return MAKE_STRUCT(klass2, type, amatch); \
|
|
30
39
|
} \
|
|
31
40
|
VALUE rb_##klass##_new(VALUE klass2, VALUE pattern) \
|
|
32
41
|
{ \
|
|
@@ -35,9 +44,10 @@ VALUE rb_##klass##_new(VALUE klass2, VALUE pattern) \
|
|
|
35
44
|
return obj; \
|
|
36
45
|
}
|
|
37
46
|
|
|
38
|
-
#define DEF_RB_FREE(
|
|
39
|
-
static void rb_##
|
|
47
|
+
#define DEF_RB_FREE(type) \
|
|
48
|
+
static void rb_##type##_free(void *ptr) \
|
|
40
49
|
{ \
|
|
50
|
+
type *amatch = ptr; \
|
|
41
51
|
MEMZERO(amatch->pattern, char, amatch->pattern_len); \
|
|
42
52
|
xfree(amatch->pattern); \
|
|
43
53
|
MEMZERO(amatch, type, 1); \
|
|
@@ -156,7 +166,8 @@ typedef struct GeneralStruct {
|
|
|
156
166
|
int pattern_len;
|
|
157
167
|
} General;
|
|
158
168
|
|
|
159
|
-
|
|
169
|
+
DEF_RB_FREE(General)
|
|
170
|
+
DEF_DATA_TYPE(General)
|
|
160
171
|
DEF_PATTERN_ACCESSOR(General)
|
|
161
172
|
DEF_ITERATE_STRINGS(General)
|
|
162
173
|
|
|
@@ -168,7 +179,8 @@ typedef struct SellersStruct {
|
|
|
168
179
|
double insertion;
|
|
169
180
|
} Sellers;
|
|
170
181
|
|
|
171
|
-
|
|
182
|
+
DEF_RB_FREE(Sellers)
|
|
183
|
+
DEF_DATA_TYPE(Sellers)
|
|
172
184
|
DEF_PATTERN_ACCESSOR(Sellers)
|
|
173
185
|
DEF_ITERATE_STRINGS(Sellers)
|
|
174
186
|
|
|
@@ -185,7 +197,8 @@ typedef struct PairDistanceStruct {
|
|
|
185
197
|
PairArray *pattern_pair_array;
|
|
186
198
|
} PairDistance;
|
|
187
199
|
|
|
188
|
-
|
|
200
|
+
DEF_RB_FREE(PairDistance)
|
|
201
|
+
DEF_DATA_TYPE(PairDistance)
|
|
189
202
|
DEF_PATTERN_ACCESSOR(PairDistance)
|
|
190
203
|
|
|
191
204
|
typedef struct JaroStruct {
|
|
@@ -194,7 +207,8 @@ typedef struct JaroStruct {
|
|
|
194
207
|
int ignore_case;
|
|
195
208
|
} Jaro;
|
|
196
209
|
|
|
197
|
-
|
|
210
|
+
DEF_RB_FREE(Jaro)
|
|
211
|
+
DEF_DATA_TYPE(Jaro)
|
|
198
212
|
DEF_PATTERN_ACCESSOR(Jaro)
|
|
199
213
|
DEF_ITERATE_STRINGS(Jaro)
|
|
200
214
|
|
|
@@ -205,7 +219,8 @@ typedef struct JaroWinklerStruct {
|
|
|
205
219
|
double scaling_factor;
|
|
206
220
|
} JaroWinkler;
|
|
207
221
|
|
|
208
|
-
|
|
222
|
+
DEF_RB_FREE(JaroWinkler)
|
|
223
|
+
DEF_DATA_TYPE(JaroWinkler)
|
|
209
224
|
DEF_PATTERN_ACCESSOR(JaroWinkler)
|
|
210
225
|
DEF_ITERATE_STRINGS(JaroWinkler)
|
|
211
226
|
|
|
@@ -908,7 +923,6 @@ static VALUE JaroWinkler_match(JaroWinkler *amatch, VALUE string)
|
|
|
908
923
|
* strings that differ a lot.
|
|
909
924
|
*/
|
|
910
925
|
|
|
911
|
-
DEF_RB_FREE(Levenshtein, General)
|
|
912
926
|
|
|
913
927
|
/*
|
|
914
928
|
* call-seq: new(pattern)
|
|
@@ -1001,7 +1015,6 @@ static VALUE rb_Levenshtein_search(VALUE self, VALUE strings)
|
|
|
1001
1015
|
* distances than strings that differ a lot.
|
|
1002
1016
|
*/
|
|
1003
1017
|
|
|
1004
|
-
DEF_RB_FREE(DamerauLevenshtein, General)
|
|
1005
1018
|
|
|
1006
1019
|
/*
|
|
1007
1020
|
* call-seq: new(pattern)
|
|
@@ -1089,7 +1102,6 @@ static VALUE rb_DamerauLevenshtein_search(VALUE self, VALUE strings)
|
|
|
1089
1102
|
* distance.
|
|
1090
1103
|
*/
|
|
1091
1104
|
|
|
1092
|
-
DEF_RB_FREE(Sellers, Sellers)
|
|
1093
1105
|
|
|
1094
1106
|
/*
|
|
1095
1107
|
* Document-method: substitution
|
|
@@ -1271,7 +1283,6 @@ static VALUE rb_Sellers_search(VALUE self, VALUE strings)
|
|
|
1271
1283
|
* http://citeseer.lcs.mit.edu/gravano01using.html in "Using q-grams in a DBMS
|
|
1272
1284
|
* for Approximate String Processing."
|
|
1273
1285
|
*/
|
|
1274
|
-
DEF_RB_FREE(PairDistance, PairDistance)
|
|
1275
1286
|
|
|
1276
1287
|
/*
|
|
1277
1288
|
* call-seq: new(pattern)
|
|
@@ -1375,7 +1386,6 @@ static VALUE rb_str_pair_distance_similar(int argc, VALUE *argv, VALUE self)
|
|
|
1375
1386
|
* counted as different characters.
|
|
1376
1387
|
*/
|
|
1377
1388
|
|
|
1378
|
-
DEF_RB_FREE(Hamming, General)
|
|
1379
1389
|
|
|
1380
1390
|
/*
|
|
1381
1391
|
* call-seq: new(pattern)
|
|
@@ -1451,7 +1461,6 @@ static VALUE rb_str_hamming_similar(VALUE self, VALUE strings)
|
|
|
1451
1461
|
* between "test" and "east" is "e", "s", "t" and the length of the
|
|
1452
1462
|
* sequence is 3.
|
|
1453
1463
|
*/
|
|
1454
|
-
DEF_RB_FREE(LongestSubsequence, General)
|
|
1455
1464
|
|
|
1456
1465
|
/*
|
|
1457
1466
|
* call-seq: new(pattern)
|
|
@@ -1528,7 +1537,6 @@ static VALUE rb_str_longest_subsequence_similar(VALUE self, VALUE strings)
|
|
|
1528
1537
|
* substring length is 4.
|
|
1529
1538
|
*/
|
|
1530
1539
|
|
|
1531
|
-
DEF_RB_FREE(LongestSubstring, General)
|
|
1532
1540
|
|
|
1533
1541
|
/*
|
|
1534
1542
|
* call-seq: new(pattern)
|
|
@@ -1599,7 +1607,6 @@ static VALUE rb_str_longest_substring_similar(VALUE self, VALUE strings)
|
|
|
1599
1607
|
* The Jaro metric computes the similarity between 0 (no match)
|
|
1600
1608
|
* and 1 (exact match) by looking for matching and transposed characters.
|
|
1601
1609
|
*/
|
|
1602
|
-
DEF_RB_FREE(Jaro, Jaro)
|
|
1603
1610
|
|
|
1604
1611
|
/*
|
|
1605
1612
|
* Document-method: ignore_case
|
|
@@ -1676,7 +1683,6 @@ static VALUE rb_str_jaro_similar(VALUE self, VALUE strings)
|
|
|
1676
1683
|
* It is a variant of the Jaro metric, with additional weighting towards
|
|
1677
1684
|
* common prefixes.
|
|
1678
1685
|
*/
|
|
1679
|
-
DEF_RB_FREE(JaroWinkler, JaroWinkler)
|
|
1680
1686
|
|
|
1681
1687
|
/*
|
|
1682
1688
|
* Document-method: ignore_case
|
data/lib/amatch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: amatch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -13,16 +13,16 @@ dependencies:
|
|
|
13
13
|
name: gem_hadar
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 2.17.1
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 2.17.1
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -126,6 +126,7 @@ extra_rdoc_files:
|
|
|
126
126
|
- lib/amatch/rude.rb
|
|
127
127
|
- lib/amatch/version.rb
|
|
128
128
|
files:
|
|
129
|
+
- ".envrc"
|
|
129
130
|
- ".utilsrc"
|
|
130
131
|
- CHANGES.md
|
|
131
132
|
- COPYING
|
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
180
181
|
- !ruby/object:Gem::Version
|
|
181
182
|
version: '0'
|
|
182
183
|
requirements: []
|
|
183
|
-
rubygems_version: 4.0.
|
|
184
|
+
rubygems_version: 4.0.10
|
|
184
185
|
specification_version: 4
|
|
185
186
|
summary: Approximate String Matching library
|
|
186
187
|
test_files:
|