greek_stemmer 1.0.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ec831570df0a15c43e65878794adddee23970d01
4
+ data.tar.gz: f5e7242e457b2e53f5817800782048dc69a8bdea
5
+ SHA512:
6
+ metadata.gz: e63a8457d6fdb2f31182eed7cca96e83a80c3efcd1d1995321c6a0f2bfc0b3f610fb87c3e156ecf4ec1c59692560a0007f7ac9d4c49d9c04dbe321fd940abc82
7
+ data.tar.gz: b6af69e2739c43700cff567eb8421ceaae87d25444b84c635b268d35fbd1846907847b82c089e6775930152b5c265ed7df32bde65864692f357171cc0753725b
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format doc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in greek_stemmer.gemspec
4
+ gemspec
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,21 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc "Update the stems of the sample words"
4
+ task :update_greek_stemming_sample do
5
+
6
+ words = Set.new
7
+ File.open("benchmarks/stemming_sample.txt", "r") do |sample|
8
+ while(line = sample.gets)
9
+ word, _ = line.split(",")
10
+ words << word
11
+ end
12
+ end
13
+
14
+ File.open("benchmarks/stemming_sample.txt", "w") do |sample|
15
+ words.each do |word|
16
+ sample.puts "#{word},#{GreekStemmer.stem(word)}"
17
+ end
18
+ end
19
+ end
20
+
21
+ task :default => :test