amatch 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,5 @@
1
+ 2005-01-20 (0.1.5)
2
+ * Bugfix for insertion/deletion weights. Sorry.
1
3
  2005-01-20 (0.1.4)
2
4
  * Better argument handling in initialization method
3
5
  * Minor changes in Rakefile and README.en
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ PKG_FILES = Dir.glob("**/*").delete_if {|item|
16
16
  task :default => [:test]
17
17
 
18
18
  desc "Run unit tests"
19
- task(:test => [:compile]) do
19
+ task(:test => [ :clean, :compile ]) do
20
20
  ruby %{-Iext tests/test.rb}
21
21
  end
22
22
 
@@ -24,7 +24,7 @@ desc "Compiling library"
24
24
  task :compile do
25
25
  cd 'ext' do
26
26
  ruby %{extconf.rb}
27
- system "make"
27
+ sh "make"
28
28
  end
29
29
  end
30
30
 
@@ -38,7 +38,8 @@ end
38
38
 
39
39
  task :clean do
40
40
  cd 'ext' do
41
- system "make distclean"
41
+ ruby %{extconf.rb}
42
+ sh "make distclean" if File.exist?('Makefile')
42
43
  end
43
44
  end
44
45
 
@@ -98,5 +99,5 @@ Rake::GemPackageTask.new(spec) do |pkg|
98
99
  pkg.package_files += PKG_FILES
99
100
  end
100
101
 
101
- task :release => [ :clean, :compile, :package ]
102
+ task :release => [ :clean, :package ]
102
103
  # vim: set et sw=4 ts=4:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/ext/amatch.c CHANGED
@@ -133,8 +133,8 @@ calculate_distance (self, string, mode)
133
133
  /* Bellman's principle of optimality: */
134
134
  weight = v[p]->ptr[j - 1] +
135
135
  (pattern_ptr[i - 1] == string_ptr[j - 1] ? 0 : sw);
136
- if (weight > v[p]->ptr[j] + 1) weight = v[p]->ptr[j] + dw;
137
- if (weight > v[c]->ptr[j - 1] + 1) weight = v[c]->ptr[j - 1] + iw;
136
+ if (weight > v[p]->ptr[j] + iw) weight = v[p]->ptr[j] + iw;
137
+ if (weight > v[c]->ptr[j - 1] + dw) weight = v[c]->ptr[j - 1] + dw;
138
138
  v[c]->ptr[j] = weight;
139
139
  }
140
140
  }
data/tests/test.rb CHANGED
@@ -70,11 +70,11 @@ class TC_AmatchTest < Test::Unit::TestCase
70
70
  assert(@matcher.match('tast') == 2)
71
71
  @matcher.subw = 1
72
72
  assert(@matcher.match('tast') == 1)
73
- @matcher.insw = 2
74
- assert(@matcher.insw == 2)
75
- assert(@matcher.match('teist') == 2)
76
73
  @matcher.delw = 2
77
74
  assert(@matcher.delw == 2)
75
+ assert(@matcher.match('teist') == 2)
76
+ @matcher.insw = 2
77
+ assert(@matcher.insw == 2)
78
78
  assert(@matcher.match('tst') == 2)
79
79
  @matcher.resetw
80
80
  assert(@matcher.subw == 1)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.1
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: amatch
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.4
7
- date: 2005-01-20
6
+ version: 0.1.5
7
+ date: 2005-05-26
8
8
  summary: Approximate String Matching library
9
9
  require_paths:
10
10
  - lib
11
- author: Florian Frank
12
11
  email: flori@ping.de
13
12
  homepage: http://amatch.rubyforge.org
14
13
  rubyforge_project: amatch
@@ -25,6 +24,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
24
  version: 0.0.0
26
25
  version:
27
26
  platform: ruby
27
+ authors:
28
+ - Florian Frank
28
29
  files:
29
30
  - README.en
30
31
  - CHANGES
@@ -32,18 +33,13 @@ files:
32
33
  - bin
33
34
  - bin/agrep.rb
34
35
  - ext
35
- - ext/Makefile
36
36
  - ext/MANIFEST
37
37
  - ext/amatch.c
38
38
  - ext/extconf.rb
39
- - ext/amatch.o
40
- - ext/amatch.so
41
39
  - Rakefile
42
40
  - VERSION
43
41
  - amatch.txt.en
44
42
  - install.rb
45
- - config.save
46
- - InstalledFiles
47
43
  - tests
48
44
  - tests/test.rb
49
45
  test_files:
