natto2classifier 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fde42f32c813d698abeb3325616a08c3af7abda
4
- data.tar.gz: a0ace0ab3a4ccdb9ab230122df2b69b8a4239163
3
+ metadata.gz: eaa514ae1b94d1dcc0b9c7447ad810f6fbf423ca
4
+ data.tar.gz: 2c7723924be08e45e09bdd8dc98196008fc9a0c4
5
5
  SHA512:
6
- metadata.gz: d76d73ce2b92be949f7d68ac8ca46fcdc83893e1c4e0651dfa2e39d9b74a2608cc3321a2b6b60bee60d7697c1ba36ff3dcc15a5e93308175387d31ca055217e1
7
- data.tar.gz: 7c1fda7956de7d8dce50dc3793cbc673c1c947150f388b63c3c83d2de786c5bd76462758398ea71ff7fcf597c15c3bed633e048e1d04fde19eef0e4d6d088c18
6
+ metadata.gz: 82d279d860e9f99ec196165895e08c0042aecf19363e5f21a5ce40ae8c2bbbe1976a638e058e0d02bae75b34dc4042b8c5a0d78ac293c8797567211c3fb83b26
7
+ data.tar.gz: f5cc0675543899e842ff5f3fc22cf5f207c0c871eb8cd9e6e4d4d5d809a874facd0010f4ec465b1ebb075699d528517a8d691717b098fd72f226acab593ed6ab
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.2)
5
5
  classifier-reborn
6
6
  natto
7
7
  rb-gsl
@@ -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.2"
3
3
  end
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kanayannet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler