natto2classifier 0.3.1 → 0.3.6
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 +5 -5
- data/.circleci/config.yml +1 -0
- data/.travis.yml +18 -2
- data/Gemfile.lock +14 -14
- data/README.md +4 -2
- data/lib/natto2classifier/natto.rb +6 -3
- data/lib/natto2classifier/version.rb +1 -1
- data/natto2classifier.gemspec +2 -2
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 747d5b6779c3ccb5d91320b807f30b48220d61c299286fa82b354bd3474b537c
|
4
|
+
data.tar.gz: 51055a4f0eda8aff31dd20fa5957226a1a3ab8f0562b55c141894f39321e594f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc34928d4158803ca746c8d3ab59c36fb496ba85c655404603d292691aa8611215ceb691ccefe6d301d4adfee65fae0aaaf9bebdf013a65a91ebacbfeaf1b1b5
|
7
|
+
data.tar.gz: 49d9d8afbdae68c3a5d294cc4d3aa94387cfeb66d575333a72382dc5d1b74fed90afb883d8c2684031ec49fd1e2f0525dacb8e161f004ae66622c6d290067b6b
|
data/.circleci/config.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,21 @@
|
|
1
|
-
sudo: false
|
2
1
|
language: ruby
|
3
2
|
rvm:
|
4
3
|
- 2.4.3
|
5
|
-
before_install:
|
4
|
+
before_install:
|
5
|
+
- gem install bundler -v 1.16.1
|
6
|
+
- sudo apt-get update -qq
|
7
|
+
install:
|
8
|
+
# mecab
|
9
|
+
- wget --no-check-certificate https://github.com/buruzaemon/natto/raw/master/etc/mecab-0.996.tar.gz && tar zxf mecab-0.996.tar.gz
|
10
|
+
- pushd mecab-0.996 && ./configure --enable-utf8-only && make && sudo make install && popd
|
11
|
+
- sudo ldconfig
|
12
|
+
# mecab-ipadic
|
13
|
+
- wget --no-check-certificate https://github.com/buruzaemon/natto/raw/master/etc/mecab-ipadic-2.7.0-20070801.tar.gz && tar zxf mecab-ipadic-2.7.0-20070801.tar.gz
|
14
|
+
- pushd mecab-ipadic-2.7.0-20070801 && ./configure --with-charset=utf8 && make && sudo make install && popd
|
15
|
+
- sudo ldconfig
|
16
|
+
# gsl
|
17
|
+
- sudo apt-get install libgsl2 libgsl-dev
|
18
|
+
# explicitly install
|
19
|
+
- bundle install --path .bundle
|
20
|
+
script:
|
21
|
+
- bundle exec ruby test/natto2classifier_test.rb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
natto2classifier (0.3.
|
4
|
+
natto2classifier (0.3.6)
|
5
5
|
classifier-reborn
|
6
6
|
natto
|
7
7
|
rb-gsl
|
@@ -11,30 +11,30 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
classifier-reborn (2.2.0)
|
13
13
|
fast-stemmer (~> 1.0)
|
14
|
-
coderay (1.1.
|
14
|
+
coderay (1.1.3)
|
15
15
|
fast-stemmer (1.0.2)
|
16
|
-
ffi (1.
|
16
|
+
ffi (1.15.4)
|
17
17
|
gsl (2.1.0.3)
|
18
|
-
method_source (0.
|
19
|
-
minitest (5.
|
20
|
-
natto (1.
|
18
|
+
method_source (1.0.0)
|
19
|
+
minitest (5.14.4)
|
20
|
+
natto (1.2.0)
|
21
21
|
ffi (>= 1.9.0)
|
22
|
-
pry (0.
|
23
|
-
coderay (~> 1.1
|
24
|
-
method_source (~>
|
25
|
-
rake (
|
22
|
+
pry (0.14.1)
|
23
|
+
coderay (~> 1.1)
|
24
|
+
method_source (~> 1.0)
|
25
|
+
rake (13.0.6)
|
26
26
|
rb-gsl (1.16.0.6)
|
27
27
|
gsl
|
28
28
|
|
29
29
|
PLATFORMS
|
30
|
-
|
30
|
+
x86_64-darwin-19
|
31
31
|
|
32
32
|
DEPENDENCIES
|
33
|
-
bundler (~>
|
33
|
+
bundler (~> 2.2.27)
|
34
34
|
minitest (~> 5.0)
|
35
35
|
natto2classifier!
|
36
36
|
pry
|
37
|
-
rake (~>
|
37
|
+
rake (~> 13.0)
|
38
38
|
|
39
39
|
BUNDLED WITH
|
40
|
-
|
40
|
+
2.2.27
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Natto2classifier
|
2
2
|
|
3
|
+
[](https://travis-ci.org/kanayannet/natto2classifier)
|
4
|
+
|
3
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/natto2classifier`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
6
|
|
5
7
|
## Installation
|
@@ -58,7 +60,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
58
60
|
|
59
61
|
## Contributing
|
60
62
|
|
61
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kanayannet/natto2classifier. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
62
64
|
|
63
65
|
## License
|
64
66
|
|
@@ -66,4 +68,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
66
68
|
|
67
69
|
## Code of Conduct
|
68
70
|
|
69
|
-
Everyone interacting in the Natto2classifier project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
71
|
+
Everyone interacting in the Natto2classifier project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kanayannet/natto2classifier/blob/master/CODE_OF_CONDUCT.md).
|
@@ -4,10 +4,13 @@ require 'natto'
|
|
4
4
|
module Natto2classifier
|
5
5
|
class Natto
|
6
6
|
def self.parse(word)
|
7
|
-
nm = ::Natto::MeCab.new
|
7
|
+
nm = ::Natto::MeCab.new
|
8
8
|
results = []
|
9
|
-
nm.
|
10
|
-
|
9
|
+
nm.parse(word.to_s) do |n|
|
10
|
+
break if n.is_eos?
|
11
|
+
kana = n.feature.split(',')[7]
|
12
|
+
results << n.surface
|
13
|
+
results << kana if !kana.nil? && kana != '*'
|
11
14
|
end
|
12
15
|
results
|
13
16
|
end
|
data/natto2classifier.gemspec
CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "~>
|
25
|
-
spec.add_development_dependency "rake", "~>
|
24
|
+
spec.add_development_dependency "bundler", "~> 2.2.27"
|
25
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
26
26
|
spec.add_development_dependency "minitest", "~> 5.0"
|
27
27
|
spec.add_development_dependency "pry"
|
28
28
|
spec.add_runtime_dependency "natto"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: natto2classifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kanayannet
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.27
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.27
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,7 +139,7 @@ homepage: https://github.com/kanayannet/natto2classifier
|
|
139
139
|
licenses:
|
140
140
|
- MIT
|
141
141
|
metadata: {}
|
142
|
-
post_install_message:
|
142
|
+
post_install_message:
|
143
143
|
rdoc_options: []
|
144
144
|
require_paths:
|
145
145
|
- lib
|
@@ -154,9 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
|
158
|
-
|
159
|
-
signing_key:
|
157
|
+
rubygems_version: 3.0.3
|
158
|
+
signing_key:
|
160
159
|
specification_version: 4
|
161
160
|
summary: It is a library that classifies Japanese language.
|
162
161
|
test_files: []
|