natto2classifier 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -2
- data/lib/natto2classifier/version.rb +1 -1
- data/lib/natto2classifier.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f933e506e593fedf2eeb3c43e73c3de5fe39d84b
|
4
|
+
data.tar.gz: 6406772efd4fdba35779207d791d0a9c6e257092
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cecd63071da50fbc05b970aa730fcdeb1cb65fbd7a34ddd1e0834f1d845cd7c7fe0216626c504406878c6b9391d44f2be748c5864482babdc000a05d8f9f74a6
|
7
|
+
data.tar.gz: 9b12fd6dde86b47fb731f41112b7990cd74dc641ecffaf096c976b4b6dd967f60e433d1a0c53c70e68c1b114b991ffdceee0ccf32b1b325d5fdbeeb1b3e77eec
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
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
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
data/lib/natto2classifier.rb
CHANGED
@@ -5,12 +5,16 @@ require 'classifier-reborn'
|
|
5
5
|
module Natto2classifier
|
6
6
|
# It is a library that classifies Japanese language.
|
7
7
|
class Bayes < ClassifierReborn::Bayes
|
8
|
+
alias_method :__train__, :train
|
9
|
+
alias_method :__classify__, :classify
|
10
|
+
private :__train__, :__classify__
|
11
|
+
|
8
12
|
def train(category, word)
|
9
|
-
|
13
|
+
__train__ category, Natto2classifier::Natto.parse(word).join(' ')
|
10
14
|
end
|
11
15
|
|
12
16
|
def classify(word)
|
13
|
-
|
17
|
+
__classify__ Natto2classifier::Natto.parse(word).join(' ')
|
14
18
|
end
|
15
19
|
end
|
16
20
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kanayannet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|