verbs 2.1.0 → 2.2.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 +7 -0
- data/README.rdoc +2 -3
- data/lib/verbs.rb +1 -1
- data/lib/verbs/conjugations.rb +11 -5
- data/lib/verbs/conjugator.rb +21 -23
- data/lib/verbs/verblike.rb +32 -32
- data/lib/verbs/version.rb +3 -3
- data/test/test_verbs.rb +39 -0
- data/verbs.gemspec +25 -23
- metadata +75 -69
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1f3cb83b9097ea8bf2c6535df39c6bec057723e6ba9d9656fea24d07c408669d
|
4
|
+
data.tar.gz: 843f283457646d40e231aca31596583bf6d6de0aa010475fbc69646b08e4f4f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce1045dc949010c62482dc97a5d65964d12779a772855cac9fe504cc7e26b9e735281934926b13306f43dc843cba58bae7088b2548a7211b7416756471d8fdf8
|
7
|
+
data.tar.gz: 8dc5fb226b59469fb5264210dcc88ed7dad49ed568f02b603299ee8cd0815a161512860a8b4315cd81c9ecea6a918238bc3736c6b8cf7f87d526e0d20183288e
|
data/README.rdoc
CHANGED
@@ -11,8 +11,6 @@ Conjugates most common english verbs for all persons, tenses, standard aspects,
|
|
11
11
|
|
12
12
|
== Installation
|
13
13
|
|
14
|
-
The gem is hosted at http://gemcutter.org/gems/verbs
|
15
|
-
|
16
14
|
gem install verbs
|
17
15
|
|
18
16
|
== Options
|
@@ -72,7 +70,8 @@ Set this to a string to prepend the conjugated verb with it. When set to tru
|
|
72
70
|
* {Lingua::Conjugate}[http://cpansearch.perl.org/src/RWG/Lingua-EN-Conjugate-0.308/lib/Lingua/EN/Conjugate.pm]
|
73
71
|
* {Pat Byrd and Tom McKlin}[http://www2.gsu.edu/~wwwesl/egw/pluralsv.htm]
|
74
72
|
* {Rick Harrison}[http://www.rickharrison.com/language/aspect.html]
|
73
|
+
* {Anatoli Makarevich}[https://github.com/makaroni4] for {#6}[https://github.com/rossmeissl/verbs/pull/6]
|
75
74
|
|
76
75
|
== Copyright
|
77
76
|
|
78
|
-
Copyright (c)
|
77
|
+
Copyright (c) 2012 Andy Rossmeissl. See LICENSE for details.
|
data/lib/verbs.rb
CHANGED
@@ -10,7 +10,7 @@ require 'verbs/improper_construction'
|
|
10
10
|
module Verbs
|
11
11
|
CONSONANTS = %w(b c d f g h j k l m n p q r s t v w x z)
|
12
12
|
CONSONANT_PATTERN = "[#{CONSONANTS.join}]"
|
13
|
-
DOUBLED_CONSONANTS = %w(b c d f g h j k l m n p q r s t
|
13
|
+
DOUBLED_CONSONANTS = %w(b c d f g h j k l m n p q r s t z)
|
14
14
|
DOUBLED_CONSONANT_PATTERN = "[#{DOUBLED_CONSONANTS.join}]"
|
15
15
|
VOWELS = %w(a e i o u y)
|
16
16
|
VOWEL_PATTERN = "[#{VOWELS.join}]"
|
data/lib/verbs/conjugations.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Verbs::Conjugator.conjugations do |conjugate|
|
2
2
|
|
3
|
-
conjugate.irregular :be do |verb| # copular
|
3
|
+
conjugate.irregular :be do |verb| # copular
|
4
4
|
verb.form :am, :tense => :present, :person => :first, :plurality => :singular
|
5
5
|
verb.form :is, :tense => :present, :person => :third, :plurality => :singular
|
6
6
|
verb.form :are, :tense => :present, :person => :second, :plurality => :singular
|
@@ -17,7 +17,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
17
17
|
verb.form :been, :tense => :past, :derivative => :participle
|
18
18
|
end
|
19
19
|
|
20
|
-
conjugate.irregular :have do |verb|
|
20
|
+
conjugate.irregular :have do |verb|
|
21
21
|
verb.form :have, :tense => :present, :person => :first, :plurality => :singular
|
22
22
|
verb.form :has, :tense => :present, :person => :third, :plurality => :singular
|
23
23
|
verb.form :have, :tense => :present, :person => :second, :plurality => :singular
|
@@ -101,7 +101,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
101
101
|
conjugate.irregular :keep, :kept, :kept
|
102
102
|
conjugate.irregular :kneel, :knelt, :knelt
|
103
103
|
conjugate.irregular :knit, :knit, :knit
|
104
|
-
conjugate.irregular :know, :knew, :
|
104
|
+
conjugate.irregular :know, :knew, :known
|
105
105
|
conjugate.irregular :lay, :laid, :laid
|
106
106
|
conjugate.irregular :lead, :led, :led
|
107
107
|
conjugate.irregular :leap, :leaped, :leaped
|
@@ -128,6 +128,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
128
128
|
conjugate.irregular :put, :put, :put
|
129
129
|
conjugate.irregular :quit, :quit, :quit
|
130
130
|
conjugate.irregular :read, :read, :read
|
131
|
+
conjugate.irregular :reset, :reset, :reset
|
131
132
|
conjugate.irregular :rid, :rid, :rid
|
132
133
|
conjugate.irregular :ride, :rode, :ridden
|
133
134
|
conjugate.irregular :ring, :rang, :rung
|
@@ -181,7 +182,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
181
182
|
conjugate.irregular :strive, :strove, :striven
|
182
183
|
conjugate.irregular :swear, :swore, :sworn
|
183
184
|
conjugate.irregular :sweep, :swept, :swept
|
184
|
-
conjugate.irregular :swell, :swelled, :swelled
|
185
|
+
conjugate.irregular :swell, :swelled, :swelled
|
185
186
|
conjugate.irregular :swim, :swam, :swum
|
186
187
|
conjugate.irregular :swing, :swung, :swung
|
187
188
|
conjugate.irregular :take, :took, :taken
|
@@ -198,7 +199,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
198
199
|
conjugate.irregular :upset, :upset, :upset
|
199
200
|
conjugate.irregular :wake, :woke, :woken
|
200
201
|
conjugate.irregular :wear, :wore, :worn
|
201
|
-
conjugate.irregular :weave, :
|
202
|
+
conjugate.irregular :weave, :wove, :woven
|
202
203
|
conjugate.irregular :wed, :wed, :wed
|
203
204
|
conjugate.irregular :weep, :wept, :wept
|
204
205
|
conjugate.irregular :wind, :wound, :wound
|
@@ -250,6 +251,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
250
251
|
conjugate.single_terminal_consonant :cocker
|
251
252
|
conjugate.single_terminal_consonant :coedit
|
252
253
|
conjugate.single_terminal_consonant :cohabit
|
254
|
+
conjugate.single_terminal_consonant :color
|
253
255
|
conjugate.single_terminal_consonant :concenter
|
254
256
|
conjugate.single_terminal_consonant :corner
|
255
257
|
conjugate.single_terminal_consonant :cover
|
@@ -262,6 +264,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
262
264
|
conjugate.single_terminal_consonant :decipher
|
263
265
|
conjugate.single_terminal_consonant :deflower
|
264
266
|
conjugate.single_terminal_consonant :delimit
|
267
|
+
conjugate.single_terminal_consonant :deliver
|
265
268
|
conjugate.single_terminal_consonant :deposit
|
266
269
|
conjugate.single_terminal_consonant :develop
|
267
270
|
conjugate.single_terminal_consonant :differ
|
@@ -307,6 +310,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
307
310
|
conjugate.single_terminal_consonant :flounder
|
308
311
|
conjugate.single_terminal_consonant :fluster
|
309
312
|
conjugate.single_terminal_consonant :flutter
|
313
|
+
conjugate.single_terminal_consonant :follow
|
310
314
|
conjugate.single_terminal_consonant :foreshorten
|
311
315
|
conjugate.single_terminal_consonant :founder
|
312
316
|
conjugate.single_terminal_consonant :fritter
|
@@ -332,6 +336,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
332
336
|
conjugate.single_terminal_consonant :inspirit
|
333
337
|
conjugate.single_terminal_consonant :interpret
|
334
338
|
conjugate.single_terminal_consonant :iron
|
339
|
+
conjugate.single_terminal_consonant :know
|
335
340
|
conjugate.single_terminal_consonant :laten
|
336
341
|
conjugate.single_terminal_consonant :launder
|
337
342
|
conjugate.single_terminal_consonant :lengthen
|
@@ -426,6 +431,7 @@ Verbs::Conjugator.conjugations do |conjugate|
|
|
426
431
|
conjugate.single_terminal_consonant :toughen
|
427
432
|
conjugate.single_terminal_consonant :tower
|
428
433
|
conjugate.single_terminal_consonant :transit
|
434
|
+
conjugate.single_terminal_consonant :trigger
|
429
435
|
conjugate.single_terminal_consonant :tucker
|
430
436
|
conjugate.single_terminal_consonant :unburden
|
431
437
|
conjugate.single_terminal_consonant :uncover
|
data/lib/verbs/conjugator.rb
CHANGED
@@ -35,15 +35,17 @@ module Verbs
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def conjugate(infinitive, options = {})
|
38
|
+
infinitive = infinitive.dup if infinitive.is_a?(String)
|
39
|
+
|
38
40
|
tense = options[:tense] || :present # present, past, future
|
39
41
|
person = options[:person] || :third # first, second, third
|
40
42
|
plurality = options[:plurality] || :singular # singular, plural
|
41
43
|
diathesis = options[:diathesis] || :active # active, passive
|
42
44
|
mood = options[:mood] || :indicative # imperative, subjunctive
|
43
45
|
aspect = options[:aspect] || :habitual # perfective, habitual, progressive, perfect, prospective
|
44
|
-
|
46
|
+
|
45
47
|
check_for_improper_constructions(tense, person, mood)
|
46
|
-
|
48
|
+
|
47
49
|
form = form_for(tense, aspect)
|
48
50
|
|
49
51
|
conjugation = form.map { |e| resolve e, infinitive, tense, person, plurality, mood }.join(' ').strip
|
@@ -109,14 +111,16 @@ module Verbs
|
|
109
111
|
end
|
110
112
|
|
111
113
|
def present_participle(infinitive)
|
112
|
-
if infinitive.to_s.match(/#{CONSONANT_PATTERN}#{VOWEL_PATTERN}#{CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(infinitive)
|
114
|
+
if infinitive.to_s.match(/#{CONSONANT_PATTERN}#{VOWEL_PATTERN}#{CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(infinitive.to_sym)
|
113
115
|
present_participle_with_doubled_terminal_consonant_for infinitive
|
114
116
|
elsif infinitive.to_s.match(/c$/)
|
115
117
|
infinitive.to_s.concat('king').to_sym
|
116
|
-
elsif infinitive.to_s.match(/ye$/) or infinitive.to_s.match(/oe$/) or infinitive.to_s.match(/nge$/) or infinitive.to_s.match(/ee$/)
|
118
|
+
elsif infinitive.to_s.match(/^be$/) or infinitive.to_s.match(/ye$/) or infinitive.to_s.match(/oe$/) or infinitive.to_s.match(/nge$/) or infinitive.to_s.match(/ee$/)
|
117
119
|
infinitive.to_s.concat('ing').to_sym
|
118
120
|
elsif infinitive.to_s.match(/ie$/)
|
119
121
|
infinitive.to_s[0..-2].concat('ying').to_sym
|
122
|
+
elsif infinitive.to_s.match(/e$/)
|
123
|
+
infinitive.to_s[0..-2].concat('ing').to_sym
|
120
124
|
else
|
121
125
|
infinitive.to_s[0..-1].concat('ing').to_sym
|
122
126
|
end
|
@@ -150,29 +154,23 @@ module Verbs
|
|
150
154
|
end
|
151
155
|
|
152
156
|
def present_third_person_singular_form_for(verb)
|
153
|
-
infinitive =
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
infinitive
|
161
|
-
elsif infinitive.to_s.match(/[szx]$/) or infinitive.to_s.match(/[sc]h$/)
|
162
|
-
infinitive.to_s.concat('es').to_sym
|
157
|
+
infinitive = verb.is_a?(Verb) ? verb.infinitive.to_s : verb.to_s
|
158
|
+
|
159
|
+
if infinitive =~ /[a-z&&#{CONSONANT_PATTERN}]y$/i
|
160
|
+
infinitive[0..-2] + 'ies'
|
161
|
+
elsif infinitive =~ /(ss|sh|t?ch|zz|x|#{CONSONANT_PATTERN}o)$/i
|
162
|
+
infinitive + 'es'
|
163
|
+
elsif infinitive =~ /[^s]s$/i
|
164
|
+
infinitive + 'ses'
|
163
165
|
else
|
164
|
-
infinitive
|
166
|
+
infinitive + 's'
|
165
167
|
end
|
166
168
|
end
|
167
169
|
|
168
170
|
def regular_preterite_for(verb)
|
169
|
-
infinitive =
|
170
|
-
|
171
|
-
|
172
|
-
when String, Symbol
|
173
|
-
verb.to_sym
|
174
|
-
end
|
175
|
-
if verb.to_s.match(/#{CONSONANT_PATTERN}#{VOWEL_PATTERN}#{DOUBLED_CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(verb)
|
171
|
+
infinitive = verb.is_a?(Verb) ? verb.infinitive.to_s : verb.to_s
|
172
|
+
|
173
|
+
if verb.to_s.match(/#{CONSONANT_PATTERN}#{VOWEL_PATTERN}#{DOUBLED_CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(verb.to_sym)
|
176
174
|
regular_preterite_with_doubled_terminal_consonant_for verb
|
177
175
|
elsif verb.to_s.match(/#{CONSONANT_PATTERN}e$/) or verb.to_s.match(/ye$/) or verb.to_s.match(/oe$/) or verb.to_s.match(/nge$/) or verb.to_s.match(/ie$/) or verb.to_s.match(/ee$/)
|
178
176
|
infinitive.to_s.concat('d').to_sym
|
@@ -211,7 +209,7 @@ module Verbs
|
|
211
209
|
end
|
212
210
|
form
|
213
211
|
end
|
214
|
-
|
212
|
+
|
215
213
|
def check_for_improper_constructions(tense, person, mood)
|
216
214
|
if mood == :imperative and not (person == :second and tense == :present)
|
217
215
|
raise Verbs::ImproperConstruction, 'The imperative mood requires present tense and second person'
|
data/lib/verbs/verblike.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
module Verbs
|
2
|
-
module Verblike
|
3
|
-
class Wrapper
|
4
|
-
def initialize(base)
|
5
|
-
@base = base
|
6
|
-
end
|
7
|
-
|
8
|
-
def conjugate(options)
|
9
|
-
words = @base.to_s.split(' ')
|
10
|
-
words.shift if words.first.downcase == 'to'
|
11
|
-
infinitive = words.shift.to_sym
|
12
|
-
conjugation = ::Verbs::Conjugator.conjugate infinitive, options
|
13
|
-
conjugated = words.unshift(conjugation.to_s).join(' ')
|
14
|
-
@base.is_a?(Symbol) ? conjugated.to_sym : conjugated
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module Access
|
19
|
-
def verb
|
20
|
-
::Verbs::Verblike::Wrapper.new self
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class String
|
27
|
-
include ::Verbs::Verblike::Access
|
28
|
-
end
|
29
|
-
|
30
|
-
class Symbol
|
31
|
-
include ::Verbs::Verblike::Access
|
32
|
-
end
|
1
|
+
module Verbs
|
2
|
+
module Verblike
|
3
|
+
class Wrapper
|
4
|
+
def initialize(base)
|
5
|
+
@base = base
|
6
|
+
end
|
7
|
+
|
8
|
+
def conjugate(options)
|
9
|
+
words = @base.to_s.split(' ')
|
10
|
+
words.shift if words.first.downcase == 'to'
|
11
|
+
infinitive = words.shift.to_sym
|
12
|
+
conjugation = ::Verbs::Conjugator.conjugate infinitive, options
|
13
|
+
conjugated = words.unshift(conjugation.to_s).join(' ')
|
14
|
+
@base.is_a?(Symbol) ? conjugated.to_sym : conjugated
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Access
|
19
|
+
def verb
|
20
|
+
::Verbs::Verblike::Wrapper.new self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class String
|
27
|
+
include ::Verbs::Verblike::Access
|
28
|
+
end
|
29
|
+
|
30
|
+
class Symbol
|
31
|
+
include ::Verbs::Verblike::Access
|
32
|
+
end
|
data/lib/verbs/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Verbs
|
2
|
-
VERSION = "2.
|
3
|
-
end
|
1
|
+
module Verbs
|
2
|
+
VERSION = "2.2.0"
|
3
|
+
end
|
data/test/test_verbs.rb
CHANGED
@@ -12,6 +12,10 @@ class TestVerbs < Test::Unit::TestCase
|
|
12
12
|
assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
|
13
13
|
assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :plural, :aspect => :perfective)
|
14
14
|
assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :plural, :aspect => :perfective)
|
15
|
+
|
16
|
+
assert_equal 'was being', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :aspect => :progressive)
|
17
|
+
assert_equal 'is being', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :aspect => :progressive)
|
18
|
+
assert_equal 'will be being', Verbs::Conjugator.conjugate(:be, :tense => :future, :person => :third, :aspect => :progressive)
|
15
19
|
end
|
16
20
|
def test_irregular_conjugation
|
17
21
|
assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
|
@@ -26,6 +30,11 @@ class TestVerbs < Test::Unit::TestCase
|
|
26
30
|
assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
27
31
|
assert_equal 'has', Verbs::Conjugator.conjugate(:have, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
28
32
|
end
|
33
|
+
def test_know
|
34
|
+
assert_equal 'had known', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfect)
|
35
|
+
assert_equal 'knew', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
|
36
|
+
assert_equal 'was knowing', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :progressive)
|
37
|
+
end
|
29
38
|
def test_irregular_conjugation_with_terminal_y
|
30
39
|
assert_equal 'flies', Verbs::Conjugator.conjugate(:fly, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
31
40
|
assert_equal 'carried', Verbs::Conjugator.conjugate(:carry, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
|
@@ -48,6 +57,10 @@ class TestVerbs < Test::Unit::TestCase
|
|
48
57
|
end
|
49
58
|
def test_regular_conjugation_with_irregular_terminal_consonant
|
50
59
|
assert_equal 'abandoned', Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
60
|
+
assert_equal 'followed', Verbs::Conjugator.conjugate(:follow, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
61
|
+
assert_equal 'triggered', Verbs::Conjugator.conjugate(:trigger, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
62
|
+
assert_equal 'colored', Verbs::Conjugator.conjugate(:color, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
63
|
+
assert_equal 'delivered', Verbs::Conjugator.conjugate(:deliver, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
51
64
|
end
|
52
65
|
def test_regular_conjugation_with_ean_suffix
|
53
66
|
assert_equal 'cleaned', Verbs::Conjugator.conjugate(:clean, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
@@ -60,6 +73,7 @@ class TestVerbs < Test::Unit::TestCase
|
|
60
73
|
end
|
61
74
|
def test_regular_conjugation_with_terminal_e
|
62
75
|
assert_equal 'created', Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
76
|
+
assert_equal 'was hiding', Verbs::Conjugator.conjugate(:hide, :tense => :past, :person => :first, :plurality => :singular, :aspect => :progressive)
|
63
77
|
end
|
64
78
|
def test_regular_conjugation_with_unusual_terminal_e
|
65
79
|
assert_equal 'dyed', Verbs::Conjugator.conjugate(:dye, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
|
@@ -70,6 +84,7 @@ class TestVerbs < Test::Unit::TestCase
|
|
70
84
|
end
|
71
85
|
def test_conjugation_with_terminal_sibilance
|
72
86
|
assert_equal 'passes', Verbs::Conjugator.conjugate(:pass, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
87
|
+
assert_equal 'focusses', Verbs::Conjugator.conjugate(:focus, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
73
88
|
assert_equal 'buzzes', Verbs::Conjugator.conjugate(:buzz, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
74
89
|
assert_equal 'coaxes', Verbs::Conjugator.conjugate(:coax, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
75
90
|
assert_equal 'washes', Verbs::Conjugator.conjugate(:wash, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
|
@@ -117,4 +132,28 @@ class TestVerbs < Test::Unit::TestCase
|
|
117
132
|
Verbs::Conjugator.conjugate(:accept, :mood => :imperative)
|
118
133
|
end
|
119
134
|
end
|
135
|
+
|
136
|
+
def test_s_forms
|
137
|
+
Verbs::Conjugator.with_options :person => :third, :tense => :present do |standard|
|
138
|
+
assert_equal 'does', standard.conjugate('do')
|
139
|
+
assert_equal 'flies', standard.conjugate('fly')
|
140
|
+
assert_equal 'assesses', standard.conjugate('assess')
|
141
|
+
assert_equal 'blushes', standard.conjugate('blush')
|
142
|
+
assert_equal 'catches', standard.conjugate('catch')
|
143
|
+
assert_equal 'fizzes', standard.conjugate('fizz')
|
144
|
+
assert_equal 'relaxes', standard.conjugate('relax')
|
145
|
+
assert_equal 'bakes', standard.conjugate('bake')
|
146
|
+
assert_equal 'calls', standard.conjugate('call')
|
147
|
+
assert_equal 'dies', standard.conjugate('die')
|
148
|
+
assert_equal 'glues', standard.conjugate('glue')
|
149
|
+
assert_equal 'moos', standard.conjugate('moo')
|
150
|
+
assert_equal 'changes', standard.conjugate('change')
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def test_immutability
|
155
|
+
verb = 'like'
|
156
|
+
Verbs::Conjugator.conjugate(verb, :tense => :past, :aspect => :perfective)
|
157
|
+
assert_equal 'like', verb
|
158
|
+
end
|
120
159
|
end
|
data/verbs.gemspec
CHANGED
@@ -1,23 +1,25 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "verbs/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'verbs'
|
7
|
-
s.version = Verbs::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Andy Rossmeissl"]
|
10
|
-
s.description = %q{Conjugates most common english verbs for all persons, tenses, standard aspects, and modern moods (with active diathesis). Standard and exceptional spelling rules are obeyed.}
|
11
|
-
s.summary = %q{English verb conjugation in Ruby}
|
12
|
-
s.email = %q{andy@rossmeissl.net}
|
13
|
-
s.homepage = %q{http://github.com/rossmeissl/verbs}
|
14
|
-
|
15
|
-
s.files = `git ls-files`.split("\n")
|
16
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
-
s.require_paths = ["lib"]
|
19
|
-
|
20
|
-
s.add_development_dependency 'bueller'
|
21
|
-
s.
|
22
|
-
|
23
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "verbs/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'verbs'
|
7
|
+
s.version = Verbs::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Andy Rossmeissl"]
|
10
|
+
s.description = %q{Conjugates most common english verbs for all persons, tenses, standard aspects, and modern moods (with active diathesis). Standard and exceptional spelling rules are obeyed.}
|
11
|
+
s.summary = %q{English verb conjugation in Ruby}
|
12
|
+
s.email = %q{andy@rossmeissl.net}
|
13
|
+
s.homepage = %q{http://github.com/rossmeissl/verbs}
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
s.add_development_dependency 'bueller'
|
21
|
+
s.add_development_dependency 'test-unit'
|
22
|
+
s.add_dependency 'activesupport', '>= 2.3.4'
|
23
|
+
s.add_dependency 'i18n'
|
24
|
+
end
|
25
|
+
|
metadata
CHANGED
@@ -1,64 +1,81 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: verbs
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 2.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.2.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Andy Rossmeissl
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
prerelease: false
|
11
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
23
14
|
name: bueller
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
24
20
|
type: :development
|
25
|
-
|
26
|
-
|
27
|
-
requirements:
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: test-unit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
28
31
|
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
|
32
|
-
- 0
|
33
|
-
version: "0"
|
34
|
-
requirement: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
36
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
37
42
|
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.4
|
38
48
|
type: :runtime
|
39
|
-
|
40
|
-
|
41
|
-
requirements:
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
42
52
|
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 11
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 3
|
48
|
-
- 4
|
53
|
+
- !ruby/object:Gem::Version
|
49
54
|
version: 2.3.4
|
50
|
-
|
51
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: i18n
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Conjugates most common english verbs for all persons, tenses, standard
|
70
|
+
aspects, and modern moods (with active diathesis). Standard and exceptional spelling
|
71
|
+
rules are obeyed.
|
52
72
|
email: andy@rossmeissl.net
|
53
73
|
executables: []
|
54
|
-
|
55
74
|
extensions: []
|
56
|
-
|
57
75
|
extra_rdoc_files: []
|
58
|
-
|
59
|
-
|
60
|
-
- .
|
61
|
-
- .gitignore
|
76
|
+
files:
|
77
|
+
- ".document"
|
78
|
+
- ".gitignore"
|
62
79
|
- Gemfile
|
63
80
|
- LICENSE
|
64
81
|
- README.rdoc
|
@@ -74,39 +91,28 @@ files:
|
|
74
91
|
- test/helper.rb
|
75
92
|
- test/test_verbs.rb
|
76
93
|
- verbs.gemspec
|
77
|
-
has_rdoc: true
|
78
94
|
homepage: http://github.com/rossmeissl/verbs
|
79
95
|
licenses: []
|
80
|
-
|
96
|
+
metadata: {}
|
81
97
|
post_install_message:
|
82
98
|
rdoc_options: []
|
83
|
-
|
84
|
-
require_paths:
|
99
|
+
require_paths:
|
85
100
|
- lib
|
86
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
-
|
88
|
-
requirements:
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
89
103
|
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
version: "0"
|
95
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
-
none: false
|
97
|
-
requirements:
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
98
108
|
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
segments:
|
102
|
-
- 0
|
103
|
-
version: "0"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
104
111
|
requirements: []
|
105
|
-
|
106
|
-
rubyforge_project:
|
107
|
-
rubygems_version: 1.6.2
|
112
|
+
rubygems_version: 3.0.1
|
108
113
|
signing_key:
|
109
|
-
specification_version:
|
114
|
+
specification_version: 4
|
110
115
|
summary: English verb conjugation in Ruby
|
111
|
-
test_files:
|
112
|
-
|
116
|
+
test_files:
|
117
|
+
- test/helper.rb
|
118
|
+
- test/test_verbs.rb
|