verbs 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/lib/verbs/conjugations.rb +429 -0
- data/lib/verbs/conjugator.rb +118 -0
- data/lib/verbs/verb.rb +40 -0
- data/lib/verbs.rb +12 -0
- data/test/helper.rb +9 -0
- data/test/test_verbs.rb +80 -0
- metadata +68 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Andy Rossmeissl
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
= verbs
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2009 Andy Rossmeissl. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "verbs"
|
8
|
+
gem.summary = %Q{English verb conjugation in Ruby}
|
9
|
+
gem.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.}
|
10
|
+
gem.email = "andy@rossmeissl.net"
|
11
|
+
gem.homepage = "http://github.com/rossmeissl/verbs"
|
12
|
+
gem.authors = ["Andy Rossmeissl"]
|
13
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
|
+
end
|
15
|
+
Jeweler::GemcutterTasks.new
|
16
|
+
rescue LoadError
|
17
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
22
|
+
test.libs << 'lib' << 'test'
|
23
|
+
test.pattern = 'test/**/test_*.rb'
|
24
|
+
test.verbose = true
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
task :rcov do
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
task :test => :check_dependencies
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "verbs #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -0,0 +1,429 @@
|
|
1
|
+
Verbs::Conjugator.conjugations do |conjugate|
|
2
|
+
|
3
|
+
conjugate.irregular :be do |verb| # copular
|
4
|
+
verb.form :am, :tense => :present, :person => :first, :plurality => :singular
|
5
|
+
verb.form :is, :tense => :present, :person => :third, :plurality => :singular
|
6
|
+
verb.form :are, :tense => :present, :person => :second, :plurality => :singular
|
7
|
+
verb.form :are, :tense => :present, :person => :first, :plurality => :plural
|
8
|
+
verb.form :are, :tense => :present, :person => :third, :plurality => :plural
|
9
|
+
verb.form :was, :tense => :past, :person => :first, :plurality => :singular
|
10
|
+
verb.form :was, :tense => :past, :person => :third, :plurality => :singular
|
11
|
+
verb.form :were, :tense => :past, :person => :second, :plurality => :singular
|
12
|
+
verb.form :were, :tense => :past, :person => :first, :plurality => :plural
|
13
|
+
verb.form :were, :tense => :past, :person => :third, :plurality => :plural
|
14
|
+
verb.form :being, :tense => :present, :derivative => :participle
|
15
|
+
verb.form :been, :tense => :past, :derivative => :participle
|
16
|
+
end
|
17
|
+
|
18
|
+
# http://cpansearch.perl.org/src/RWG/Lingua-EN-Conjugate-0.308/lib/Lingua/EN/Conjugate.pm
|
19
|
+
conjugate.irregular :awake, :awoke, :awoken
|
20
|
+
conjugate.irregular :bear, :bore, :born
|
21
|
+
conjugate.irregular :beat, :beat, :beat
|
22
|
+
conjugate.irregular :become, :became, :become
|
23
|
+
conjugate.irregular :begin, :began, :begun
|
24
|
+
conjugate.irregular :bend, :bent, :bent
|
25
|
+
conjugate.irregular :beset, :beset, :beset
|
26
|
+
conjugate.irregular :bet, :bet, :bet
|
27
|
+
conjugate.irregular :bid, :bid, :bid
|
28
|
+
conjugate.irregular :bind, :bound, :bound
|
29
|
+
conjugate.irregular :bite, :bit, :bitten
|
30
|
+
conjugate.irregular :bleed, :bled, :bled
|
31
|
+
conjugate.irregular :blow, :blew, :blown
|
32
|
+
conjugate.irregular :break, :broke, :broken
|
33
|
+
conjugate.irregular :breed, :bred, :bred
|
34
|
+
conjugate.irregular :bring, :brought, :brought
|
35
|
+
conjugate.irregular :broadcast, :broadcast, :broadcast
|
36
|
+
conjugate.irregular :build, :built, :built
|
37
|
+
conjugate.irregular :burn, :burned, :burned
|
38
|
+
conjugate.irregular :burst, :burst, :burst
|
39
|
+
conjugate.irregular :buy, :bought, :bought
|
40
|
+
conjugate.irregular :cast, :cast, :cast
|
41
|
+
conjugate.irregular :catch, :caught, :caught
|
42
|
+
conjugate.irregular :choose, :chose, :chosen
|
43
|
+
conjugate.irregular :cling, :clung, :clung
|
44
|
+
conjugate.irregular :come, :came, :come
|
45
|
+
conjugate.irregular :cost, :cost, :cost
|
46
|
+
conjugate.irregular :creep, :crept, :crept
|
47
|
+
conjugate.irregular :cut, :cut, :cut
|
48
|
+
conjugate.irregular :deal, :dealt, :dealt
|
49
|
+
conjugate.irregular :dig, :dug, :dug
|
50
|
+
conjugate.irregular :dive, :dove, :dived
|
51
|
+
conjugate.irregular 'do', :did, :done
|
52
|
+
conjugate.irregular :draw, :drew, :drawn
|
53
|
+
conjugate.irregular :dream, :dreamed, :dreamed
|
54
|
+
conjugate.irregular :drive, :drove, :driven
|
55
|
+
conjugate.irregular :drink, :drank, :drunk
|
56
|
+
conjugate.irregular :eat, :ate, :eaten
|
57
|
+
conjugate.irregular :fall, :fell, :fallen
|
58
|
+
conjugate.irregular :feed, :fed, :fed
|
59
|
+
conjugate.irregular :feel, :felt, :felt
|
60
|
+
conjugate.irregular :fight, :fought, :fought
|
61
|
+
conjugate.irregular :find, :found, :found
|
62
|
+
conjugate.irregular :fit, :fit, :fit
|
63
|
+
conjugate.irregular :flee, :fled, :fled
|
64
|
+
conjugate.irregular :fling, :flung, :flung
|
65
|
+
conjugate.irregular :fly, :flew, :flown
|
66
|
+
conjugate.irregular :forbid, :forbade, :forbidden
|
67
|
+
conjugate.irregular :forget, :forgot, :forgotten
|
68
|
+
conjugate.irregular :forego, :forewent, :foregone
|
69
|
+
conjugate.irregular :forgo, :forwent, :forgone
|
70
|
+
conjugate.irregular :forgive, :forgave, :forgiven
|
71
|
+
conjugate.irregular :forsake, :forsook, :forsaken
|
72
|
+
conjugate.irregular :freeze, :froze, :frozen
|
73
|
+
conjugate.irregular :get, :got, :gotten
|
74
|
+
conjugate.irregular :give, :gave, :given
|
75
|
+
conjugate.irregular :go, :went, :gone
|
76
|
+
conjugate.irregular :grind, :ground, :ground
|
77
|
+
conjugate.irregular :grow, :grew, :grown
|
78
|
+
conjugate.irregular :hang, :hung, :hung
|
79
|
+
conjugate.irregular :have, :had, :had
|
80
|
+
conjugate.irregular :hear, :heard, :heard
|
81
|
+
conjugate.irregular :hide, :hid, :hidden
|
82
|
+
conjugate.irregular :hit, :hit, :hit
|
83
|
+
conjugate.irregular :hold, :held, :held
|
84
|
+
conjugate.irregular :hurt, :hurt, :hurt
|
85
|
+
conjugate.irregular :keep, :kept, :kept
|
86
|
+
conjugate.irregular :kneel, :knelt, :knelt
|
87
|
+
conjugate.irregular :knit, :knit, :knit
|
88
|
+
conjugate.irregular :know, :knew, :know
|
89
|
+
conjugate.irregular :lay, :laid, :laid
|
90
|
+
conjugate.irregular :lead, :led, :led
|
91
|
+
conjugate.irregular :leap, :leaped, :leaped
|
92
|
+
conjugate.irregular :learn, :learned, :learned
|
93
|
+
conjugate.irregular :leave, :left, :left
|
94
|
+
conjugate.irregular :lend, :lent, :lent
|
95
|
+
conjugate.irregular :let, :let, :let
|
96
|
+
conjugate.irregular :lie, :lay, :lain
|
97
|
+
conjugate.irregular :light, :lit, :lighted
|
98
|
+
conjugate.irregular :lose, :lost, :lost
|
99
|
+
conjugate.irregular :make, :made, :made
|
100
|
+
conjugate.irregular :mean, :meant, :meant
|
101
|
+
conjugate.irregular :meet, :met, :met
|
102
|
+
conjugate.irregular :misspell, :misspelled, :misspelled
|
103
|
+
conjugate.irregular :mistake, :mistook, :mistaken
|
104
|
+
conjugate.irregular :mow, :mowed, :mowed
|
105
|
+
conjugate.irregular :overcome, :overcame, :overcome
|
106
|
+
conjugate.irregular :overdo, :overdid, :overdone
|
107
|
+
conjugate.irregular :overtake, :overtook, :overtaken
|
108
|
+
conjugate.irregular :overthrow, :overthrew, :overthrown
|
109
|
+
conjugate.irregular :pay, :paid, :paid
|
110
|
+
conjugate.irregular :plead, :pled, :pled
|
111
|
+
conjugate.irregular :prove, :proved, :proved
|
112
|
+
conjugate.irregular :put, :put, :put
|
113
|
+
conjugate.irregular :quit, :quit, :quit
|
114
|
+
conjugate.irregular :read, :read, :read
|
115
|
+
conjugate.irregular :rid, :rid, :rid
|
116
|
+
conjugate.irregular :ride, :rode, :ridden
|
117
|
+
conjugate.irregular :ring, :rang, :rung
|
118
|
+
conjugate.irregular :rise, :rose, :risen
|
119
|
+
conjugate.irregular :run, :ran, :run
|
120
|
+
conjugate.irregular :saw, :sawed, :sawed
|
121
|
+
conjugate.irregular :say, :said, :said
|
122
|
+
conjugate.irregular :see, :saw, :seen
|
123
|
+
conjugate.irregular :seek, :sought, :sought
|
124
|
+
conjugate.irregular :sell, :sold, :sold
|
125
|
+
conjugate.irregular :send, :sent, :sent
|
126
|
+
conjugate.irregular :set, :set, :set
|
127
|
+
conjugate.irregular :sew, :sewed, :sewed
|
128
|
+
conjugate.irregular :shake, :shook, :shaken
|
129
|
+
conjugate.irregular :shave, :shaved, :shaved
|
130
|
+
conjugate.irregular :shear, :shore, :shorn
|
131
|
+
conjugate.irregular :shed, :shed, :shed
|
132
|
+
conjugate.irregular :shine, :shone, :shone
|
133
|
+
conjugate.irregular :shoe, :shoed, :shoed
|
134
|
+
conjugate.irregular :shoot, :shot, :shot
|
135
|
+
conjugate.irregular :show, :showed, :showed
|
136
|
+
conjugate.irregular :shrink, :shrank, :shrunk
|
137
|
+
conjugate.irregular :shut, :shut, :shut
|
138
|
+
conjugate.irregular :sing, :sang, :sung
|
139
|
+
conjugate.irregular :sink, :sank, :sunk
|
140
|
+
conjugate.irregular :sit, :sat, :sat
|
141
|
+
conjugate.irregular :sleep, :slept, :slept
|
142
|
+
conjugate.irregular :slay, :slew, :slain
|
143
|
+
conjugate.irregular :slide, :slid, :slid
|
144
|
+
conjugate.irregular :sling, :slung, :slung
|
145
|
+
conjugate.irregular :slit, :slit, :slit
|
146
|
+
conjugate.irregular :smite, :smote, :smitten
|
147
|
+
conjugate.irregular :sow, :sowed, :sowed
|
148
|
+
conjugate.irregular :speak, :spoke, :spoken
|
149
|
+
conjugate.irregular :speed, :sped, :sped
|
150
|
+
conjugate.irregular :spend, :spent, :spent
|
151
|
+
conjugate.irregular :spill, :spilled, :spilled
|
152
|
+
conjugate.irregular :spin, :spun, :spun
|
153
|
+
conjugate.irregular :spit, :spit, :spit
|
154
|
+
conjugate.irregular :split, :split, :split
|
155
|
+
conjugate.irregular :spread, :spread, :spread
|
156
|
+
conjugate.irregular :spring, :sprang, :sprung
|
157
|
+
conjugate.irregular :stand, :stood, :stood
|
158
|
+
conjugate.irregular :steal, :stole, :stolen
|
159
|
+
conjugate.irregular :stick, :stuck, :stuck
|
160
|
+
conjugate.irregular :sting, :stung, :stung
|
161
|
+
conjugate.irregular :stink, :stank, :stunk
|
162
|
+
conjugate.irregular :stride, :strod, :stridden
|
163
|
+
conjugate.irregular :strike, :struck, :struck
|
164
|
+
conjugate.irregular :string, :strung, :strung
|
165
|
+
conjugate.irregular :strive, :strove, :striven
|
166
|
+
conjugate.irregular :swear, :swore, :sworn
|
167
|
+
conjugate.irregular :sweep, :swept, :swept
|
168
|
+
conjugate.irregular :swell, :swelled, :swelled
|
169
|
+
conjugate.irregular :swim, :swam, :swum
|
170
|
+
conjugate.irregular :swing, :swung, :swung
|
171
|
+
conjugate.irregular :take, :took, :taken
|
172
|
+
conjugate.irregular :teach, :taught, :taught
|
173
|
+
conjugate.irregular :tear, :tore, :torn
|
174
|
+
conjugate.irregular :tell, :told, :told
|
175
|
+
conjugate.irregular :think, :thought, :thought
|
176
|
+
conjugate.irregular :thrive, :thrived, :thrived
|
177
|
+
conjugate.irregular :throw, :threw, :thrown
|
178
|
+
conjugate.irregular :thrust, :thrust, :thrust
|
179
|
+
conjugate.irregular :tread, :trod, :trodden
|
180
|
+
conjugate.irregular :understand, :understood, :understood
|
181
|
+
conjugate.irregular :uphold, :upheld, :upheld
|
182
|
+
conjugate.irregular :upset, :upset, :upset
|
183
|
+
conjugate.irregular :wake, :woke, :woken
|
184
|
+
conjugate.irregular :wear, :wore, :worn
|
185
|
+
conjugate.irregular :weave, :weaved, :weaved
|
186
|
+
conjugate.irregular :wed, :wed, :wed
|
187
|
+
conjugate.irregular :weep, :wept, :wept
|
188
|
+
conjugate.irregular :wind, :wound, :wound
|
189
|
+
conjugate.irregular :win, :won, :won
|
190
|
+
conjugate.irregular :withhold, :withheld, :withheld
|
191
|
+
conjugate.irregular :withstand, :withstood, :withstood
|
192
|
+
conjugate.irregular :wring, :wrung, :wrung
|
193
|
+
conjugate.irregular :write, :wrote, :written
|
194
|
+
conjugate.single_terminal_consonant :abandon
|
195
|
+
conjugate.single_terminal_consonant :accouter
|
196
|
+
conjugate.single_terminal_consonant :accredit
|
197
|
+
conjugate.single_terminal_consonant :adhibit
|
198
|
+
conjugate.single_terminal_consonant :administer
|
199
|
+
conjugate.single_terminal_consonant :alter
|
200
|
+
conjugate.single_terminal_consonant :anchor
|
201
|
+
conjugate.single_terminal_consonant :answer
|
202
|
+
conjugate.single_terminal_consonant :attrit
|
203
|
+
conjugate.single_terminal_consonant :audit
|
204
|
+
conjugate.single_terminal_consonant :author
|
205
|
+
conjugate.single_terminal_consonant :ballot
|
206
|
+
conjugate.single_terminal_consonant :banner
|
207
|
+
conjugate.single_terminal_consonant :batten
|
208
|
+
conjugate.single_terminal_consonant :bedizen
|
209
|
+
conjugate.single_terminal_consonant :bespatter
|
210
|
+
conjugate.single_terminal_consonant :betoken
|
211
|
+
conjugate.single_terminal_consonant :bewilder
|
212
|
+
conjugate.single_terminal_consonant :billet
|
213
|
+
conjugate.single_terminal_consonant :blacken
|
214
|
+
conjugate.single_terminal_consonant :blither
|
215
|
+
conjugate.single_terminal_consonant :blossom
|
216
|
+
conjugate.single_terminal_consonant :bother
|
217
|
+
conjugate.single_terminal_consonant :brighten
|
218
|
+
conjugate.single_terminal_consonant :broaden
|
219
|
+
conjugate.single_terminal_consonant :broider
|
220
|
+
conjugate.single_terminal_consonant :burden
|
221
|
+
conjugate.single_terminal_consonant :caparison
|
222
|
+
conjugate.single_terminal_consonant :catalog
|
223
|
+
conjugate.single_terminal_consonant :censor
|
224
|
+
conjugate.single_terminal_consonant :center
|
225
|
+
conjugate.single_terminal_consonant :charter
|
226
|
+
conjugate.single_terminal_consonant :chatter
|
227
|
+
conjugate.single_terminal_consonant :cheapen
|
228
|
+
conjugate.single_terminal_consonant :chipper
|
229
|
+
conjugate.single_terminal_consonant :chirrup
|
230
|
+
conjugate.single_terminal_consonant :christen
|
231
|
+
conjugate.single_terminal_consonant :clobber
|
232
|
+
conjugate.single_terminal_consonant :cluster
|
233
|
+
conjugate.single_terminal_consonant :coarsen
|
234
|
+
conjugate.single_terminal_consonant :cocker
|
235
|
+
conjugate.single_terminal_consonant :coedit
|
236
|
+
conjugate.single_terminal_consonant :cohabit
|
237
|
+
conjugate.single_terminal_consonant :concenter
|
238
|
+
conjugate.single_terminal_consonant :corner
|
239
|
+
conjugate.single_terminal_consonant :cover
|
240
|
+
conjugate.single_terminal_consonant :covet
|
241
|
+
conjugate.single_terminal_consonant :cower
|
242
|
+
conjugate.single_terminal_consonant :credit
|
243
|
+
conjugate.single_terminal_consonant :custom
|
244
|
+
conjugate.single_terminal_consonant :dampen
|
245
|
+
conjugate.single_terminal_consonant :deafen
|
246
|
+
conjugate.single_terminal_consonant :decipher
|
247
|
+
conjugate.single_terminal_consonant :deflower
|
248
|
+
conjugate.single_terminal_consonant :delimit
|
249
|
+
conjugate.single_terminal_consonant :deposit
|
250
|
+
conjugate.single_terminal_consonant :develop
|
251
|
+
conjugate.single_terminal_consonant :differ
|
252
|
+
conjugate.single_terminal_consonant :disaccustom
|
253
|
+
conjugate.single_terminal_consonant :discover
|
254
|
+
conjugate.single_terminal_consonant :discredit
|
255
|
+
conjugate.single_terminal_consonant :disencumber
|
256
|
+
conjugate.single_terminal_consonant :dishearten
|
257
|
+
conjugate.single_terminal_consonant :disinherit
|
258
|
+
conjugate.single_terminal_consonant :dismember
|
259
|
+
conjugate.single_terminal_consonant :dispirit
|
260
|
+
conjugate.single_terminal_consonant :dither
|
261
|
+
conjugate.single_terminal_consonant :dizen
|
262
|
+
conjugate.single_terminal_consonant :dodder
|
263
|
+
conjugate.single_terminal_consonant :edit
|
264
|
+
conjugate.single_terminal_consonant :elicit
|
265
|
+
conjugate.single_terminal_consonant :embitter
|
266
|
+
conjugate.single_terminal_consonant :embolden
|
267
|
+
conjugate.single_terminal_consonant :embosom
|
268
|
+
conjugate.single_terminal_consonant :embower
|
269
|
+
conjugate.single_terminal_consonant :empoison
|
270
|
+
conjugate.single_terminal_consonant :empower
|
271
|
+
conjugate.single_terminal_consonant :enamor
|
272
|
+
conjugate.single_terminal_consonant :encipher
|
273
|
+
conjugate.single_terminal_consonant :encounter
|
274
|
+
conjugate.single_terminal_consonant :endanger
|
275
|
+
conjugate.single_terminal_consonant :enfetter
|
276
|
+
conjugate.single_terminal_consonant :engender
|
277
|
+
conjugate.single_terminal_consonant :enlighten
|
278
|
+
conjugate.single_terminal_consonant :enter
|
279
|
+
conjugate.single_terminal_consonant :envelop
|
280
|
+
conjugate.single_terminal_consonant :envenom
|
281
|
+
conjugate.single_terminal_consonant :environ
|
282
|
+
conjugate.single_terminal_consonant :exhibit
|
283
|
+
conjugate.single_terminal_consonant :exit
|
284
|
+
conjugate.single_terminal_consonant :fasten
|
285
|
+
conjugate.single_terminal_consonant :fatten
|
286
|
+
conjugate.single_terminal_consonant :feather
|
287
|
+
conjugate.single_terminal_consonant :fester
|
288
|
+
conjugate.single_terminal_consonant :filter
|
289
|
+
conjugate.single_terminal_consonant :flatten
|
290
|
+
conjugate.single_terminal_consonant :flatter
|
291
|
+
conjugate.single_terminal_consonant :flounder
|
292
|
+
conjugate.single_terminal_consonant :fluster
|
293
|
+
conjugate.single_terminal_consonant :flutter
|
294
|
+
conjugate.single_terminal_consonant :foreshorten
|
295
|
+
conjugate.single_terminal_consonant :founder
|
296
|
+
conjugate.single_terminal_consonant :fritter
|
297
|
+
conjugate.single_terminal_consonant :gammon
|
298
|
+
conjugate.single_terminal_consonant :gather
|
299
|
+
conjugate.single_terminal_consonant :gladden
|
300
|
+
conjugate.single_terminal_consonant :glimmer
|
301
|
+
conjugate.single_terminal_consonant :glisten
|
302
|
+
conjugate.single_terminal_consonant :glower
|
303
|
+
conjugate.single_terminal_consonant :greaten
|
304
|
+
conjugate.single_terminal_consonant :hamper
|
305
|
+
conjugate.single_terminal_consonant :hanker
|
306
|
+
conjugate.single_terminal_consonant :happen
|
307
|
+
conjugate.single_terminal_consonant :harden
|
308
|
+
conjugate.single_terminal_consonant :harken
|
309
|
+
conjugate.single_terminal_consonant :hasten
|
310
|
+
conjugate.single_terminal_consonant :hearten
|
311
|
+
conjugate.single_terminal_consonant :hoarsen
|
312
|
+
conjugate.single_terminal_consonant :honor
|
313
|
+
conjugate.single_terminal_consonant :imprison
|
314
|
+
conjugate.single_terminal_consonant :inhabit
|
315
|
+
conjugate.single_terminal_consonant :inhibit
|
316
|
+
conjugate.single_terminal_consonant :inspirit
|
317
|
+
conjugate.single_terminal_consonant :interpret
|
318
|
+
conjugate.single_terminal_consonant :iron
|
319
|
+
conjugate.single_terminal_consonant :laten
|
320
|
+
conjugate.single_terminal_consonant :launder
|
321
|
+
conjugate.single_terminal_consonant :lengthen
|
322
|
+
conjugate.single_terminal_consonant :liken
|
323
|
+
conjugate.single_terminal_consonant :limber
|
324
|
+
conjugate.single_terminal_consonant :limit
|
325
|
+
conjugate.single_terminal_consonant :linger
|
326
|
+
conjugate.single_terminal_consonant :litter
|
327
|
+
conjugate.single_terminal_consonant :liven
|
328
|
+
conjugate.single_terminal_consonant :loiter
|
329
|
+
conjugate.single_terminal_consonant :lollop
|
330
|
+
conjugate.single_terminal_consonant :louden
|
331
|
+
conjugate.single_terminal_consonant :lower
|
332
|
+
conjugate.single_terminal_consonant :lumber
|
333
|
+
conjugate.single_terminal_consonant :madden
|
334
|
+
conjugate.single_terminal_consonant :malinger
|
335
|
+
conjugate.single_terminal_consonant :market
|
336
|
+
conjugate.single_terminal_consonant :matter
|
337
|
+
conjugate.single_terminal_consonant :misinterpret
|
338
|
+
conjugate.single_terminal_consonant :misremember
|
339
|
+
conjugate.single_terminal_consonant :monitor
|
340
|
+
conjugate.single_terminal_consonant :moulder
|
341
|
+
conjugate.single_terminal_consonant :murder
|
342
|
+
conjugate.single_terminal_consonant :murmur
|
343
|
+
conjugate.single_terminal_consonant :muster
|
344
|
+
conjugate.single_terminal_consonant :number
|
345
|
+
conjugate.single_terminal_consonant :offer
|
346
|
+
conjugate.single_terminal_consonant :open
|
347
|
+
conjugate.single_terminal_consonant :order
|
348
|
+
conjugate.single_terminal_consonant :outmaneuver
|
349
|
+
conjugate.single_terminal_consonant :overmaster
|
350
|
+
conjugate.single_terminal_consonant :pamper
|
351
|
+
conjugate.single_terminal_consonant :pilot
|
352
|
+
conjugate.single_terminal_consonant :pivot
|
353
|
+
conjugate.single_terminal_consonant :plaster
|
354
|
+
conjugate.single_terminal_consonant :plunder
|
355
|
+
conjugate.single_terminal_consonant :powder
|
356
|
+
conjugate.single_terminal_consonant :power
|
357
|
+
conjugate.single_terminal_consonant :prohibit
|
358
|
+
conjugate.single_terminal_consonant :reckon
|
359
|
+
conjugate.single_terminal_consonant :reconsider
|
360
|
+
conjugate.single_terminal_consonant :recover
|
361
|
+
conjugate.single_terminal_consonant :redden
|
362
|
+
conjugate.single_terminal_consonant :redeliver
|
363
|
+
conjugate.single_terminal_consonant :register
|
364
|
+
conjugate.single_terminal_consonant :rejigger
|
365
|
+
conjugate.single_terminal_consonant :remember
|
366
|
+
conjugate.single_terminal_consonant :renumber
|
367
|
+
conjugate.single_terminal_consonant :reopen
|
368
|
+
conjugate.single_terminal_consonant :reposit
|
369
|
+
conjugate.single_terminal_consonant :rewaken
|
370
|
+
conjugate.single_terminal_consonant :richen
|
371
|
+
conjugate.single_terminal_consonant :roister
|
372
|
+
conjugate.single_terminal_consonant :roughen
|
373
|
+
conjugate.single_terminal_consonant :sadden
|
374
|
+
conjugate.single_terminal_consonant :savor
|
375
|
+
conjugate.single_terminal_consonant :scatter
|
376
|
+
conjugate.single_terminal_consonant :scupper
|
377
|
+
conjugate.single_terminal_consonant :sharpen
|
378
|
+
conjugate.single_terminal_consonant :shatter
|
379
|
+
conjugate.single_terminal_consonant :shelter
|
380
|
+
conjugate.single_terminal_consonant :shimmer
|
381
|
+
conjugate.single_terminal_consonant :shiver
|
382
|
+
conjugate.single_terminal_consonant :shorten
|
383
|
+
conjugate.single_terminal_consonant :shower
|
384
|
+
conjugate.single_terminal_consonant :sicken
|
385
|
+
conjugate.single_terminal_consonant :smolder
|
386
|
+
conjugate.single_terminal_consonant :smoothen
|
387
|
+
conjugate.single_terminal_consonant :soften
|
388
|
+
conjugate.single_terminal_consonant :solicit
|
389
|
+
conjugate.single_terminal_consonant :squander
|
390
|
+
conjugate.single_terminal_consonant :stagger
|
391
|
+
conjugate.single_terminal_consonant :stiffen
|
392
|
+
conjugate.single_terminal_consonant :stopper
|
393
|
+
conjugate.single_terminal_consonant :stouten
|
394
|
+
conjugate.single_terminal_consonant :straiten
|
395
|
+
conjugate.single_terminal_consonant :strengthen
|
396
|
+
conjugate.single_terminal_consonant :stutter
|
397
|
+
conjugate.single_terminal_consonant :suffer
|
398
|
+
conjugate.single_terminal_consonant :sugar
|
399
|
+
conjugate.single_terminal_consonant :summon
|
400
|
+
conjugate.single_terminal_consonant :surrender
|
401
|
+
conjugate.single_terminal_consonant :swelter
|
402
|
+
conjugate.single_terminal_consonant :sypher
|
403
|
+
conjugate.single_terminal_consonant :tamper
|
404
|
+
conjugate.single_terminal_consonant :tauten
|
405
|
+
conjugate.single_terminal_consonant :tender
|
406
|
+
conjugate.single_terminal_consonant :thicken
|
407
|
+
conjugate.single_terminal_consonant :threaten
|
408
|
+
conjugate.single_terminal_consonant :thunder
|
409
|
+
conjugate.single_terminal_consonant :totter
|
410
|
+
conjugate.single_terminal_consonant :toughen
|
411
|
+
conjugate.single_terminal_consonant :tower
|
412
|
+
conjugate.single_terminal_consonant :transit
|
413
|
+
conjugate.single_terminal_consonant :tucker
|
414
|
+
conjugate.single_terminal_consonant :unburden
|
415
|
+
conjugate.single_terminal_consonant :uncover
|
416
|
+
conjugate.single_terminal_consonant :unfetter
|
417
|
+
conjugate.single_terminal_consonant :unloosen
|
418
|
+
conjugate.single_terminal_consonant :upholster
|
419
|
+
conjugate.single_terminal_consonant :utter
|
420
|
+
conjugate.single_terminal_consonant :visit
|
421
|
+
conjugate.single_terminal_consonant :vomit
|
422
|
+
conjugate.single_terminal_consonant :wander
|
423
|
+
conjugate.single_terminal_consonant :water
|
424
|
+
conjugate.single_terminal_consonant :weaken
|
425
|
+
conjugate.single_terminal_consonant :whiten
|
426
|
+
conjugate.single_terminal_consonant :winter
|
427
|
+
conjugate.single_terminal_consonant :wonder
|
428
|
+
conjugate.single_terminal_consonant :worsen
|
429
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module Verbs
|
2
|
+
module Conjugator
|
3
|
+
extend self
|
4
|
+
|
5
|
+
class Conjugations
|
6
|
+
include Singleton
|
7
|
+
|
8
|
+
attr_reader :irregulars, :single_terminal_consonants, :copulars
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@irregulars, @single_terminal_consonants, @copulars = {}, [], {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def irregular(infinitive, preterite = nil, past_participle = nil, &blk)
|
15
|
+
if block_given?
|
16
|
+
irregular = ::Verbs::Verb.new infinitive, &blk
|
17
|
+
else
|
18
|
+
raise ArgumentError, "Standard irregular verbs must specify preterite and past participle forms" unless preterite and past_participle
|
19
|
+
irregular = ::Verbs::Verb.new infinitive, :preterite => preterite, :past_participle => past_participle
|
20
|
+
end
|
21
|
+
@irregulars[infinitive] = irregular
|
22
|
+
end
|
23
|
+
|
24
|
+
def single_terminal_consonant(infinitive)
|
25
|
+
@single_terminal_consonants << infinitive
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def conjugations
|
30
|
+
if block_given?
|
31
|
+
yield Conjugations.instance
|
32
|
+
else
|
33
|
+
Conjugations.instance
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def conjugate(infinitive, options = {})
|
38
|
+
tense = options[:tense] || :present
|
39
|
+
person = options[:person] || :third
|
40
|
+
plurality = options[:plurality] || :singular
|
41
|
+
diathesis = options[:diathesis] || :active
|
42
|
+
mood = options[:mood] || :indicative
|
43
|
+
|
44
|
+
if verb = conjugations.irregulars[infinitive]
|
45
|
+
verb[options] || conjugate_irregular(verb, options)
|
46
|
+
else
|
47
|
+
conjugate_regular(infinitive, options)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def conjugate_irregular(verb, options)
|
54
|
+
tense = options[:tense]
|
55
|
+
person = options[:person]
|
56
|
+
plurality = options[:plurality]
|
57
|
+
if [tense, person, plurality] == [:present, :third, :singular]
|
58
|
+
present_third_person_singular_form_for verb
|
59
|
+
elsif tense == :present
|
60
|
+
verb.infinitive
|
61
|
+
elsif tense == :past
|
62
|
+
verb.preterite
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def conjugate_regular(verb, options)
|
67
|
+
tense = options[:tense]
|
68
|
+
person = options[:person]
|
69
|
+
plurality = options[:plurality]
|
70
|
+
if [tense, person, plurality] == [:present, :third, :singular]
|
71
|
+
present_third_person_singular_form_for verb
|
72
|
+
elsif tense == :present
|
73
|
+
verb
|
74
|
+
elsif tense == :past
|
75
|
+
regular_preterite_for verb
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def present_third_person_singular_form_for(verb)
|
80
|
+
infinitive = case verb
|
81
|
+
when Verb
|
82
|
+
verb.infinitive
|
83
|
+
when String, Symbol
|
84
|
+
verb.to_sym
|
85
|
+
end
|
86
|
+
if infinitive.to_s.match(/#{CONSONANT_PATTERN}y$/)
|
87
|
+
infinitive.to_s.gsub(/y$/, 'ies').to_sym
|
88
|
+
elsif infinitive.to_s.match(/[szx]$/) or infinitive.to_s.match(/[sc]h$/)
|
89
|
+
infinitive.to_s.concat('es').to_sym
|
90
|
+
else
|
91
|
+
infinitive.to_s.concat('s').to_sym
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def regular_preterite_for(verb)
|
96
|
+
infinitive = case verb
|
97
|
+
when Verb
|
98
|
+
verb.infinitive
|
99
|
+
when String, Symbol
|
100
|
+
verb.to_sym
|
101
|
+
end
|
102
|
+
if verb.to_s.match(/#{VOWEL_PATTERN}#{CONSONANT_PATTERN}$/) and !conjugations.single_terminal_consonants.include?(verb)
|
103
|
+
regular_preterite_with_doubled_terminal_consonant_for verb
|
104
|
+
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$/)
|
105
|
+
infinitive.to_s.concat('d').to_sym
|
106
|
+
elsif verb.to_s.match(/#{CONSONANT_PATTERN}y$/)
|
107
|
+
infinitive.to_s.chomp('y').concat('ied').to_sym
|
108
|
+
else
|
109
|
+
infinitive.to_s.concat('ed').to_sym
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def regular_preterite_with_doubled_terminal_consonant_for(verb)
|
114
|
+
regular_preterite_for verb.to_s.concat(verb.to_s[-1,1]).to_sym
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
data/lib/verbs/verb.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
module Verbs
|
2
|
+
class Verb
|
3
|
+
attr_reader :infinitive, :preterite
|
4
|
+
|
5
|
+
def initialize(infinitive, options = {}, &blk)
|
6
|
+
@infinitive = infinitive
|
7
|
+
@forms = {}
|
8
|
+
if block_given?
|
9
|
+
yield self
|
10
|
+
else
|
11
|
+
@preterite = options[:preterite]
|
12
|
+
@past_participle = options[:past_participle]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def form(word, options = {})
|
17
|
+
raise ArgumentError, 'Irregular verb specifications must identify tense and must identify either derivative or person and plurality' unless options[:tense] and (options[:derivative] or (options[:person] and options[:plurality]))
|
18
|
+
|
19
|
+
tense = options[:tense]
|
20
|
+
|
21
|
+
@forms[:present] ||= {}
|
22
|
+
@forms[:past] ||= {}
|
23
|
+
if derivative = options[:derivative]
|
24
|
+
@forms[tense][derivative] = word
|
25
|
+
elsif person = options[:person]
|
26
|
+
@forms[tense][person] ||= {}
|
27
|
+
@forms[tense][person][options[:plurality]] = word
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def [](options = {})
|
32
|
+
tense, person, plurality, derivative = options[:tense], options[:person], options[:plurality], options[:derivative]
|
33
|
+
if tense and person and plurality
|
34
|
+
@forms[tense].andand[person].andand[plurality]
|
35
|
+
elsif tense and derivative
|
36
|
+
@forms[tense].andand[derivative]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/verbs.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
require 'verbs/verb'
|
3
|
+
require 'verbs/conjugator'
|
4
|
+
require 'verbs/conjugations'
|
5
|
+
require 'andand'
|
6
|
+
|
7
|
+
module Verbs
|
8
|
+
CONSONANTS = %w(b c d f g h j k l m n p q r s t v w x z)
|
9
|
+
CONSONANT_PATTERN = "[#{CONSONANTS.join}]"
|
10
|
+
VOWELS = %w(a e i o u y)
|
11
|
+
VOWEL_PATTERN = "[#{VOWELS.join}]"
|
12
|
+
end
|
data/test/helper.rb
ADDED
data/test/test_verbs.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestVerbs < Test::Unit::TestCase
|
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)
|
15
|
+
end
|
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
|
+
end
|
28
|
+
def test_irregular_conjugation_with_terminal_y
|
29
|
+
assert_equal :flies, Verbs::Conjugator.conjugate(:fly, :tense => :present, :person => :third, :plurality => :singular)
|
30
|
+
assert_equal :carried, Verbs::Conjugator.conjugate(:carry, :tense => :past, :person => :third, :plurality => :singular)
|
31
|
+
assert_equal :stayed, Verbs::Conjugator.conjugate(:stay, :tense => :past, :person => :third, :plurality => :singular)
|
32
|
+
end
|
33
|
+
def test_regular_conjugation
|
34
|
+
assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :singular)
|
35
|
+
assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :second, :plurality => :singular)
|
36
|
+
assert_equal :accepts, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :singular)
|
37
|
+
assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :plural)
|
38
|
+
assert_equal :accept, Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :plural)
|
39
|
+
assert_equal :accepted, Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular)
|
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
|
+
end
|
45
|
+
def test_regular_conjugation_with_terminal_single_consonant
|
46
|
+
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)
|
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
|
+
end
|
52
|
+
def test_regular_conjugation_with_irregular_terminal_consonant
|
53
|
+
assert_equal :abandoned, Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular)
|
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
|
+
end
|
59
|
+
def test_regular_conjugation_with_terminal_e
|
60
|
+
assert_equal :created, Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular)
|
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
|
+
end
|
66
|
+
def test_regular_conjugation_with_unusual_terminal_e
|
67
|
+
assert_equal :dyed, Verbs::Conjugator.conjugate(:dye, :tense => :past, :person => :first, :plurality => :singular)
|
68
|
+
assert_equal :hoed, Verbs::Conjugator.conjugate(:hoe, :tense => :past, :person => :first, :plurality => :singular)
|
69
|
+
assert_equal :singed, Verbs::Conjugator.conjugate(:singe, :tense => :past, :person => :first, :plurality => :singular)
|
70
|
+
assert_equal :tied, Verbs::Conjugator.conjugate(:tie, :tense => :past, :person => :first, :plurality => :singular)
|
71
|
+
assert_equal :agreed, Verbs::Conjugator.conjugate(:agree, :tense => :past, :person => :first, :plurality => :singular)
|
72
|
+
end
|
73
|
+
def test_conjugation_with_terminal_sibilance
|
74
|
+
assert_equal :passes, Verbs::Conjugator.conjugate(:pass, :tense => :present, :person => :third, :plurality => :singular)
|
75
|
+
assert_equal :buzzes, Verbs::Conjugator.conjugate(:buzz, :tense => :present, :person => :third, :plurality => :singular)
|
76
|
+
assert_equal :coaxes, Verbs::Conjugator.conjugate(:coax, :tense => :present, :person => :third, :plurality => :singular)
|
77
|
+
assert_equal :washes, Verbs::Conjugator.conjugate(:wash, :tense => :present, :person => :third, :plurality => :singular)
|
78
|
+
assert_equal :watches, Verbs::Conjugator.conjugate(:watch, :tense => :present, :person => :third, :plurality => :singular)
|
79
|
+
end
|
80
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: verbs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andy Rossmeissl
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-25 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Conjugates most common english verbs for all persons in present and past tense (active diathesis, indicative mood). Standard and exceptional spelling rules are obeyed.
|
17
|
+
email: andy@rossmeissl.net
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- lib/verbs.rb
|
33
|
+
- lib/verbs/conjugations.rb
|
34
|
+
- lib/verbs/conjugator.rb
|
35
|
+
- lib/verbs/verb.rb
|
36
|
+
- test/helper.rb
|
37
|
+
- test/test_verbs.rb
|
38
|
+
has_rdoc: true
|
39
|
+
homepage: http://github.com/rossmeissl/verbs
|
40
|
+
licenses: []
|
41
|
+
|
42
|
+
post_install_message:
|
43
|
+
rdoc_options:
|
44
|
+
- --charset=UTF-8
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: "0"
|
52
|
+
version:
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
version:
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.3.5
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: English verb conjugation in Ruby
|
66
|
+
test_files:
|
67
|
+
- test/helper.rb
|
68
|
+
- test/test_verbs.rb
|