ikku 0.1.1 → 0.1.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: 0fad5f8882e7062dc3e4cdd954a07a07c332a86d
4
- data.tar.gz: 886dfe82a320a73477f9dfff09717823e7c80cda
3
+ metadata.gz: 35d7cad5cfe61dfda39ba6567212579890d1c563
4
+ data.tar.gz: d7cafd5b2e597c4afec2a551008f99bb6759e857
5
5
  SHA512:
6
- metadata.gz: 2a1bf91e575a441add860f54a169fc4b8e8831561ade68488e9fb0535326c7005b31ba6f0c14a934dce8e9595d7a43c17cf85709d75a5e627825a3e896e979db
7
- data.tar.gz: cee5602f834f94b46077e570ec3788353e7c88b6b6bbe023938d26a5fd4f6951f9e0ba92a4ae01aa5276cc8b29629fae3f5ee5d3a9739be9afd5a8540c07ddb3
6
+ metadata.gz: c481b9f2715cc245851ae632ad516fcc605dc741303e2500ce1bdf8218b3b3d154f5fa90e58ae69a4dec484a76e8bf8189adb119eedb042025e0f2262f6ef1d9
7
+ data.tar.gz: adb112fa8c71523c58cbdcf26802b60ea0023a252cfb6b8e3119e3a7249fb9abb988412341e6b2039226a7b0a292cd45b59a527308dfd9271da5afe4898da271
@@ -1,3 +1,7 @@
1
+ ## 0.1.2
2
+ - Don't allow song ending with サ変・スル in 連用形 (-し)
3
+ - Don't allow song ending with 動詞 in 仮定形
4
+
1
5
  ## 0.1.1
2
6
  - Fix bracket bug
3
7
 
@@ -9,7 +13,7 @@
9
13
  - Don't allow ikku ending with 連用タ接続
10
14
 
11
15
  ## 0.0.8
12
- - Don't allow ikku starting with no pronounciation length node
16
+ - Don't allow ikku starting with no pronunciation length node
13
17
 
14
18
  ## 0.0.7
15
19
  - Don't allow phrase ending with 接頭辞
data/README.md CHANGED
@@ -42,7 +42,7 @@ reviewer.search("ああ古池や蛙飛び込む水の音ああ天秤や京江戸
42
42
  ```
43
43
 
44
44
  ### Ikku::Song#phrases
45
- Returns an Array of phrases of `Ikku::Node`.
45
+ Return an Array of phrases of `Ikku::Node`.
46
46
 
47
47
  ```rb
48
48
  song.phrases #=> [["古池", "や"], ["蛙", "飛び込む"], ["水", "の", "音"]]
@@ -74,6 +74,10 @@ module Ikku
74
74
  false
75
75
  when conjugation2 == "連用タ接続"
76
76
  false
77
+ when conjugation1 == "サ変・スル" && conjugation2 == "連用形"
78
+ false
79
+ when type == "動詞" && conjugation2 == "仮定形"
80
+ false
77
81
  else
78
82
  true
79
83
  end
@@ -87,23 +91,23 @@ module Ikku
87
91
  stat == STAT_ID_FOR_NORMAL
88
92
  end
89
93
 
90
- def pronounciation
94
+ def pronunciation
91
95
  feature[8]
92
96
  end
93
97
 
94
- def pronounciation_length
95
- @pronounciation_length ||= begin
96
- if pronounciation
97
- pronounciation_mora.length
98
+ def pronunciation_length
99
+ @pronunciation_length ||= begin
100
+ if pronunciation
101
+ pronunciation_mora.length
98
102
  else
99
103
  0
100
104
  end
101
105
  end
102
106
  end
103
107
 
104
- def pronounciation_mora
105
- if pronounciation
106
- pronounciation.tr("ぁ-ゔ","ァ-ヴ").gsub(/[^アイウエオカ-モヤユヨラ-ロワヲンヴー]/, "")
108
+ def pronunciation_mora
109
+ if pronunciation
110
+ pronunciation.tr("ぁ-ゔ","ァ-ヴ").gsub(/[^アイウエオカ-モヤユヨラ-ロワヲンヴー]/, "")
107
111
  end
108
112
  end
109
113
 
@@ -9,7 +9,7 @@ module Ikku
9
9
  @rule = rule
10
10
  end
11
11
 
12
- # @note Pronounciation count
12
+ # @note Pronunciation count
13
13
  def count
14
14
  @count ||= 0
15
15
  end
@@ -33,18 +33,18 @@ module Ikku
33
33
 
34
34
  def consume(node)
35
35
  case
36
- when node.pronounciation_length > max_consumable_length
36
+ when node.pronunciation_length > max_consumable_length
37
37
  false
38
38
  when !node.element_of_ikku?
39
39
  false
40
40
  when first_of_phrase? && !node.first_of_phrase?
41
41
  false
42
- when node.pronounciation_length == max_consumable_length && !node.last_of_phrase?
42
+ when node.pronunciation_length == max_consumable_length && !node.last_of_phrase?
43
43
  false
44
44
  else
45
45
  phrases[phrase_index] ||= []
46
46
  phrases[phrase_index] << node
47
- self.count += node.pronounciation_length
47
+ self.count += node.pronunciation_length
48
48
  true
49
49
  end
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module Ikku
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -45,6 +45,14 @@ RSpec.describe Ikku::Reviewer do
45
45
 
46
46
  it { is_expected.to be_nil }
47
47
  end
48
+
49
+ context "with song ending with 仮定形" do
50
+ let(:text) do
51
+ "その人に金をあげたい人がいれば"
52
+ end
53
+
54
+ it { is_expected.to be_nil }
55
+ end
48
56
  end
49
57
 
50
58
  describe "#judge" do
@@ -147,6 +155,14 @@ RSpec.describe Ikku::Reviewer do
147
155
 
148
156
  it { is_expected.to be true }
149
157
  end
158
+
159
+ context "with song ending with サ変・スル in 連用形 (-し)" do
160
+ let(:text) do
161
+ "炊きつけて画面眺めて満足し"
162
+ end
163
+
164
+ it { is_expected.to be false }
165
+ end
150
166
  end
151
167
 
152
168
  describe "#search" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ikku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-19 00:00:00.000000000 Z
11
+ date: 2015-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: natto