llt-form_builder 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/llt/form_builder/version.rb +1 -1
- data/lib/llt/stem/noun_pack.rb +4 -0
- data/lib/llt/stem/noun_stem.rb +11 -2
- data/lib/llt/stem/pack.rb +4 -0
- data/spec/lib/llt/stem/noun_stem_spec.rb +42 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e203e211932c3eb65555f5e21ba22903bff1bf
|
4
|
+
data.tar.gz: f1eb4beb06009731c90147724eb3f5990c75b0ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69e8d9a4d9dd5d15d279eea5104004ee1cf65aa72b339b142f4babe717c260cedd67f640234ecf65a6f50e4f598ef08d169c66f7d65df2f416d8ba0c7196c53e
|
7
|
+
data.tar.gz: 74c0a01d3feb5648735e6a5620c3b71afb4360f0c2a3ffa94636c40f227b89889eb8ad687e6853c36cbe90c61552e8ffc82280ba492d5b760b5200857d6e8419
|
data/lib/llt/stem/noun_pack.rb
CHANGED
@@ -10,6 +10,10 @@ module LLT
|
|
10
10
|
super { @stems.any?(&:third_decl_with_possible_ne_abl?) }
|
11
11
|
end
|
12
12
|
|
13
|
+
def third_decl_with_possible_ve_abl?
|
14
|
+
super { @stems.any?(&:third_decl_with_possible_ve_abl?) }
|
15
|
+
end
|
16
|
+
|
13
17
|
def o_decl_with_possible_ne_voc?
|
14
18
|
super { @stems.any?(&:o_decl_with_possible_ne_voc?) }
|
15
19
|
end
|
data/lib/llt/stem/noun_stem.rb
CHANGED
@@ -16,9 +16,18 @@ module LLT
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def third_decl_with_possible_ne_abl?
|
19
|
-
|
19
|
+
case @inflection_class
|
20
|
+
when 3
|
20
21
|
@nom.match(/[id]?on?$/) && @stem.match(/d?in$|i?on$/) ||
|
21
|
-
|
22
|
+
@nom.match(/men$/) && @stem.match(/min$/)
|
23
|
+
when 33
|
24
|
+
@nom.match(/nis$/) && @stem.match(/n$/)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def third_decl_with_possible_ve_abl?
|
29
|
+
if @inflection_class == 33
|
30
|
+
@nom.match(/vis$/) && @stem.match(/v$/)
|
22
31
|
end
|
23
32
|
end
|
24
33
|
|
data/lib/llt/stem/pack.rb
CHANGED
@@ -3,12 +3,33 @@ require 'spec_helper'
|
|
3
3
|
describe LLT::Stem::NounStem do
|
4
4
|
let(:ns) { LLT::Stem::NounStem }
|
5
5
|
describe "#third_decl_with_possible_ne_abl?" do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
context "matches correctly" do
|
7
|
+
it "with words like ratio" do
|
8
|
+
stem = ns.new(:noun, { nom: "ratio", stem: "ration", inflection_class: 3 })
|
9
|
+
stem.third_decl_with_possible_ne_abl?.should be_true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "with words like multitudo" do
|
13
|
+
stem = ns.new(:noun, { nom: "multitudo", stem: "multitudin", inflection_class: 3 })
|
14
|
+
stem.third_decl_with_possible_ne_abl?.should be_true
|
15
|
+
end
|
16
|
+
|
17
|
+
it "with words like Cicero" do
|
18
|
+
stem = ns.new(:noun, { nom: "Cicero", stem: "Ciceron", inflection_class: 3 })
|
19
|
+
stem.third_decl_with_possible_ne_abl?.should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "with words like finis" do
|
23
|
+
stem = ns.new(:noun, { nom: "finis", stem: "fin", inflection_class: 33 })
|
24
|
+
stem.third_decl_with_possible_ne_abl?.should be_true
|
25
|
+
end
|
26
|
+
end
|
9
27
|
|
10
|
-
|
11
|
-
|
28
|
+
context "doesn't produce false positives" do
|
29
|
+
it "for other third declension nouns" do
|
30
|
+
stem = ns.new(:noun, { nom: "miles", stem: "milit", inflection_class: 3 })
|
31
|
+
stem.third_decl_with_possible_ne_abl?.should be_false
|
32
|
+
end
|
12
33
|
end
|
13
34
|
end
|
14
35
|
|
@@ -21,4 +42,20 @@ describe LLT::Stem::NounStem do
|
|
21
42
|
stem.o_decl_with_possible_ne_voc?.should be_false
|
22
43
|
end
|
23
44
|
end
|
45
|
+
|
46
|
+
describe "#third_decl_with_possible_ve_abl?" do
|
47
|
+
context "matches correctly" do
|
48
|
+
it "with civis" do
|
49
|
+
stem = ns.new(:noun, { nom: "civis", stem: "civ", inflection_class: 33 })
|
50
|
+
stem.third_decl_with_possible_ve_abl?.should be_true
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "doesn't produce false positives" do
|
55
|
+
it "for other third declension nouns" do
|
56
|
+
stem = ns.new(:noun, { nom: "finis", stem: "fin", inflection_class: 33 })
|
57
|
+
stem.third_decl_with_possible_ve_abl?.should be_false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
24
61
|
end
|