arKeyworder 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.
@@ -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 @@
1
+ --color
@@ -0,0 +1,2 @@
1
+ ## V 1.0.0
2
+ * first stable release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in arKeyworder.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Abdulaziz Alnutaifi
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.
@@ -0,0 +1,29 @@
1
+ # ArKeyworder [![Build Status](https://secure.travis-ci.org/alnutaifi/arKeyworder.png)](http://travis-ci.org/alnutaifi/arKeyworder)
2
+ Extracts keywords from Arabic Text
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ gem 'arKeyworder'
9
+
10
+ And then execute:
11
+
12
+ $ bundle
13
+
14
+ Or install it yourself as:
15
+
16
+ $ gem install arKeyworder
17
+
18
+ ## Usage
19
+
20
+ TODO: Write usage instructions here
21
+
22
+ ## Contributing
23
+
24
+ 1. Fork it
25
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
26
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
27
+ 4. Push to the branch (`git push origin my-new-feature`)
28
+ 5. Create Rspec tests to cover the added features
29
+ 6. Create new Pull Request
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task default: :spec
8
+
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'arKeyworder/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "arKeyworder"
8
+ gem.version = ArKeyworder::VERSION
9
+ gem.authors = ["Abdulaziz Alnutaifi"]
10
+ gem.email = ["abdulaziz.alnutaifi@me.com"]
11
+ gem.description = %q{Extract Keywords from Arabic Text}
12
+ gem.summary = %q{Takes a sentence in Arabic and extracts keywords. Right now the implementation just strips out noisy words :) }
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_development_dependency "rake"
21
+ gem.add_development_dependency "rspec"
22
+
23
+ end
@@ -0,0 +1,18 @@
1
+ require "arKeyworder/version"
2
+ require "arKeyworder/constants"
3
+ module ArKeyworder
4
+ def arabic_keywords
5
+ # for now we only have one check : stripping out conjunction words
6
+ str = self
7
+ ArKeyworder::NONWORDS.each do |term|
8
+ str.gsub!(term, "")
9
+ end
10
+ return str.split
11
+ end
12
+ end
13
+
14
+ class String
15
+
16
+ include(ArKeyworder)
17
+
18
+ end
@@ -0,0 +1,84 @@
1
+ # encoding: utf-8
2
+ ArKeyworder::NONWORDS = "
3
+ من
4
+ إلى
5
+ عن
6
+ على
7
+ في
8
+ ماذا
9
+ كيف
10
+ متى
11
+ أين
12
+ عن
13
+ عنهما
14
+ منها
15
+ كيفما
16
+ خلا
17
+ حاشا
18
+ عدا
19
+ مذ
20
+ منذ
21
+ رب
22
+ كي
23
+ لعل
24
+ أي
25
+ يا
26
+ أيا
27
+ هيا
28
+ نعم
29
+ أجل
30
+ إي
31
+ لا
32
+ بلى
33
+ إذن
34
+ إن
35
+ أن
36
+ كأن
37
+ ليت
38
+ لكن
39
+ لعل
40
+ ما
41
+ لات
42
+ إن
43
+ ما
44
+ كي
45
+ لو
46
+ هل
47
+ لن
48
+ إذن
49
+ حتى
50
+ لم
51
+ لما
52
+ إذما
53
+ هلا
54
+ هذا
55
+ هذهِ
56
+ هذي
57
+ هاتِهِ
58
+ هاتي
59
+ هذهِ
60
+ هذانِ
61
+ هذينِ
62
+ هاتان
63
+ هاتين
64
+ هؤلاء
65
+ هنا
66
+ الذي
67
+ اللتي
68
+ اللتان
69
+ اللتين
70
+ اللواتي
71
+ اللائي
72
+ ماذا
73
+ كيف
74
+ هل
75
+ ليت
76
+ كم
77
+ أين
78
+ ؟
79
+ ?
80
+ ،
81
+ .
82
+ :
83
+ ؛
84
+ ".split
@@ -0,0 +1,3 @@
1
+ module ArKeyworder
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ require "spec_helper"
4
+
5
+ describe String , "#arabic_keywords" do
6
+ it "strips non-contributing parts" do
7
+ text = "كيف تصطاد ضب ؟"
8
+ keywords = text.arabic_keywords
9
+ keywords.should_not include("كيف")
10
+ keywords.should_not include("؟")
11
+ keywords.should include("تصطاد")
12
+ keywords.should include("ضب")
13
+ end
14
+ end
@@ -0,0 +1 @@
1
+ require "arKeyworder"
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arKeyworder
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Abdulaziz Alnutaifi
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Extract Keywords from Arabic Text
47
+ email:
48
+ - abdulaziz.alnutaifi@me.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - .rspec
55
+ - CHANGELOG.md
56
+ - Gemfile
57
+ - LICENSE.txt
58
+ - README.md
59
+ - Rakefile
60
+ - arKeyworder.gemspec
61
+ - lib/arKeyworder.rb
62
+ - lib/arKeyworder/constants.rb
63
+ - lib/arKeyworder/version.rb
64
+ - spec/arKeyworder_spec.rb
65
+ - spec/spec_helper.rb
66
+ homepage: ''
67
+ licenses: []
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project:
86
+ rubygems_version: 1.8.24
87
+ signing_key:
88
+ specification_version: 3
89
+ summary: Takes a sentence in Arabic and extracts keywords. Right now the implementation
90
+ just strips out noisy words :)
91
+ test_files:
92
+ - spec/arKeyworder_spec.rb
93
+ - spec/spec_helper.rb