data/InstalledFiles DELETED
@@ -1,5 +0,0 @@
1
- /usr/local/stow/ruby/bin/
2
- /usr/local/stow/ruby/bin/CVS
3
- /usr/local/stow/ruby/bin/CVS
4
- /usr/local/stow/ruby/bin/CVS
5
- /usr/local/stow/ruby/lib/ruby/site_ruby/1.8/i686-linux/.
data/config.save DELETED
@@ -1,12 +0,0 @@
1
- bin-dir=$prefix/bin
2
- site-ruby=$prefix/lib/ruby/site_ruby/1.8
3
- prefix=/usr/local/stow/ruby
4
- ruby-path=/usr/local/stow/ruby/bin/ruby
5
- make-prog=make
6
- rb-dir=$site-ruby
7
- without-ext=no
8
- ruby-prog=/usr/local/stow/ruby/bin/ruby
9
- site-ruby-common=$prefix/lib/ruby/site_ruby
10
- std-ruby=$prefix/lib/ruby/1.8
11
- data-dir=$prefix/share
12
- so-dir=$prefix/lib/ruby/site_ruby/1.8/i686-linux
data/ext/Makefile DELETED
@@ -1,138 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = .
7
- topdir = /usr/local/stow/ruby/lib/ruby/1.9/i686-linux
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir):$(topdir):$(hdrdir)
10
- prefix = $(DESTDIR)/usr/local/stow/ruby
11
- exec_prefix = $(prefix)
12
- sitedir = $(prefix)/lib/ruby/site_ruby
13
- rubylibdir = $(libdir)/ruby/$(ruby_version)
14
- builddir = $(ac_builddir)
15
- archdir = $(rubylibdir)/$(arch)
16
- sbindir = $(exec_prefix)/sbin
17
- datadir = $(prefix)/share
18
- includedir = $(prefix)/include
19
- infodir = $(prefix)/info
20
- top_builddir = $(ac_top_builddir)
21
- sysconfdir = $(prefix)/etc
22
- mandir = $(prefix)/man
23
- libdir = $(exec_prefix)/lib
24
- sharedstatedir = $(prefix)/com
25
- oldincludedir = $(DESTDIR)/usr/include
26
- sitearchdir = $(sitelibdir)/$(sitearch)
27
- bindir = $(exec_prefix)/bin
28
- localstatedir = $(prefix)/var
29
- sitelibdir = $(sitedir)/$(ruby_version)
30
- libexecdir = $(exec_prefix)/libexec
31
-
32
- CC = gcc
33
- LIBRUBY = $(LIBRUBY_SO)
34
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
35
- LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -L. -l$(RUBY_SO_NAME)
36
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
37
-
38
- CFLAGS = -fPIC -g -O2 -fPIC
39
- CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
40
- CXXFLAGS = $(CFLAGS)
41
- DLDFLAGS =
42
- LDSHARED = $(CC) -shared
43
- AR = ar
44
- EXEEXT =
45
-
46
- RUBY_INSTALL_NAME = ruby
47
- RUBY_SO_NAME = ruby
48
- arch = i686-linux
49
- sitearch = i686-linux
50
- ruby_version = 1.9
51
- ruby = /usr/local/stow/ruby/bin/ruby
52
- RUBY = $(ruby)
53
- RM = rm -f
54
- MAKEDIRS = $(RUBY) -run -e mkdir -- -p
55
- INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
56
- INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644
57
- COPY = $(RUBY) -run -e cp -- -v
58
-
59
- #### End of system configuration section. ####
60
-
61
-
62
- preload =
63
- libpath = $(libdir)
64
- LIBPATH = -L'$(libdir)' -Wl,-R'$(libdir)'
65
- DEFFILE =
66
-
67
- CLEANFILES =
68
- DISTCLEANFILES =
69
-
70
- extout =
71
- extout_prefix =
72
- target_prefix =
73
- LOCAL_LIBS =
74
- LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lcrypt -lm -lc
75
- OBJS = amatch.o
76
- TARGET = amatch
77
- DLLIB = $(TARGET).so
78
- STATIC_LIB =
79
-
80
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
81
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
82
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
83
-
84
- CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
85
- CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
86
-
87
- all: $(DLLIB)
88
- static: $(STATIC_LIB)
89
-
90
- clean:
91
- @$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
92
-
93
- distclean: clean
94
- @$(RM) Makefile extconf.h conftest.* mkmf.log
95
- @$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
96
-
97
- realclean: distclean
98
- install: install-so install-rb
99
-
100
- install-so: $(RUBYARCHDIR)
101
- install-so: $(RUBYARCHDIR)/$(DLLIB)
102
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
103
- @$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
104
- install-rb: $(RUBYLIBDIR)
105
- $(RUBYARCHDIR):
106
- @$(MAKEDIRS) $@
107
- $(RUBYLIBDIR):
108
- @$(MAKEDIRS) $@
109
-
110
- site-install: site-install-so site-install-rb
111
- site-install-so: install-so
112
- site-install-rb: install-rb
113
-
114
- .SUFFIXES: .c .cc .m .cxx .cpp .C .o
115
-
116
- .cc.o:
117
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
118
-
119
- .cpp.o:
120
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
121
-
122
- .cxx.o:
123
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
124
-
125
- .C.o:
126
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
127
-
128
- .c.o:
129
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
130
-
131
- $(DLLIB): $(OBJS)
132
- @-$(RM) $@
133
- @-$(MAKEDIRS) $(@D)
134
- $(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $@ $(OBJS) $(LOCAL_LIBS) $(LIBS)
135
-
136
-
137
-
138
- $(OBJS): ruby.h defines.h
data/ext/amatch.o DELETED
Binary file
data/ext/amatch.so DELETED
Binary file