verbs 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -21,10 +21,38 @@ The gem is hosted at http://gemcutter.org/gems/verbs
21
21
 
22
22
  gem install verbs
23
23
 
24
+ == Tense/aspect quick reference
25
+
26
+ <table>
27
+ <tr>
28
+ <th>Example</th>
29
+ <th>Tense</th>
30
+ <th>Aspect</th>
31
+ </tr>
32
+
33
+ <tr><td>I usually accepted</td><td>past</td><td>habitual</td></tr>
34
+ <tr><td>I had accepted</td><td>past</td><td>perfect</td></tr>
35
+ <tr><td>I accepted</td><td>past</td><td>perfective</td></tr>
36
+ <tr><td>I was accepting</td><td>past</td><td>progressive</td></tr>
37
+ <tr><td>I was about to accept</td><td>past</td><td>prospective</td></tr>
38
+ <tr><td>I accept</td><td>present</td><td>habitual</td></tr>
39
+ <tr><td>I have accepted</td><td>present</td><td>perfect</td></tr>
40
+ <tr><td>I am having accepted</td><td>present</td><td>perfective</td></tr>
41
+ <tr><td>I am accepting</td><td>present</td><td>progressive</td></tr>
42
+ <tr><td>I am about to accept</td><td>present</td><td>prospective</td></tr>
43
+ <tr><td>I will accept</td><td>future</td><td>habitual</td></tr>
44
+ <tr><td>I will have accepted</td><td>future</td><td>perfect</td></tr>
45
+ <tr><td>I will be having accepted future</td><td>perfective</td></tr>
46
+ <tr><td>I will be accepting</td><td>future</td><td>progressive</td></tr>
47
+ <tr><td>I will be about to accept future</td><td>prospective</td></tr>
48
+
49
+ </table>
50
+
24
51
  == Acknowledgements
25
52
 
