jruby_zemberek 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +46 -0
- data/Rakefile +2 -0
- data/jruby_zemberek.gemspec +23 -0
- data/lib/jruby_zemberek.rb +43 -0
- data/lib/jruby_zemberek/java/zemberek/zemberek-az-2.1.1.jar +0 -0
- data/lib/jruby_zemberek/java/zemberek/zemberek-cekirdek-2.1.1.jar +0 -0
- data/lib/jruby_zemberek/java/zemberek/zemberek-demo-2.1.1.jar +0 -0
- data/lib/jruby_zemberek/java/zemberek/zemberek-tk-2.1.1.jar +0 -0
- data/lib/jruby_zemberek/java/zemberek/zemberek-tr-2.1.1.jar +0 -0
- data/lib/jruby_zemberek/version.rb +3 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a3dacc06c65c9e894479b3704b3884c92228a73e
|
4
|
+
data.tar.gz: cb374d80056d48f7eb694e64edc35b94def59274
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e18cc67e6983bb51720fcec01db71734d894d27938a98582b11ef2bbcb5e08b59b44a6efcc83aa40325bdf0b3e536ef3fdf5d8daf93239263b7efbb279250f12
|
7
|
+
data.tar.gz: 575339944af22e29e7bc5c82c6f5bbe0a8998da1ab203cfb56a272a44af23b6dd9f5191bb610546963298f91bfcbd45b282c652a309e8ba7370f7840d6b96ac6
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Nurettin Onur TUĞCU
|
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,46 @@
|
|
1
|
+
# JrubyZemberek
|
2
|
+
|
3
|
+
This is a gem for making it easy to call Zemberek 2.x NLP library functions from JRuby.
|
4
|
+
|
5
|
+
* [Zemberek 2 Javadoc](http://dev.gentoo.org/~serkan/zemberek-javadoc/overview-summary.html)
|
6
|
+
* [Zemberek 2 Kütüphanesi](http://code.google.com/p/zemberek/downloads/list?can=3&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount)
|
7
|
+
* [JRuby'den Java Erişimi](https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby)
|
8
|
+
* [Zemberek 3 Kütüphanesi](http://code.google.com/p/zemberek3/)
|
9
|
+
* [Github'da Zemberek NLP](https://github.com/ahmetaa)
|
10
|
+
* [Zemberek NLP Hakkinda](http://zembereknlp.blogspot.com.tr/2013/12/zemberek-nlp-090.html)
|
11
|
+
|
12
|
+
<center>
|
13
|
+
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">jruby zemberek test</span> by <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Nurettin Onur TUĞCU</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">Creative Commons Attribution 3.0 Unported License</a>.
|
14
|
+
</center>
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'jruby_zemberek'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install jruby_zemberek
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
require "jruby_zemberek"
|
36
|
+
jz= JrubyZemberek.new
|
37
|
+
p jz.metin_cozumle "dünyaya merhaba diyor"
|
38
|
+
```
|
39
|
+
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
1. Fork it ( https://github.com/[my-github-username]/jruby_zemberek/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 a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jruby_zemberek/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jruby_zemberek"
|
8
|
+
spec.version = JrubyZemberek::VERSION
|
9
|
+
spec.authors = ["Nurettin Onur TUĞCU"]
|
10
|
+
spec.email = ["onurtugcu@gmail.com"]
|
11
|
+
spec.summary = %q{Zemberek 2.0 interface for JRuby.}
|
12
|
+
spec.description = %q{This is a gem for making it easy to call zemberek2 2.1.1 NLP library functions from JRuby.}
|
13
|
+
spec.homepage = "https://github.com/nurettin/jruby_zemberek"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative "jruby_zemberek/java/zemberek/zemberek-cekirdek-2.1.1.jar"
|
4
|
+
java_import "net.zemberek.erisim.Zemberek"
|
5
|
+
java_import "net.zemberek.araclar.turkce.YaziIsleyici"
|
6
|
+
|
7
|
+
require_relative "jruby_zemberek/java/zemberek/zemberek-tr-2.1.1.jar"
|
8
|
+
java_import "net.zemberek.tr.yapi.TurkiyeTurkcesi"
|
9
|
+
|
10
|
+
class JrubyZemberek
|
11
|
+
def initialize
|
12
|
+
@z= Zemberek.new(TurkiyeTurkcesi.new)
|
13
|
+
end
|
14
|
+
|
15
|
+
def kelime_cozumle(kelime)
|
16
|
+
@z.kelime_cozumle(kelime).map do |cozum|
|
17
|
+
kok= cozum.kok
|
18
|
+
{ kok: kok.icerik, kok_tip: kok.tip.name, ekler: cozum.ekler.map(&:ad) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def metin_cozumle(metin)
|
23
|
+
YaziIsleyici.analiz_dizisi_olustur(metin).
|
24
|
+
reject do |kelime|
|
25
|
+
kelime.icerik.strip.empty?
|
26
|
+
end.map do |kelime|
|
27
|
+
kelime= kelime.icerik
|
28
|
+
cozumlendi= @z.kelime_denetle kelime
|
29
|
+
sonuc= { kelime: kelime, cozumlendi: cozumlendi }
|
30
|
+
if cozumlendi
|
31
|
+
sonuc[:cozumler]= kelime_cozumle(kelime)
|
32
|
+
sonuc[:oneriler]= []
|
33
|
+
else
|
34
|
+
sonuc[:oneriler]= @z.oner(kelime).map do |oneri|
|
35
|
+
{ cozumler: kelime_cozumle(oneri) }
|
36
|
+
end
|
37
|
+
sonuc[:cozumler]= []
|
38
|
+
end
|
39
|
+
sonuc
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jruby_zemberek
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nurettin Onur TUĞCU
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ~>
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '1.7'
|
25
|
+
prerelease: false
|
26
|
+
type: :development
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '10.0'
|
39
|
+
prerelease: false
|
40
|
+
type: :development
|
41
|
+
description: This is a gem for making it easy to call zemberek2 2.1.1 NLP library functions from JRuby.
|
42
|
+
email:
|
43
|
+
- onurtugcu@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- jruby_zemberek.gemspec
|
54
|
+
- lib/jruby_zemberek.rb
|
55
|
+
- lib/jruby_zemberek/java/zemberek/zemberek-az-2.1.1.jar
|
56
|
+
- lib/jruby_zemberek/java/zemberek/zemberek-cekirdek-2.1.1.jar
|
57
|
+
- lib/jruby_zemberek/java/zemberek/zemberek-demo-2.1.1.jar
|
58
|
+
- lib/jruby_zemberek/java/zemberek/zemberek-tk-2.1.1.jar
|
59
|
+
- lib/jruby_zemberek/java/zemberek/zemberek-tr-2.1.1.jar
|
60
|
+
- lib/jruby_zemberek/version.rb
|
61
|
+
homepage: https://github.com/nurettin/jruby_zemberek
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata: {}
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 2.1.9
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: Zemberek 2.0 interface for JRuby.
|
85
|
+
test_files: []
|