greek_stemmer 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +20 -0
- data/benchmarks/stemming_sample.txt +18329 -0
- data/config/stemmer.yml +263 -0
- data/greek_stemmer.gemspec +31 -0
- data/lib/greek_stemmer/version.rb +3 -0
- data/lib/greek_stemmer.rb +276 -0
- data/spec/fixtures/examples.yml +115 -0
- data/spec/greek_stemmer_spec.rb +20 -0
- data/spec/spec_helper.rb +21 -0
- metadata +21 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 014ea70b04e866ca974455411bf3fb6243c70463
|
4
|
+
data.tar.gz: 2b0e26f0e2a6bdc484f7d945292fe151a4c86caa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50983d62009371959e61890deb63d80bc6a2e7cac99cbfd698be82ef00827fc12aecc0b1cac74ddd5ea25cc65c61992f101995ac7b03ae09f02d7e809983526
|
7
|
+
data.tar.gz: f8f35d1daed8e137a3c7c96f7799d3ebd6b69753d3406dbb0369fcedc6ae24a4d4a31bed89f61b520470139b9adaf311f4ac6ca6ddf1d44b15d56a5e87e8f553
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Skroutz SA
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# GreekStemmer
|
2
|
+
|
3
|
+
A simple Greek stemmer algorithm.
|
4
|
+
|
5
|
+
This algorithm is based on this [paper](http://people.dsv.su.se/~hercules/papers/Ntais_greek_stemmer_thesis_final.pdf) from George Ntais.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'greek_stemmer'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install greek_stemmer
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
In order to use this stemmer you should normalize input.
|
24
|
+
Normalization means two things for this algorithm: detone and upcase.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
require 'greek_stemmer'
|
28
|
+
|
29
|
+
GreekStemmer.stem("ΠΟΣΟΤΗΤΑ") # => "ΠΟΣΟΤΗΤ"
|
30
|
+
```
|
31
|
+
|
32
|
+
## References
|
33
|
+
|
34
|
+
* [Development of a Stemmer for the Greek Language](http://people.dsv.su.se/~hercules/papers/Ntais_greek_stemmer_thesis_final.pdf)
|
35
|
+
|
36
|
+
## Credits
|
37
|
+
|
38
|
+
Original work: [bandito](https://github.com/bandito)
|
39
|
+
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
1. Fork it ( http://github.com/<my-github-username>/greek_stemmer/fork )
|
43
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
44
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
45
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
46
|
+
5. Create new Pull Request
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
greek_stemmer is licensed under MIT License. See [LICENSE](LICENSE.txt) for details.
|
51
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "greek_stemmer"
|
3
|
+
|
4
|
+
desc "Update the stems of the sample words"
|
5
|
+
task :update_greek_stemming_sample do
|
6
|
+
|
7
|
+
words = Set.new
|
8
|
+
File.open("benchmarks/stemming_sample.txt", "r") do |sample|
|
9
|
+
while(line = sample.gets)
|
10
|
+
word, _ = line.split(",")
|
11
|
+
words << word
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
File.open("benchmarks/stemming_sample.txt", "w") do |sample|
|
16
|
+
words.each do |word|
|
17
|
+
sample.puts "#{word},#{GreekStemmer.stem(word)}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|