ruby-stemmer 0.0.3 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -2
- data/extconf.rb +9 -6
- data/libstemmer_c/Makefile +1 -1
- data/ruby-stemmer.c +2 -2
- data/test.rb +4 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# $Id: Rakefile
|
2
|
+
# $Id: Rakefile 22 2008-05-09 23:49:43Z aurelian $
|
3
3
|
#
|
4
4
|
|
5
5
|
require 'rubygems'
|
@@ -25,7 +25,7 @@ PKG_FILES.exclude('*.so')
|
|
25
25
|
|
26
26
|
spec = Gem::Specification.new do | s |
|
27
27
|
s.name = 'ruby-stemmer'
|
28
|
-
s.version = '0.
|
28
|
+
s.version = '0.5.1'
|
29
29
|
s.summary = "Stemmer implementation to ruby using SnowBall API from libstemmer_c."
|
30
30
|
s.description = <<-EOF
|
31
31
|
Stemmer implementation to ruby using libstemmer_c.
|
@@ -52,3 +52,8 @@ task :default do
|
|
52
52
|
puts "Ok"
|
53
53
|
end
|
54
54
|
|
55
|
+
task :clean do
|
56
|
+
`rm -rf Makefile mkmf.log ruby-stemmer.o stemmer.bundle stemmer.so`
|
57
|
+
`cd libstemmer_c && make clean && cd ../`
|
58
|
+
end
|
59
|
+
|
data/extconf.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
#
|
2
|
-
# $Id: extconf.rb
|
2
|
+
# $Id: extconf.rb 21 2008-04-30 10:57:37Z aurelian $
|
3
3
|
#
|
4
4
|
|
5
5
|
require "mkmf"
|
6
6
|
|
7
|
-
system "cd libstemmer_c; make; cd #{File.dirname(__FILE__)};"
|
7
|
+
system "cd libstemmer_c; make libstemmer.o; cd #{File.dirname(__FILE__)};"
|
8
8
|
|
9
|
-
$CFLAGS
|
10
|
-
$libs
|
9
|
+
$CFLAGS += " -I#{File.dirname(__FILE__)}/libstemmer_c/include "
|
10
|
+
$libs += " -L#{File.dirname(__FILE__)}/libstemmer_c #{File.dirname(__FILE__)}/libstemmer_c/libstemmer.o "
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
# dir_config("libstemmer")
|
13
|
+
|
14
|
+
if have_header("libstemmer.h") # && have_library('libstemmer')
|
15
|
+
create_makefile("lingua/stemmer")
|
16
|
+
end
|
14
17
|
|
data/libstemmer_c/Makefile
CHANGED
data/ruby-stemmer.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// $Id: ruby-stemmer.c
|
2
|
+
// $Id: ruby-stemmer.c 20 2008-04-29 20:59:56Z aurelian $
|
3
3
|
//
|
4
4
|
|
5
5
|
#include "ruby.h"
|
@@ -56,7 +56,7 @@ rb_stemmer_init(int argc, VALUE *argv, VALUE self) {
|
|
56
56
|
|
57
57
|
stemmer = sb_stemmer_new( RSTRING(rlang)->ptr, RSTRING(renc)->ptr );
|
58
58
|
if (stemmer == 0) {
|
59
|
-
printf(">>[libstemmer]: got a null stemmer!\n");
|
59
|
+
// printf(">>[libstemmer]: got a null stemmer!\n");
|
60
60
|
if (renc == 0 ) {
|
61
61
|
rb_raise(rb_eRuntimeError, "Language %s not available for stemming", RSTRING(rlang)->ptr);
|
62
62
|
exit(1);
|
data/test.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
#
|
4
|
-
# $Id: test.rb
|
4
|
+
# $Id: test.rb 21 2008-04-30 10:57:37Z aurelian $
|
5
5
|
#
|
6
6
|
|
7
7
|
$kcode = "utf-8"
|
8
8
|
|
9
|
-
require "
|
9
|
+
require "stemmer.so"
|
10
|
+
|
11
|
+
#puts "installation".stem
|
10
12
|
|
11
13
|
# puts ">>> test 1."
|
12
14
|
stemmer = Lingua::Stemmer.new()
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-stemmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurelian Oancea
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-10 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|