amatch 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- pkg
2
- Gemfile.lock
3
1
  .*.sw[pon]
2
+ Gemfile.lock
3
+ pkg
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - ruby-head
5
+ - ree
6
+ - rbx
data/CHANGES CHANGED
@@ -1,3 +1,5 @@
1
+ 2011-08-06 (0.2.7)
2
+ * Fix some violations of ISO C90 standard.
1
3
  2011-07-16 (0.2.6)
2
4
  * Applied patch by Kevin J. Lynagh <kevin@keminglabs.com> fixing memory
3
5
  leak in Jaro match.
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ Amatch is a library for approximate string matching and searching in strings.
13
13
  Several algorithms can be used to do this, and it's also possible to compute a
14
14
  similarity metric number between 0.0 and 1.0 for two given strings.
15
15
  EOT
16
- description 'Library to tail files in Ruby'
17
16
  executables << 'agrep.rb'
18
17
  bindir 'bin'
19
18
  test_dir 'tests'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
data/amatch.gemspec CHANGED
@@ -2,37 +2,39 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{amatch}
5
- s.version = "0.2.6"
5
+ s.version = "0.2.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Florian Frank"]
9
- s.date = %q{2011-07-16}
10
- s.default_executable = %q{agrep.rb}
11
- s.description = %q{Library to tail files in Ruby}
8
+ s.authors = [%q{Florian Frank}]
9
+ s.date = %q{2011-08-05}
10
+ s.description = %q{Amatch is a library for approximate string matching and searching in strings.
11
+ Several algorithms can be used to do this, and it's also possible to compute a
12
+ similarity metric number between 0.0 and 1.0 for two given strings.
13
+ }
12
14
  s.email = %q{flori@ping.de}
