katsuyoujin 0.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +674 -0
- data/README.md +3 -0
- data/Rakefile +4 -0
- data/katsuyoujin.gemspec +26 -0
- data/lib/katsuyoujin.rb +22 -0
- data/lib/katsuyoujin/analyzer.rb +44 -0
- data/lib/katsuyoujin/base.rb +37 -0
- data/lib/katsuyoujin/verb.rb +31 -0
- data/lib/katsuyoujin/version.rb +3 -0
- data/rules/godan/base.yml +70 -0
- data/rules/godan/conjugations.yml +30 -0
- data/rules/godan/iru_eru.yml +86 -0
- data/rules/ichidan/base.yml +7 -0
- data/rules/ichidan/conjugations.yml +30 -0
- data/spec/fixtures/conjugations.yml +150 -0
- data/spec/fixtures/godan/base.yml +72 -0
- data/spec/fixtures/ichidan/base.yml +24 -0
- data/spec/lib/base_spec.rb +15 -0
- data/spec/lib/conjugations_spec.rb +40 -0
- data/spec/spec_helper.rb +9 -0
- metadata +131 -0
@@ -0,0 +1,72 @@
|
|
1
|
+
"話す":
|
2
|
+
"あ": "はなさ"
|
3
|
+
"い": "はなし"
|
4
|
+
"う": "はなす"
|
5
|
+
"え": "はなせ"
|
6
|
+
"お": "はなそう"
|
7
|
+
"て": "はなして"
|
8
|
+
"た": "はなした"
|
9
|
+
"歩く":
|
10
|
+
"あ": "あるか"
|
11
|
+
"い": "あるき"
|
12
|
+
"う": "あるく"
|
13
|
+
"え": "あるけ"
|
14
|
+
"お": "あるこう"
|
15
|
+
"て": "あるいて"
|
16
|
+
"た": "あるいた"
|
17
|
+
"泳ぐ":
|
18
|
+
"あ": "およが"
|
19
|
+
"い": "およぎ"
|
20
|
+
"う": "およぐ"
|
21
|
+
"え": "およげ"
|
22
|
+
"お": "およごう"
|
23
|
+
"て": "およいで"
|
24
|
+
"た": "およいだ"
|
25
|
+
"呼ぶ":
|
26
|
+
"あ": "よば"
|
27
|
+
"い": "よび"
|
28
|
+
"う": "よぶ"
|
29
|
+
"え": "よべ"
|
30
|
+
"お": "よぼう"
|
31
|
+
"て": "よんで"
|
32
|
+
"た": "よんだ"
|
33
|
+
"のむ":
|
34
|
+
"あ": "のま"
|
35
|
+
"い": "のみ"
|
36
|
+
"う": "のむ"
|
37
|
+
"え": "のめ"
|
38
|
+
"お": "のもう"
|
39
|
+
"て": "のんで"
|
40
|
+
"た": "のんだ"
|
41
|
+
"死ぬ":
|
42
|
+
"あ": "しな"
|
43
|
+
"い": "しに"
|
44
|
+
"う": "しぬ"
|
45
|
+
"え": "しね"
|
46
|
+
"お": "しのう"
|
47
|
+
"て": "しんで"
|
48
|
+
"た": "しんだ"
|
49
|
+
"作る":
|
50
|
+
"あ": "つくら"
|
51
|
+
"い": "つくり"
|
52
|
+
"う": "つくる"
|
53
|
+
"え": "つくれ"
|
54
|
+
"お": "つくろう"
|
55
|
+
"て": "つくって"
|
56
|
+
"た": "つくった"
|
57
|
+
"待つ":
|
58
|
+
"あ": "また"
|
59
|
+
"い": "まち"
|
60
|
+
"う": "まつ"
|
61
|
+
"え": "まて"
|
62
|
+
"お": "まとう"
|
63
|
+
"て": "まって"
|
64
|
+
"た": "まった"
|
65
|
+
"洗う":
|
66
|
+
"あ": "あらわ"
|
67
|
+
"い": "あらい"
|
68
|
+
"う": "あらう"
|
69
|
+
"え": "あらえ"
|
70
|
+
"お": "あらおう"
|
71
|
+
"て": "あらって"
|
72
|
+
"た": "あらった"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"見る":
|
2
|
+
"あ": "み"
|
3
|
+
"い": "み"
|
4
|
+
"う": "みる"
|
5
|
+
"え": "みれ"
|
6
|
+
"お": "みよう"
|
7
|
+
"て": "みて"
|
8
|
+
"た": "みた"
|
9
|
+
"起きる":
|
10
|
+
"あ": "おき"
|
11
|
+
"い": "おき"
|
12
|
+
"う": "おきる"
|
13
|
+
"え": "おきれ"
|
14
|
+
"お": "おきよう"
|
15
|
+
"て": "おきて"
|
16
|
+
"た": "おきた"
|
17
|
+
"食べる":
|
18
|
+
"あ": "たべ"
|
19
|
+
"い": "たべ"
|
20
|
+
"う": "たべる"
|
21
|
+
"え": "たべれ"
|
22
|
+
"お": "たべよう"
|
23
|
+
"て": "たべて"
|
24
|
+
"た": "たべた"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
describe 'base' do
|
2
|
+
BASE_CATEGORIES.each do |base_category|
|
3
|
+
context "#{base_category} base" do
|
4
|
+
['ichidan', 'godan'].each do |verb_category|
|
5
|
+
BASES[verb_category].each do |word, bases|
|
6
|
+
it "knows the #{base_category} base of #{word} (#{verb_category})" do
|
7
|
+
verb = Katsuyoujin::Verb.new word
|
8
|
+
base = Katsuyoujin::Base.new(verb, base_category).conjugate(category: verb_category)
|
9
|
+
expect(bases[base_category]).to eq(base)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
describe 'conjugations' do
|
2
|
+
['nonpast_indicative', 'past_indicative'].each do |category|
|
3
|
+
context category do
|
4
|
+
context 'casual' do
|
5
|
+
context 'affirmative' do
|
6
|
+
CONJUGATIONS.each do |verb, conjugations|
|
7
|
+
it "knows the #{category} casual affirmative conjugation of #{verb}" do
|
8
|
+
expect(Katsuyoujin.conjugate(verb, 'casual', category, 'affirmative')).to eq conjugations['casual'][category]['affirmative']
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
context 'negative' do
|
13
|
+
CONJUGATIONS.each do |verb, conjugations|
|
14
|
+
it "knows the #{category} casual negative conjugation of #{verb}" do
|
15
|
+
expect(Katsuyoujin.conjugate(verb, 'casual', category, 'negative')).to eq conjugations['casual'][category]['negative']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'polite' do
|
22
|
+
context 'affirmative' do
|
23
|
+
CONJUGATIONS.each do |verb, conjugations|
|
24
|
+
it "knows the #{category} polite affirmative conjugation of #{verb}" do
|
25
|
+
expect(Katsuyoujin.conjugate(verb, 'polite', category, 'affirmative')).to eq conjugations['polite'][category]['affirmative']
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
context 'negative' do
|
30
|
+
CONJUGATIONS.each do |verb, conjugations|
|
31
|
+
it "knows the #{category} polite negative conjugation of #{verb}" do
|
32
|
+
expect(Katsuyoujin.conjugate(verb, 'polite', category, 'negative')).to eq conjugations['polite'][category]['negative']
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'katsuyoujin'
|
2
|
+
|
3
|
+
BASE_CATEGORIES = ['あ', 'い', 'う', 'え', 'お', 'て', 'た']
|
4
|
+
ICHIDAN_BASES = YAML.load_file('spec/fixtures/ichidan/base.yml')
|
5
|
+
|
6
|
+
BASES = { 'ichidan' => YAML.load_file('spec/fixtures/ichidan/base.yml'),
|
7
|
+
'godan' => YAML.load_file('spec/fixtures/godan/base.yml') }
|
8
|
+
|
9
|
+
CONJUGATIONS = YAML.load_file('spec/fixtures/conjugations.yml')
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: katsuyoujin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- LuckyThirteen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mojinizer
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: ''
|
70
|
+
email:
|
71
|
+
- baloghzsof@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".ruby-gemset"
|
79
|
+
- ".ruby-version"
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- katsuyoujin.gemspec
|
85
|
+
- lib/katsuyoujin.rb
|
86
|
+
- lib/katsuyoujin/analyzer.rb
|
87
|
+
- lib/katsuyoujin/base.rb
|
88
|
+
- lib/katsuyoujin/verb.rb
|
89
|
+
- lib/katsuyoujin/version.rb
|
90
|
+
- rules/godan/base.yml
|
91
|
+
- rules/godan/conjugations.yml
|
92
|
+
- rules/godan/iru_eru.yml
|
93
|
+
- rules/ichidan/base.yml
|
94
|
+
- rules/ichidan/conjugations.yml
|
95
|
+
- spec/fixtures/conjugations.yml
|
96
|
+
- spec/fixtures/godan/base.yml
|
97
|
+
- spec/fixtures/ichidan/base.yml
|
98
|
+
- spec/lib/base_spec.rb
|
99
|
+
- spec/lib/conjugations_spec.rb
|
100
|
+
- spec/spec_helper.rb
|
101
|
+
homepage: https://github.com/LuckyThirteen/katsuyoujin
|
102
|
+
licenses:
|
103
|
+
- GPLv3
|
104
|
+
metadata: {}
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 2.4.5
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: Japanese verb conjugator.
|
125
|
+
test_files:
|
126
|
+
- spec/fixtures/conjugations.yml
|
127
|
+
- spec/fixtures/godan/base.yml
|
128
|
+
- spec/fixtures/ichidan/base.yml
|
129
|
+
- spec/lib/base_spec.rb
|
130
|
+
- spec/lib/conjugations_spec.rb
|
131
|
+
- spec/spec_helper.rb
|