ruby-stemmer 0.0.2 → 0.0.3
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.
- data/README +5 -3
 - data/Rakefile +3 -3
 - data/extconf.rb +2 -2
 - data/ruby-stemmer.c +7 -4
 - data/test.rb +2 -2
 - metadata +2 -2
 
    
        data/README
    CHANGED
    
    | 
         @@ -1,12 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --
         
     | 
| 
       2 
     | 
    
         
            -
            $Id: README  
     | 
| 
      
 2 
     | 
    
         
            +
            $Id: README 19 2008-01-08 12:25:57Z aurelian $
         
     | 
| 
       3 
3 
     | 
    
         
             
            ++
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            == About
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
            ruby-stemmer, an extension to ruby using stemmer implementation  
     | 
| 
      
 7 
     | 
    
         
            +
            ruby-stemmer, an extension to ruby using SnowBall API stemmer implementation libstemmer_c.
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
            This package includes libstemmer_c library from http://snowball.tartarus.org/dist/libstemmer_c.tgz
         
     | 
| 
      
 9 
     | 
    
         
            +
            This package includes libstemmer_c library from http://snowball.tartarus.org/dist/libstemmer_c.tgz published under the terms of BSD License.
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            For details about libstemmer_c read libstemmer_c/README or http://snowball.tartarus.org.
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
         @@ -14,6 +14,8 @@ author: Aurelian Oancea, aurelian at locknet dot ro 
     | 
|
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
            licence: MIT, see MIT-LICENSE for details
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
      
 17 
     | 
    
         
            +
            :include: MIT-LICENSE
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       17 
19 
     | 
    
         
             
            == Install
         
     | 
| 
       18 
20 
     | 
    
         | 
| 
       19 
21 
     | 
    
         
             
            I) Using RubyGems
         
     | 
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #
         
     | 
| 
       2 
     | 
    
         
            -
            # $Id: Rakefile  
     | 
| 
      
 2 
     | 
    
         
            +
            # $Id: Rakefile 19 2008-01-08 12:25:57Z aurelian $
         
     | 
| 
       3 
3 
     | 
    
         
             
            #
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            require 'rubygems'
         
     | 
| 
         @@ -25,8 +25,8 @@ PKG_FILES.exclude('*.so') 
     | 
|
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
            spec = Gem::Specification.new do | s |
         
     | 
| 
       27 
27 
     | 
    
         
             
              s.name = 'ruby-stemmer'
         
     | 
| 
       28 
     | 
    
         
            -
              s.version = '0.0. 
     | 
| 
       29 
     | 
    
         
            -
              s.summary = "Stemmer implementation to ruby using libstemmer_c."
         
     | 
| 
      
 28 
     | 
    
         
            +
              s.version = '0.0.3'
         
     | 
| 
      
 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.
         
     | 
| 
       32 
32 
     | 
    
         
             
              EOF
         
     | 
    
        data/extconf.rb
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #
         
     | 
| 
       2 
     | 
    
         
            -
            # $Id: extconf.rb  
     | 
| 
      
 2 
     | 
    
         
            +
            # $Id: extconf.rb 19 2008-01-08 12:25:57Z aurelian $
         
     | 
| 
       3 
3 
     | 
    
         
             
            #
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            require "mkmf"
         
     | 
| 
         @@ -10,5 +10,5 @@ $CFLAGS += " -I#{File.dirname(__FILE__)}/libstemmer_c/include " 
     | 
|
| 
       10 
10 
     | 
    
         
             
            $libs   += " -L#{File.dirname(__FILE__)}/libstemmer_c -llibstemmer.o "
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            have_header("libstemmer.h")
         
     | 
| 
       13 
     | 
    
         
            -
            create_makefile("stemmer")
         
     | 
| 
      
 13 
     | 
    
         
            +
            create_makefile("lingua/stemmer")
         
     | 
| 
       14 
14 
     | 
    
         | 
    
        data/ruby-stemmer.c
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            //
         
     | 
| 
       2 
     | 
    
         
            -
            // $Id: ruby-stemmer.c  
     | 
| 
      
 2 
     | 
    
         
            +
            // $Id: ruby-stemmer.c 19 2008-01-08 12:25:57Z aurelian $
         
     | 
| 
       3 
3 
     | 
    
         
             
            //
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            #include "ruby.h"
         
     | 