26
53
  * {Lingua::Conjugate}[http://cpansearch.perl.org/src/RWG/Lingua-EN-Conjugate-0.308/lib/Lingua/EN/Conjugate.pm]
27
54
  * {Pat Byrd and Tom McKlin}[http://www2.gsu.edu/~wwwesl/egw/pluralsv.htm]
55
+ * {Rick Harrison}[http://www.rickharrison.com/language/aspect.html]
28
56
 
29
57
  == Copyright
30
58
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 2.0.0
@@ -35,28 +35,22 @@ module Verbs
35
35
  end
36
36
 
37
37
  def conjugate(infinitive, options = {})
38
- # tense = options[:tense] || :present # present, past, future
39
- # person = options[:person] || :third # first, second, third
40
- # plurality = options[:plurality] || :singular # singular, plural
41
- # diathesis = options[:diathesis] || :active # active, passive
42
- # mood = options[:mood] || :indicative # conditional, imperative, indicative, injunctive, optative, potential, subjunctive
43
- # aspect = options[:aspect] || :habitual # perfective, habitual, progressive, perfect, prospective
38
+ tense = options[:tense] || :present # present, past, future
39
+ person = options[:person] || :third # first, second, third
40
+ plurality = options[:plurality] || :singular # singular, plural
41
+ diathesis = options[:diathesis] || :active # active, passive
42
+ mood = options[:mood] || :indicative # conditional, imperative, indicative, injunctive, optative, potential, subjunctive
43
+ aspect = options[:aspect] || :habitual # perfective, habitual, progressive, perfect, prospective
44
+
45
+ form = form_for(tense, aspect)
46
+
47
+ conjugation = form.map { |e| resolve e, infinitive, tense, person, plurality }.join(' ').strip
44
48
 
45
49
  if actor = options.delete(:subject)
46
50
  actor = subject(options).humanize if actor.is_a?(TrueClass)
47
51
  end
48
52
 
49
- if verb = conjugations.irregulars[infinitive]
50
- conjugation = verb[options] || conjugate_irregular(verb, options)
51
- else
52
- conjugation = conjugate_regular(infinitive, options)
53
- end
54
-
55
- if actor
56
- "#{actor} #{conjugation}"
57
- else
58
- conjugation
59
- end
53
+ "#{actor} #{conjugation}".strip
60
54
  end
61
55
 
62
56
  def subject(options)
@@ -76,29 +70,79 @@ module Verbs
76
70
 
77
71
  private
78
72
 
79
- def conjugate_irregular(verb, options)
80
- tense = options[:tense]
81
- person = options[:person]
82
- plurality = options[:plurality]
83
- if [tense, person, plurality] == [:present, :third, :singular]
84
- present_third_person_singular_form_for verb
85
- elsif tense == :present
86
- verb.infinitive
87
- elsif tense == :past
88
- verb.preterite
73
+ def resolve(element, infinitive, tense, person, plurality)
74
+ case element
75
+ when String
76
+ element
77
+ when :infinitive
78
+ infinitive
79
+ when :present, :past, :present_participle, :past_participle
80
+ inflect infinitive, element, person, plurality
81
+ when Symbol
82
+ inflect element, tense, person, plurality
83
+ end
84
+ end
85
+
86
+ def inflect(infinitive, inflection, person, plurality)
87
+ send(*([inflection, infinitive, person, plurality][0, method(inflection).arity + 1]))
88
+ end
89
+
90
+ def present(infinitive, person, plurality)
91
+ if verb = conjugations.irregulars[infinitive]
92
+ conjugate_irregular(verb, :tense => :present, :person => person, :plurality => plurality)
93
+ elsif person == :third and plurality == :singular
94
+ present_third_person_singular_form_for infinitive
95
+ else
96
+ infinitive
97
+ end
98
+ end
99
+
100
+ def past(infinitive, person, plurality)
101
+ if verb = conjugations.irregulars[infinitive]
102
+ conjugate_irregular(verb, :tense => :past, :person => person, :plurality => plurality)
103
+ else
104
+ regular_preterite_for infinitive
105
+ end
106
+ end
107
+
108
+ def present_participle(infinitive)
109
+ if infinitive.to_s.match(/#{VOWEL_PATTERN}#{CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(infinitive)
110
+ present_participle_with_doubled_terminal_consonant_for verb
111
+ elsif infinitive.to_s.match(/c$/)
112
+ infinitive.to_s.concat('king').to_sym
113
+ elsif infinitive.to_s.match(/ye$/) or infinitive.to_s.match(/oe$/) or infinitive.to_s.match(/nge$/) or infinitive.to_s.match(/ee$/)
114
+ infinitive.to_s.concat('ing').to_sym
115
+ elsif infinitive.to_s.match(/ie$/)
116
+ infinitive.to_s[0..-2].concat('ying').to_sym
117
+ else
118
+ infinitive.to_s[0..-1].concat('ing').to_sym
119
+ end
120
+ end
121
+
122
+ def past_participle(infinitive)
123
+ if verb = conjugations.irregulars[infinitive]
124
+ conjugate_irregular(verb, :tense => :past, :derivative => :participle)
125
+ else
126
+ regular_preterite_for infinitive
89
127
  end
90
128
  end
91
129
 
92
- def conjugate_regular(verb, options)
130
+ def conjugate_irregular(verb, options)
131
+ return verb[options] if verb[options]
132
+
93
133
  tense = options[:tense]
94
134
  person = options[:person]
95
135
  plurality = options[:plurality]
136
+ derivative = options[:derivative]
137
+
96
138
  if [tense, person, plurality] == [:present, :third, :singular]
97
139
  present_third_person_singular_form_for verb
140
+ elsif [tense, derivative] == [:past, :participle]
141
+ verb.past_participle
98
142
  elsif tense == :present
99
- verb
143
+ verb.infinitive
100
144
  elsif tense == :past
101
- regular_preterite_for verb
145
+ verb.preterite
102
146
  end
103
147
  end
104
148
 
@@ -140,5 +184,29 @@ module Verbs
140
184
  regular_preterite_for verb.to_s.concat(verb.to_s[-1,1]).to_sym
141
185
  end
142
186
 
187
+ def present_participle_with_doubled_terminal_consonant_for(verb)
188
+ present_participle verb.to_s.concat(verb.to_s[-1,1]).to_sym
189
+ end
190
+
191
+ def form_for(tense, aspect)
192
+ form = []
193
+ if tense == :future
194
+ form << 'will'
195
+ form << :infinitive if aspect == :habitual
196
+ form.concat ['have', :past_participle] if aspect == :perfect
197
+ form.concat ['be having', :past_participle] if aspect == :perfective
198
+ form.concat ['be', :present_participle] if aspect == :progressive
199
+ form.concat ['be about to', :infinitive] if aspect == :prospective
200
+ else
201
+ form.concat ['usually', :past_participle] if [tense, aspect] == [:past, :habitual]
202
+ form.concat [:have, :past_participle] if aspect == :perfect
203
+ form << :past if [tense, aspect] == [:past, :perfective]
204
+ form.concat [:be, :present_participle] if aspect == :progressive
205
+ form.concat [:be, 'about to', :infinitive] if aspect == :prospective
206
+ form << :present if [tense, aspect] == [:present, :habitual]
207
+ form.concat [:be, 'having', :past_participle] if [tense, aspect] == [:present, :perfective]
208
+ end
209
+ form
210
+ end
143
211
  end
144
212
  end
data/lib/verbs/verb.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Verbs
2
2
  class Verb
3
- attr_reader :infinitive, :preterite
3
+ attr_reader :infinitive, :preterite, :past_participle
4
4
 
5
5
  def initialize(infinitive, options = {}, &blk)
6
6
  @infinitive = infinitive
data/test/test_verbs.rb CHANGED
@@ -2,88 +2,95 @@ require 'helper'
2
2
 
3
3
  class TestVerbs < Test::Unit::TestCase
4
4
  def test_copular_conjugation
5
- assert_equal :am, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :singular)
6
- assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :second, :plurality => :singular)
7
- assert_equal :is, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular)
8
- assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural)
9
- assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :plural)
10
- assert_equal :was, Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :singular)
11
- assert_equal :were, Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :second, :plurality => :singular)
12
- assert_equal :was, Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :singular)
13
- assert_equal :were, Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :plural)
14
- assert_equal :were, Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :plural)
5
+ assert_equal 'am', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
6
+ assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
7
+ assert_equal 'is', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
8
+ assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
9
+ assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
10
+ assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
11
+ assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :second, :plurality => :singular, :aspect => :perfective)
12
+ assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
13
+ assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :plural, :aspect => :perfective)
14
+ assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :plural, :aspect => :perfective)
15
15
  end
