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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e146febadab62129fe1bf3d1a896824cb2cbcf27
4
- data.tar.gz: 3c2907b019c2fd8197e5c2dc7ae736f12dcb1073
3
+ metadata.gz: 06e203e211932c3eb65555f5e21ba22903bff1bf
4
+ data.tar.gz: f1eb4beb06009731c90147724eb3f5990c75b0ab
5
5
  SHA512:
6
- metadata.gz: 96553f5792b2343b82a8141bc798501dae41f8a0d9769b7c575504d0279a06c62c75cfac5fae87d2356b8606e2ebe88085ef13fb3bec8bdba1d3a0d9b847e7cf
7
- data.tar.gz: 65337c8383989d938359261b11f249a041a3afbc3001f4d0b4ea53ab354fca4ae3907a5478a286a8abca7d87f67644ffee806338664f467ea8969d7130e379d2
6
+ metadata.gz: 69e8d9a4d9dd5d15d279eea5104004ee1cf65aa72b339b142f4babe717c260cedd67f640234ecf65a6f50e4f598ef08d169c66f7d65df2f416d8ba0c7196c53e
7
+ data.tar.gz: 74c0a01d3feb5648735e6a5620c3b71afb4360f0c2a3ffa94636c40f227b89889eb8ad687e6853c36cbe90c61552e8ffc82280ba492d5b760b5200857d6e8419
@@ -1,5 +1,5 @@
1
1
  module LLT
2
2
  class FormBuilder
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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
@@ -16,9 +16,18 @@ module LLT
16
16
  end
17
17
 
18
18
  def third_decl_with_possible_ne_abl?
19
- if @inflection_class == 3
19
+ case @inflection_class
20
+ when 3
20
21
  @nom.match(/[id]?on?$/) && @stem.match(/d?in$|i?on$/) ||
21
- @nom.match(/men$/) && @stem.match(/min$/)
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
@@ -42,6 +42,10 @@ module LLT
42
42
  block_given? ? yield : false
43
43
  end
44
44
 
45
+ def third_decl_with_possible_ve_abl?
46
+ block_given? ? yield : false
47
+ end
48
+
45
49
  def o_decl_with_possible_ne_voc?
46
50
  block_given? ? yield : false
47
51
  end
@@ -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
- it "does what it should" do
7
- stem = ns.new(:noun, { nom: "ratio", stem: "ration", inflection_class: 3 })
8
- stem.third_decl_with_possible_ne_abl?.should be_true
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
- stem = ns.new(:noun, { nom: "miles", stem: "milit", inflection_class: 3 })
11
- stem.third_decl_with_possible_ne_abl?.should be_false
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llt-form_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - LFDM