amatch 0.3.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb10a4b272e6f2e89cc6f4c977abce874a4a6928
4
- data.tar.gz: d930f2f6cab0e80f90713debdf62bbb3c2b09c93
3
+ metadata.gz: 33e953d1d1503a26b79e67192fd2f1016c8cd7cc
4
+ data.tar.gz: 81e4d93466bc5c7fbc547734f2019728f89b6ad9
5
5
  SHA512:
6
- metadata.gz: 340b43efe94c76b98c4b68a5feb182a114c1a93576a5704a2af758f6ba867798d391d34e7ed4f7b0f4b22c931e2f763da124ddc4c75acdb1c13da218d5a1047f
7
- data.tar.gz: d48f7d50cd00ab6b81145e7b419580c486ea852072687d10448f117775756993ff7ae62c85209ad616f2141a74006cec3b3737699130e479c05c04dd917c44a2
6
+ metadata.gz: 725523e6d78bfdcd30b1ab6d3f0670dd4212f02985011e16fbef62bb5c5529d72f184d3187777d34b1c3d0a4bc51c33015c8fad45f972aaa043e1ff552064a0f
7
+ data.tar.gz: 8bae2f8aaf65b75b113f3cf2e25c6363b5794d63f0b4688dc325939d1684fba99a863ec46d04f1369e2e3d4ae516b91554945cbd904ccc45b568dd966fb0eddf
@@ -1,10 +1,10 @@
1
1
  rvm:
2
- - 2.0.0
3
- - 2.1.0
2
+ - 2.0
3
+ - 2.1
4
+ - 2.2
5
+ - 2.3
6
+ - 2.4.1
4
7
  - ruby-head
5
- - rbx-18mode
6
- - rbx-19mode
7
8
  matrix:
8
9
  allow_failures:
9
- - rvm: rbx-18mode
10
- - rvm: rbx-19mode
10
+ - rvm: ruby-head
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ 2017-05-23 (0.3.1)
2
+ * Include PairDistance fix from dominikgrygiel, Thx.
3
+ 2017-03-27 (0.3.0)
4
+ * Update some dependencies
1
5
  2013-10-14 (0.2.12)
2
6
  * Include test fix from Juanito Fatas <katehuang0320@gmail.com>. Thx!
3
7
  2013-01-16 (0.2.11)
data/Rakefile CHANGED
@@ -21,9 +21,8 @@ EOT
21
21
  readme 'README.rdoc'
22
22
  require_paths %w[lib ext]
23
23
  dependency 'tins', '~>1.0'
24
- development_dependency 'test-unit', '~>2.3'
25
- development_dependency 'utils'
26
- development_dependency 'rake', '~>10', '<11.0'
24
+ development_dependency 'test-unit', '~>3.0'
25
+ licenses << 'GPL'
27
26
 
28
27
  install_library do
29
28
  libdir = CONFIG["sitelibdir"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
Binary file
@@ -470,34 +470,32 @@ static VALUE Sellers_search(Sellers *amatch, VALUE string)
470
470
  static VALUE PairDistance_match(PairDistance *amatch, VALUE string, VALUE regexp, int use_regexp)
471
471
  {
472
472
  double result;
473
- VALUE tokens;
474
- PairArray *pair_array;
475
-
473
+ VALUE tokens, string_tokens;
474
+ PairArray *pattern_pair_array, *pair_array;
475
+
476
476
  Check_Type(string, T_STRING);
477
477
  if (!NIL_P(regexp) || use_regexp) {
478
478
  tokens = rb_funcall(
479
479
  rb_str_new(amatch->pattern, amatch->pattern_len),
480
480
  id_split, 1, regexp
481
481
  );
482
- if (!amatch->pattern_pair_array) {
483
- amatch->pattern_pair_array = PairArray_new(tokens);
484
- } else {
485
- pair_array_reactivate(amatch->pattern_pair_array);
486
- }
487
- tokens = rb_funcall(string, id_split, 1, regexp);
488
- pair_array = PairArray_new(tokens);
482
+ string_tokens = rb_funcall(string, id_split, 1, regexp);
489
483
  } else {
490
484
  VALUE tmp = rb_str_new(amatch->pattern, amatch->pattern_len);
491
485
  tokens = rb_ary_new4(1, &tmp);
492
- if (!amatch->pattern_pair_array) {
493
- amatch->pattern_pair_array = PairArray_new(tokens);
494
- } else {
495
- pair_array_reactivate(amatch->pattern_pair_array);
496
- }
497
- tokens = rb_ary_new4(1, &string);
498
- pair_array = PairArray_new(tokens);
486
+ string_tokens = rb_ary_new4(1, &string);
499
487
  }
500
- result = pair_array_match(amatch->pattern_pair_array, pair_array);
488
+
489
+ if (!amatch->pattern_pair_array) {
490
+ pattern_pair_array = PairArray_new(tokens);
491
+ amatch->pattern_pair_array = pattern_pair_array;
492
+ } else {
493
+ pattern_pair_array = amatch->pattern_pair_array;
494
+ pair_array_reactivate(amatch->pattern_pair_array);
495
+ }
496
+ pair_array = PairArray_new(string_tokens);
497
+
498
+ result = pair_array_match(pattern_pair_array, pair_array);
501
499
  pair_array_destroy(pair_array);
502
500
  return rb_float_new(result);
503
501
  }
data/ext/pair.c CHANGED
@@ -72,6 +72,8 @@ void pair_print(Pair pair)
72
72
 
73
73
  void pair_array_destroy(PairArray *pair_array)
74
74
  {
75
- xfree(pair_array->pairs);
75
+ if (pair_array->pairs) {
76
+ xfree(pair_array->pairs);
77
+ }
76
78
  xfree(pair_array);
77
79
  }
@@ -1,6 +1,6 @@
1
1
  module Amatch
2
2
  # Amatch version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
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:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-27 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,62 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.9.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 1.9.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.3'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.3'
41
- - !ruby/object:Gem::Dependency
42
- name: utils
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10'
62
- - - "<"
63
- - !ruby/object:Gem::Version
64
- version: '11.0'
65
- type: :development
66
- prerelease: false
67
- version_requirements: !ruby/object:Gem::Requirement
68
- requirements:
69
- - - "~>"
70
- - !ruby/object:Gem::Version
71
- version: '10'
72
- - - "<"
73
- - !ruby/object:Gem::Version
74
- version: '11.0'
40
+ version: '3.0'
75
41
  - !ruby/object:Gem::Dependency
76
42
  name: tins
77
43
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +100,8 @@ files:
134
100
  - tests/test_pair_distance.rb
135
101
  - tests/test_sellers.rb
136
102
  homepage: http://github.com/flori/amatch
137
- licenses: []
103
+ licenses:
104
+ - GPL
138
105
  metadata: {}
139
106
  post_install_message:
140
107
  rdoc_options:
@@ -157,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
124
  version: '0'
158
125
  requirements: []
159
126
  rubyforge_project:
160
- rubygems_version: 2.2.2
127
+ rubygems_version: 2.6.11
161
128
  signing_key:
162
129
  specification_version: 4
163
130
  summary: Approximate String Matching library