verbs 2.3.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/verbs/conjugator.rb +11 -7
- data/lib/verbs/version.rb +1 -1
- data/test/test_verbs.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e723eb9d358a2b674c497f70192e6172ba18d20fa472e588e38adcbf9f318a54
|
4
|
+
data.tar.gz: 8f88abec47d56529a4ec23c1b45b58d940fc1b7c6b6ceaf3f86d46b75c3591a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708d985dffabeee18e46906f1e976dc988a92c85e12db77a04f0319b0f73f8e25c03d884fee19393b4909160c8a631abc12dfcdbef80c739217e67cfb1becf5c
|
7
|
+
data.tar.gz: 64cab548cb88b306788ac88f05ee26628cbd60c72d7b7a9987b54ab988b03ca24782fb84870917ee06c6790abefea4a1029e6fdb8f0710a9f27dd2a9f9b464d9
|
data/README.rdoc
CHANGED
@@ -31,7 +31,7 @@ Either <tt>:singular</tt> or <tt>:plural</tt>. Defaults to <tt>:singular</tt>.
|
|
31
31
|
|
32
32
|
=== <tt>:aspect</tt>
|
33
33
|
|
34
|
-
One of <tt>:habitual</tt>, <tt>:perfect</tt>, <tt>:perfective</tt>, <tt>:progressive</tt>, or <tt>:prospective</tt>. Defaults to <tt>:habitual</tt
|
34
|
+
One of <tt>:habitual</tt>, <tt>:perfect</tt>, <tt>:perfective</tt>, <tt>:progressive</tt>, or <tt>:prospective</tt>. Defaults to <tt>:habitual</tt> (<tt>:perfective</tt> for past tense).
|
35
35
|
|
36
36
|
See below for a guide to verb aspect.
|
37
37
|
|
data/lib/verbs/conjugator.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# The program conjugates most common english verbs with the following option:
|
2
|
-
# * :tense => :past or :present or :future
|
3
|
-
# * :person => :first or :second or :third
|
4
|
-
# * :plurality => :singular or :plural
|
5
|
-
# * :aspect => :habitual or :perfect or :perfective or :progressive or :prospective
|
6
|
-
# * :mood => :indicative or :imperative or :subjunctive
|
7
|
-
#
|
2
|
+
# * :tense => :past or :present or :future (default: :present)
|
3
|
+
# * :person => :first or :second or :third (default: :third)
|
4
|
+
# * :plurality => :singular or :plural (default: :singular)
|
5
|
+
# * :aspect => :habitual or :perfect or :perfective or :progressive or :prospective (default: :habitual, or :perfective for past tense)
|
6
|
+
# * :mood => :indicative or :imperative or :subjunctive (default: :indicative)
|
7
|
+
# * :diathesis => :active or :passive (default: :active)
|
8
8
|
#
|
9
9
|
# Author:: Andy Rossmeissl
|
10
10
|
# Copyright:: Copyright (c) 2009 Andy Rossmeissl
|
@@ -77,7 +77,7 @@ module Verbs
|
|
77
77
|
plurality = options[:plurality] || :singular # singular, plural
|
78
78
|
diathesis = options[:diathesis] || :active # active, passive
|
79
79
|
mood = options[:mood] || :indicative # imperative, subjunctive
|
80
|
-
aspect = options[:aspect] ||
|
80
|
+
aspect = options[:aspect] || default_aspect(options) # perfective, habitual, progressive, perfect, prospective
|
81
81
|
|
82
82
|
check_for_improper_constructions(infinitive, tense, person, mood, diathesis) # find incompatabilities
|
83
83
|
form = form_for(tense, aspect, diathesis) # find form array based on tense and aspect
|
@@ -328,5 +328,9 @@ module Verbs
|
|
328
328
|
raise Verbs::ImproperConstruction, 'There is no passive diathesis for the copula'
|
329
329
|
end
|
330
330
|
end
|
331
|
+
|
332
|
+
def default_aspect(options)
|
333
|
+
options[:tense] == :past ? :perfective : :habitual
|
334
|
+
end
|
331
335
|
end
|
332
336
|
end
|
data/lib/verbs/version.rb
CHANGED
data/test/test_verbs.rb
CHANGED
@@ -9,6 +9,9 @@ class TestVerbs < Test::Unit::TestCase
|
|
9
9
|
assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
|
10
10
|
assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
|
11
11
|
|
12
|
+
# past
|
13
|
+
assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past)
|
14
|
+
|
12
15
|
# past habitual
|
13
16
|
assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :singular, :aspect => :habitual)
|
14
17
|
assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :second, :plurality => :singular, :aspect => :habitual)
|
@@ -40,6 +43,7 @@ class TestVerbs < Test::Unit::TestCase
|
|
40
43
|
assert_equal 'has', Verbs::Conjugator.conjugate(:have, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
41
44
|
end
|
42
45
|
def test_know
|
46
|
+
assert_equal 'knew', Verbs::Conjugator.conjugate(:know, :tense => :past)
|
43
47
|
assert_equal 'had known', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfect)
|
44
48
|
assert_equal 'knew', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
|
45
49
|
assert_equal 'was knowing', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :progressive)
|
@@ -113,7 +117,7 @@ class TestVerbs < Test::Unit::TestCase
|
|
113
117
|
end
|
114
118
|
def test_aspects
|
115
119
|
Verbs::Conjugator.with_options :person => :first, :plurality => :singular, :subject => true do |standard|
|
116
|
-
assert_equal 'I used to accept',
|
120
|
+
assert_equal 'I used to accept', standard.conjugate(:accept, :tense => :past, :aspect => :habitual)
|
117
121
|
assert_equal 'I had accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfect)
|
118
122
|
assert_equal 'I accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfective)
|
119
123
|
assert_equal 'I was accepting', standard.conjugate(:accept, :tense => :past, :aspect => :progressive)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: verbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Rossmeissl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|