13
- s.executables = ["agrep.rb"]
14
- s.extensions = ["ext/extconf.rb"]
15
- s.extra_rdoc_files = ["README.rdoc", "lib/amatch/version.rb", "ext/amatch.c", "ext/pair.c"]
16
- s.files = [".gitignore", "CHANGES", "COPYING", "Gemfile", "README.rdoc", "Rakefile", "VERSION", "amatch.gemspec", "bin/agrep.rb", "ext/amatch.c", "ext/common.h", "ext/extconf.rb", "ext/pair.c", "ext/pair.h", "install.rb", "lib/amatch/.keep", "lib/amatch/version.rb", "tests/test_hamming.rb", "tests/test_jaro.rb", "tests/test_jaro_winkler.rb", "tests/test_levenshtein.rb", "tests/test_longest_subsequence.rb", "tests/test_longest_substring.rb", "tests/test_pair_distance.rb", "tests/test_sellers.rb"]
15
+ s.executables = [%q{agrep.rb}]
16
+ s.extensions = [%q{ext/extconf.rb}]
17
+ s.extra_rdoc_files = [%q{README.rdoc}, %q{lib/amatch/version.rb}, %q{ext/amatch.c}, %q{ext/pair.c}]
18
+ s.files = [%q{.gitignore}, %q{.travis.yml}, %q{CHANGES}, %q{COPYING}, %q{Gemfile}, %q{README.rdoc}, %q{Rakefile}, %q{VERSION}, %q{amatch.gemspec}, %q{bin/agrep.rb}, %q{ext/amatch.c}, %q{ext/common.h}, %q{ext/extconf.rb}, %q{ext/pair.c}, %q{ext/pair.h}, %q{install.rb}, %q{lib/amatch/.keep}, %q{lib/amatch/version.rb}, %q{tests/test_hamming.rb}, %q{tests/test_jaro.rb}, %q{tests/test_jaro_winkler.rb}, %q{tests/test_levenshtein.rb}, %q{tests/test_longest_subsequence.rb}, %q{tests/test_longest_substring.rb}, %q{tests/test_pair_distance.rb}, %q{tests/test_sellers.rb}]
17
19
  s.homepage = %q{http://github.com/flori/amatch}
18
- s.rdoc_options = ["--title", "Amatch - Approximate Matching", "--main", "README.rdoc"]
19
- s.require_paths = ["lib", "ext"]
20
- s.rubygems_version = %q{1.6.2}
20
+ s.rdoc_options = [%q{--title}, %q{Amatch - Approximate Matching}, %q{--main}, %q{README.rdoc}]
21
+ s.require_paths = [%q{lib}, %q{ext}]
22
+ s.rubygems_version = %q{1.8.7}
21
23
  s.summary = %q{Approximate String Matching library}
22
- s.test_files = ["tests/test_sellers.rb", "tests/test_jaro.rb", "tests/test_longest_subsequence.rb", "tests/test_longest_substring.rb", "tests/test_hamming.rb", "tests/test_pair_distance.rb", "tests/test_levenshtein.rb", "tests/test_jaro_winkler.rb"]
24
+ s.test_files = [%q{tests/test_sellers.rb}, %q{tests/test_jaro.rb}, %q{tests/test_longest_subsequence.rb}, %q{tests/test_longest_substring.rb}, %q{tests/test_hamming.rb}, %q{tests/test_pair_distance.rb}, %q{tests/test_levenshtein.rb}, %q{tests/test_jaro_winkler.rb}]
23
25
 
24
26
  if s.respond_to? :specification_version then
25
27
  s.specification_version = 3
26
28
 
27
29
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
- s.add_development_dependency(%q<gem_hadar>, ["~> 0.0.3"])
30
+ s.add_development_dependency(%q<gem_hadar>, ["~> 0.0.11"])
29
31
  s.add_runtime_dependency(%q<spruz>, ["~> 0.2"])
30
32
  else
31
- s.add_dependency(%q<gem_hadar>, ["~> 0.0.3"])
33
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.11"])
32
34
  s.add_dependency(%q<spruz>, ["~> 0.2"])
33
35
  end
34
36
  else
35
- s.add_dependency(%q<gem_hadar>, ["~> 0.0.3"])
37
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.11"])
36
38
  s.add_dependency(%q<spruz>, ["~> 0.2"])
37
39
  end
38
40
  end
data/ext/amatch.c CHANGED
@@ -89,9 +89,10 @@ static VALUE type##_iterate_strings(type *amatch, VALUE strings, \
89
89
  if (TYPE(strings) == T_STRING) { \
90
90
  return match_function(amatch, strings); \
91
91
  } else { \
92
- Check_Type(strings, T_ARRAY); \
93
92
  int i; \
94
- VALUE result = rb_ary_new2(RARRAY_LEN(strings)); \
93
+ VALUE result; \
94
+ Check_Type(strings, T_ARRAY); \
95
+ result = rb_ary_new2(RARRAY_LEN(strings)); \
95
96
  for (i = 0; i < RARRAY_LEN(strings); i++) { \
96
97
  VALUE string = rb_ary_entry(strings, i); \
97
98
  if (TYPE(string) != T_STRING) { \
@@ -696,10 +697,11 @@ static VALUE LongestSubstring_similar(General *amatch, VALUE string)
696
697
 
697
698
 
698
699
  #define LOWERCASE_STRINGS \
699
- char *ying = ALLOC_N(char, a_len); \
700
+ char *ying, *yang; \
701
+ ying = ALLOC_N(char, a_len); \
700
702
  MEMCPY(ying, a_ptr, char, a_len); \
701
703
  a_ptr = ying; \
702
- char *yang = ALLOC_N(char, b_len); \
704
+ yang = ALLOC_N(char, b_len); \
703
705
  MEMCPY(yang, b_ptr, char, b_len); \
704
706
  b_ptr = yang; \
705
707
  for (i = 0; i < a_len; i++) { \
@@ -1101,8 +1103,8 @@ static VALUE rb_PairDistance_match(int argc, VALUE *argv, VALUE self)
1101
1103
  if (TYPE(strings) == T_STRING) {
1102
1104
  result = PairDistance_match(amatch, strings, regexp, use_regexp);
1103
1105
  } else {
1104
- Check_Type(strings, T_ARRAY);
1105
1106
  int i;
1107
+ Check_Type(strings, T_ARRAY);
1106
1108
  result = rb_ary_new2(RARRAY_LEN(strings));
1107
1109
  for (i = 0; i < RARRAY_LEN(strings); i++) {
1108
1110
  VALUE string = rb_ary_entry(strings, i);
@@ -1,6 +1,6 @@
1
1
  module Amatch
2
2
  # Amatch version
3
- VERSION = '0.2.6'
3
+ VERSION = '0.2.7'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,67 +1,59 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: amatch
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.7
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 6
10
- version: 0.2.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Florian Frank
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-07-16 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: gem_hadar
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2153302580 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 25
30
- segments:
31
- - 0
32
- - 0
33
- - 3
34
- version: 0.0.3
20
+ - !ruby/object:Gem::Version
21
+ version: 0.0.11
35
22
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: spruz
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2153302580
25
+ - !ruby/object:Gem::Dependency
26
+ name: spruz
27
+ requirement: &2153302020 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
29
+ requirements:
43
30
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 0
48
- - 2
49
- version: "0.2"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.2'
50
33
  type: :runtime
51
- version_requirements: *id002
52
- description: Library to tail files in Ruby
34
+ prerelease: false
35
+ version_requirements: *2153302020
36
+ description: ! 'Amatch is a library for approximate string matching and searching
37
+ in strings.
38
+
39
+ Several algorithms can be used to do this, and it''s also possible to compute a
40
+
41
+ similarity metric number between 0.0 and 1.0 for two given strings.
42
+
43
+ '
53
44
  email: flori@ping.de
54
- executables:
45
+ executables:
55
46
  - agrep.rb
56
- extensions:
47
+ extensions:
57
48
  - ext/extconf.rb
58
- extra_rdoc_files:
49
+ extra_rdoc_files:
59
50
  - README.rdoc
60
51
  - lib/amatch/version.rb
61
52
  - ext/amatch.c
62
53
  - ext/pair.c
63
- files:
54
+ files:
64
55
  - .gitignore
56
+ - .travis.yml
65
57
  - CHANGES
66
58
  - COPYING
67
59
  - Gemfile
@@ -86,45 +78,36 @@ files:
86
78
  - tests/test_longest_substring.rb
87
79
  - tests/test_pair_distance.rb
88
80
  - tests/test_sellers.rb
89
- has_rdoc: true
90
81
  homepage: http://github.com/flori/amatch
91
82
  licenses: []
92
-
93
83
  post_install_message:
94
- rdoc_options:
84
+ rdoc_options:
95
85
  - --title
96
86
  - Amatch - Approximate Matching
97
87
  - --main
98
88
  - README.rdoc
99
- require_paths:
89
+ require_paths:
100
90
  - lib
101
91
  - ext
102
- required_ruby_version: !ruby/object:Gem::Requirement
92
+ required_ruby_version: !ruby/object:Gem::Requirement
103
93
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 3
108
- segments:
109
- - 0
110
- version: "0"
111
- required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
99
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 3
117
- segments:
118
- - 0
119
- version: "0"
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
120
104
  requirements: []
121
-
122
105
  rubyforge_project:
123
- rubygems_version: 1.6.2
106
+ rubygems_version: 1.8.7
124
107
  signing_key:
125
108
  specification_version: 3
126
109
  summary: Approximate String Matching library
127
- test_files:
110
+ test_files:
128
111
  - tests/test_sellers.rb
129
112
  - tests/test_jaro.rb
130
113
  - tests/test_longest_subsequence.rb