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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5fde42f32c813d698abeb3325616a08c3af7abda
4
- data.tar.gz: a0ace0ab3a4ccdb9ab230122df2b69b8a4239163
2
+ SHA256:
3
+ metadata.gz: 747d5b6779c3ccb5d91320b807f30b48220d61c299286fa82b354bd3474b537c
4
+ data.tar.gz: 51055a4f0eda8aff31dd20fa5957226a1a3ab8f0562b55c141894f39321e594f
5
5
  SHA512:
6
- metadata.gz: d76d73ce2b92be949f7d68ac8ca46fcdc83893e1c4e0651dfa2e39d9b74a2608cc3321a2b6b60bee60d7697c1ba36ff3dcc15a5e93308175387d31ca055217e1
7
- data.tar.gz: 7c1fda7956de7d8dce50dc3793cbc673c1c947150f388b63c3c83d2de786c5bd76462758398ea71ff7fcf597c15c3bed633e048e1d04fde19eef0e4d6d088c18
6
+ metadata.gz: cc34928d4158803ca746c8d3ab59c36fb496ba85c655404603d292691aa8611215ceb691ccefe6d301d4adfee65fae0aaaf9bebdf013a65a91ebacbfeaf1b1b5
7
+ data.tar.gz: 49d9d8afbdae68c3a5d294cc4d3aa94387cfeb66d575333a72382dc5d1b74fed90afb883d8c2684031ec49fd1e2f0525dacb8e161f004ae66622c6d290067b6b
data/.circleci/config.yml CHANGED
@@ -5,6 +5,7 @@ jobs:
5
5
  - image: kanayannet/natto2classifier:latest
6
6
  steps:
7
7
  - checkout
8
+ - run: echo 'run test'
8
9
  - run: bundle install
9
10
  - run: bundle exec ruby test/natto2classifier_test.rb
10
11
  workflows:
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: gem install bundler -v 1.16.1
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.1)
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.2)
14
+ coderay (1.1.3)
15
15
  fast-stemmer (1.0.2)
16
- ffi (1.9.23)
16
+ ffi (1.15.4)
17
17
  gsl (2.1.0.3)
18
- method_source (0.9.0)
19
- minitest (5.11.3)
20
- natto (1.1.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.11.3)
23
- coderay (~> 1.1.0)
24
- method_source (~> 0.9.0)
25
- rake (10.5.0)
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
- ruby
30
+ x86_64-darwin-19
31
31
 
32
32
  DEPENDENCIES
33
- bundler (~> 1.16)
33
+ bundler (~> 2.2.27)
34
34
  minitest (~> 5.0)
35
35
  natto2classifier!
36
36
  pry
37
- rake (~> 10.0)
37
+ rake (~> 13.0)
38
38
 
39
39
  BUNDLED WITH
40
- 1.16.1
40
+ 2.2.27
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Natto2classifier
2
2
 
3
+ [![Build Status](https://travis-ci.org/kanayannet/natto2classifier.svg?branch=master)](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/[USERNAME]/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.
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/[USERNAME]/natto2classifier/blob/master/CODE_OF_CONDUCT.md).
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('-F%m\s%f[7]')
7
+ nm = ::Natto::MeCab.new
8
8
  results = []
9
- nm.enum_parse(word.to_s).each do |n|
10
- results << n.feature if !n.is_eos?
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
@@ -1,3 +1,3 @@
1
1
  module Natto2classifier
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -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", "~> 1.16"
25
- spec.add_development_dependency "rake", "~> 10.0"
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.1
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: 2018-05-01 00:00:00.000000000 Z
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: '1.16'
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: '1.16'
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: '10.0'
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: '10.0'
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
- rubyforge_project:
158
- rubygems_version: 2.6.14
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: []