| 
         @@ -24,7 +24,8 @@ struct sb_stemmer_data { 
     | 
|
| 
       24 
24 
     | 
    
         
             
             *
         
     | 
| 
       25 
25 
     | 
    
         
             
             * Creates a new Stemmer, pass <tt>:language</tt> and <tt>:encoding</tt> as arguments 
         
     | 
| 
       26 
26 
     | 
    
         
             
             * to change encoding or language, otherwise english with UTF_8 will be used
         
     | 
| 
       27 
     | 
    
         
            -
             * 
     | 
| 
      
 27 
     | 
    
         
            +
             *   
         
     | 
| 
      
 28 
     | 
    
         
            +
             *   require 'lingua/stemmer'
         
     | 
| 
       28 
29 
     | 
    
         
             
             *   s = Lingua::Stemmer.new :language => 'fr'
         
     | 
| 
       29 
30 
     | 
    
         
             
             */ 
         
     | 
| 
       30 
31 
     | 
    
         
             
            static VALUE 
         
     | 
| 
         @@ -80,7 +81,8 @@ rb_stemmer_init(int argc, VALUE *argv, VALUE self) { 
     | 
|
| 
       80 
81 
     | 
    
         
             
             * call-seq: stem
         
     | 
| 
       81 
82 
     | 
    
         
             
             *
         
     | 
| 
       82 
83 
     | 
    
         
             
             * Stems a word
         
     | 
| 
       83 
     | 
    
         
            -
             *
         
     | 
| 
      
 84 
     | 
    
         
            +
             *   
         
     | 
| 
      
 85 
     | 
    
         
            +
             *   require 'lingua/stemmer'
         
     | 
| 
       84 
86 
     | 
    
         
             
             *   s = Lingua::Stemmer.new
         
     | 
| 
       85 
87 
     | 
    
         
             
             *   s.stem "installation" # ==> install
         
     | 
| 
       86 
88 
     | 
    
         
             
             */ 
         
     | 
| 
         @@ -100,6 +102,7 @@ rb_stemmer_stem(VALUE self, VALUE word) { 
     | 
|
| 
       100 
102 
     | 
    
         
             
             *
         
     | 
| 
       101 
103 
     | 
    
         
             
             * Gets the length of the last stemmed word
         
     | 
| 
       102 
104 
     | 
    
         
             
             *
         
     | 
| 
      
 105 
     | 
    
         
            +
             *   require 'lingua/stemmer'
         
     | 
| 
       103 
106 
     | 
    
         
             
             *   s = Lingua::Stemmer.new
         
     | 
| 
       104 
107 
     | 
    
         
             
             *   s.stem "installation"
         
     | 
| 
       105 
108 
     | 
    
         
             
             *   s.length # ==> 6
         
     | 
| 
         @@ -126,7 +129,7 @@ sb_stemmer_alloc(VALUE klass) 
     | 
|
| 
       126 
129 
     | 
    
         
             
            }
         
     | 
| 
       127 
130 
     | 
    
         | 
| 
       128 
131 
     | 
    
         
             
            /*
         
     | 
| 
       129 
     | 
    
         
            -
             * ruby-stemmer, ruby extension to SnowBall API
         
     | 
| 
      
 132 
     | 
    
         
            +
             * ruby-stemmer, ruby extension to SnowBall API using libstemmer_c
         
     | 
| 
       130 
133 
     | 
    
         
             
             */
         
     | 
| 
       131 
134 
     | 
    
         
             
            void Init_stemmer() {
         
     | 
| 
       132 
135 
     | 
    
         
             
              rb_mLingua = rb_define_module("Lingua");
         
     | 
    
        data/test.rb
    CHANGED
    
    | 
         @@ -1,12 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            #
         
     | 
| 
       4 
     | 
    
         
            -
            # $Id: test.rb  
     | 
| 
      
 4 
     | 
    
         
            +
            # $Id: test.rb 19 2008-01-08 12:25:57Z aurelian $
         
     | 
| 
       5 
5 
     | 
    
         
             
            #
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            $kcode = "utf-8"
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
            require "stemmer"
         
     | 
| 
      
 9 
     | 
    
         
            +
            require "lingua/stemmer"
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            # puts ">>> test 1."
         
     | 
| 
       12 
12 
     | 
    
         
             
            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.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Aurelian Oancea
         
     | 
| 
         @@ -148,6 +148,6 @@ rubyforge_project: nrr 
     | 
|
| 
       148 
148 
     | 
    
         
             
            rubygems_version: 1.0.1
         
     | 
| 
       149 
149 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       150 
150 
     | 
    
         
             
            specification_version: 2
         
     | 
| 
       151 
     | 
    
         
            -
            summary: Stemmer implementation to ruby using libstemmer_c.
         
     | 
| 
      
 151 
     | 
    
         
            +
            summary: Stemmer implementation to ruby using SnowBall API from libstemmer_c.
         
     | 
| 
       152 
152 
     | 
    
         
             
            test_files: []
         
     | 
| 
       153 
153 
     | 
    
         |