16
16
  def test_irregular_conjugation
17
- assert_equal :break, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :singular)
18
- assert_equal :break, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :second, :plurality => :singular)
19
- assert_equal :breaks, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :singular)
20
- assert_equal :break, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :plural)
21
- assert_equal :break, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :plural)
22
- assert_equal :broke, Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular)
23
- assert_equal :broke, Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular)
24
- assert_equal :broke, Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular)
25
- assert_equal :broke, Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular)
26
- assert_equal :broke, Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular)
27
- assert_equal :has, Verbs::Conjugator.conjugate(:have, :tense => :present, :person => :third, :plurality => :singular)
17
+ assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
18
+ assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
19
+ assert_equal 'breaks', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
20
+ assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
21
+ assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
22
+ assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
23
+ assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
24
+ assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
25
+ assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
26
+ assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
27
+ assert_equal 'has', Verbs::Conjugator.conjugate(:have, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
28
28
  end
29
29
  def test_irregular_conjugation_with_terminal_y
30
- assert_equal :flies, Verbs::Conjugator.conjugate(:fly, :tense => :present, :person => :third, :plurality => :singular)
31
- assert_equal :carried, Verbs::Conjugator.conjugate(:carry, :tense => :past, :person => :third, :plurality => :singular)
32
- assert_equal :stayed, Verbs::Conjugator.conjugate(:stay, :tense => :past, :person => :third, :plurality => :singular)
30
+ assert_equal 'flies', Verbs::Conjugator.conjugate(:fly, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
31
+ assert_equal 'carried', Verbs::Conjugator.conjugate(:carry, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
32
+ assert_equal 'stayed', Verbs::Conjugator.conjugate(:stay, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
33
33
  end
34
34
  def test_regular_conjugation
35
- assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :singular)
36
- assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :second, :plurality => :singular)
37
- assert_equal :accepts, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :singular)
38
- assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :plural)
39
- assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :plural)
40
- assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
41
- assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
42
- assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
43
- assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
44
- assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
35
+ assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
36
+ assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
37
+ assert_equal 'accepts', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
38
+ assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
39
+ assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
40
+ assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
41
+ assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
42
+ assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
43
+ assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
44
+ assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
45
45
  end
46
46
  def test_regular_conjugation_with_terminal_single_consonant
47
- assert_equal :shipped, Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular)
48
- assert_equal :shipped, Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular)
49
- assert_equal :shipped, Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular)
50
- assert_equal :shipped, Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular)
51
- assert_equal :shipped, Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular)
47
+ assert_equal 'shipped', Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
52
48
  end
53
49
  def test_regular_conjugation_with_irregular_terminal_consonant
54
- assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
55
- assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
56
- assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
57
- assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
58
- assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
50
+ assert_equal 'abandoned', Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
59
51
  end
60
52
  def test_regular_conjugation_with_terminal_e
61
- assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
62
- assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
63
- assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
64
- assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
65
- assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
53
+ assert_equal 'created', Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
66
54
  end
67
55
  def test_regular_conjugation_with_unusual_terminal_e
68
- assert_equal :dyed, Verbs::Conjugator.conjugate(:dye, :tense => :past, :person => :first, :plurality => :singular)
69
- assert_equal :hoed, Verbs::Conjugator.conjugate(:hoe, :tense => :past, :person => :first, :plurality => :singular)
70
- assert_equal :singed, Verbs::Conjugator.conjugate(:singe, :tense => :past, :person => :first, :plurality => :singular)
71
- assert_equal :tied, Verbs::Conjugator.conjugate(:tie, :tense => :past, :person => :first, :plurality => :singular)
72
- assert_equal :agreed, Verbs::Conjugator.conjugate(:agree, :tense => :past, :person => :first, :plurality => :singular)
56
+ assert_equal 'dyed', Verbs::Conjugator.conjugate(:dye, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
57
+ assert_equal 'hoed', Verbs::Conjugator.conjugate(:hoe, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
58
+ assert_equal 'singed', Verbs::Conjugator.conjugate(:singe, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
59
+ assert_equal 'tied', Verbs::Conjugator.conjugate(:tie, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
60
+ assert_equal 'agreed', Verbs::Conjugator.conjugate(:agree, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
73
61
  end
74
62
  def test_conjugation_with_terminal_sibilance
75
- assert_equal :passes, Verbs::Conjugator.conjugate(:pass, :tense => :present, :person => :third, :plurality => :singular)
76
- assert_equal :buzzes, Verbs::Conjugator.conjugate(:buzz, :tense => :present, :person => :third, :plurality => :singular)
77
- assert_equal :coaxes, Verbs::Conjugator.conjugate(:coax, :tense => :present, :person => :third, :plurality => :singular)
78
- assert_equal :washes, Verbs::Conjugator.conjugate(:wash, :tense => :present, :person => :third, :plurality => :singular)
79
- assert_equal :watches, Verbs::Conjugator.conjugate(:watch, :tense => :present, :person => :third, :plurality => :singular)
63
+ assert_equal 'passes', Verbs::Conjugator.conjugate(:pass, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
64
+ assert_equal 'buzzes', Verbs::Conjugator.conjugate(:buzz, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
65
+ assert_equal 'coaxes', Verbs::Conjugator.conjugate(:coax, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
66
+ assert_equal 'washes', Verbs::Conjugator.conjugate(:wash, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
67
+ assert_equal 'watches', Verbs::Conjugator.conjugate(:watch, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
80
68
  end
81
69
  def test_conjugation_with_subject
82
- assert_equal 'Matz is', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular, :subject => 'Matz')
83
- assert_equal 'We are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :subject => true)
70
+ assert_equal 'Matz is', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular, :subject => 'Matz', :aspect => :habitual)
71
+ assert_equal 'We are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :subject => true, :aspect => :habitual)
84
72
  end
85
73
  def test_core_access
86
- assert_equal :accepts, :accept.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular)
87
- assert_equal 'accepts', 'accept'.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular)
74
+ assert_equal :accepts, :accept.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
75
+ assert_equal 'accepts', 'accept'.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
76
+ end
77
+ def test_aspects
78
+ Verbs::Conjugator.with_options :person => :first, :plurality => :singular, :subject => true do |standard|
79
+ assert_equal 'I usually accepted', standard.conjugate(:accept, :tense => :past, :aspect => :habitual)
80
+ assert_equal 'I had accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfect)
81
+ assert_equal 'I accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfective)
82
+ assert_equal 'I was accepting', standard.conjugate(:accept, :tense => :past, :aspect => :progressive)
83
+ assert_equal 'I was about to accept', standard.conjugate(:accept, :tense => :past, :aspect => :prospective)
84
+ assert_equal 'I accept', standard.conjugate(:accept, :tense => :present, :aspect => :habitual)
85
+ assert_equal 'I have accepted', standard.conjugate(:accept, :tense => :present, :aspect => :perfect)
86
+ assert_equal 'I am having accepted', standard.conjugate(:accept, :tense => :present, :aspect => :perfective)
87
+ assert_equal 'I am accepting', standard.conjugate(:accept, :tense => :present, :aspect => :progressive)
88
+ assert_equal 'I am about to accept', standard.conjugate(:accept, :tense => :present, :aspect => :prospective)
89
+ assert_equal 'I will accept', standard.conjugate(:accept, :tense => :future, :aspect => :habitual)
90
+ assert_equal 'I will have accepted', standard.conjugate(:accept, :tense => :future, :aspect => :perfect)
91
+ assert_equal 'I will be having accepted', standard.conjugate(:accept, :tense => :future, :aspect => :perfective)
92
+ assert_equal 'I will be accepting', standard.conjugate(:accept, :tense => :future, :aspect => :progressive)
93
+ assert_equal 'I will be about to accept', standard.conjugate(:accept, :tense => :future, :aspect => :prospective)
94
+ end
88
95
  end
89
96
  end
data/verbs.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{verbs}
8
- s.version = "1.1.2"
8
+ s.version = "2.0.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andy Rossmeissl"]
12
- s.date = %q{2009-12-07}
12
+ s.date = %q{2009-12-09}
13
13
  s.description = %q{Conjugates most common english verbs for all persons in present and past tense (active diathesis, indicative mood). Standard and exceptional spelling rules are obeyed.}
14
14
  s.email = %q{andy@rossmeissl.net}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Rossmeissl
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-07 00:00:00 -05:00
12
+ date: 2009-12-09 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15