linguistics 1.0.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.gemtest +0 -0
  3. data/ChangeLog +849 -342
  4. data/History.rdoc +11 -0
  5. data/LICENSE +9 -9
  6. data/Manifest.txt +44 -0
  7. data/README.rdoc +226 -0
  8. data/Rakefile +32 -349
  9. data/examples/endocs.rb +272 -0
  10. data/examples/generalize_sentence.rb +2 -1
  11. data/examples/klingon.rb +22 -0
  12. data/lib/linguistics.rb +130 -292
  13. data/lib/linguistics/en.rb +337 -1628
  14. data/lib/linguistics/en/articles.rb +138 -0
  15. data/lib/linguistics/en/conjugation.rb +2245 -0
  16. data/lib/linguistics/en/conjunctions.rb +202 -0
  17. data/lib/linguistics/en/{infinitive.rb → infinitives.rb} +41 -55
  18. data/lib/linguistics/en/linkparser.rb +41 -49
  19. data/lib/linguistics/en/numbers.rb +483 -0
  20. data/lib/linguistics/en/participles.rb +33 -0
  21. data/lib/linguistics/en/pluralization.rb +810 -0
  22. data/lib/linguistics/en/stemmer.rb +75 -0
  23. data/lib/linguistics/en/titlecase.rb +121 -0
  24. data/lib/linguistics/en/wordnet.rb +63 -97
  25. data/lib/linguistics/inflector.rb +89 -0
  26. data/lib/linguistics/iso639.rb +534 -448
  27. data/lib/linguistics/languagebehavior.rb +36 -0
  28. data/lib/linguistics/monkeypatches.rb +42 -0
  29. data/spec/lib/constants.rb +15 -0
  30. data/spec/lib/helpers.rb +38 -0
  31. data/spec/linguistics/en/articles_spec.rb +797 -0
  32. data/spec/linguistics/en/conjugation_spec.rb +2083 -0
  33. data/spec/linguistics/en/conjunctions_spec.rb +154 -0
  34. data/spec/linguistics/en/infinitives_spec.rb +518 -0
  35. data/spec/linguistics/en/linkparser_spec.rb +66 -0
  36. data/spec/linguistics/en/numbers_spec.rb +1295 -0
  37. data/spec/linguistics/en/participles_spec.rb +55 -0
  38. data/spec/linguistics/en/pluralization_spec.rb +4636 -0
  39. data/spec/linguistics/en/stemmer_spec.rb +72 -0
  40. data/spec/linguistics/en/titlecase_spec.rb +841 -0
  41. data/spec/linguistics/en/wordnet_spec.rb +85 -0
  42. data/spec/linguistics/en_spec.rb +45 -167
  43. data/spec/linguistics/inflector_spec.rb +40 -0
  44. data/spec/linguistics/iso639_spec.rb +49 -53
  45. data/spec/linguistics/monkeypatches_spec.rb +40 -0
  46. data/spec/linguistics_spec.rb +46 -76
  47. metadata +241 -113
  48. metadata.gz.sig +0 -0
  49. data/README +0 -166
  50. data/README.english +0 -245
  51. data/rake/191_compat.rb +0 -26
  52. data/rake/dependencies.rb +0 -76
  53. data/rake/documentation.rb +0 -123
  54. data/rake/helpers.rb +0 -502
  55. data/rake/hg.rb +0 -318
  56. data/rake/manual.rb +0 -787
  57. data/rake/packaging.rb +0 -129
  58. data/rake/publishing.rb +0 -341
  59. data/rake/style.rb +0 -62
  60. data/rake/svn.rb +0 -668
  61. data/rake/testing.rb +0 -152
  62. data/rake/verifytask.rb +0 -64
  63. data/tests/en/infinitive.tests.rb +0 -207
  64. data/tests/en/inflect.tests.rb +0 -1389
  65. data/tests/en/lafcadio.tests.rb +0 -77
  66. data/tests/en/linkparser.tests.rb +0 -42
  67. data/tests/en/lprintf.tests.rb +0 -77
  68. data/tests/en/titlecase.tests.rb +0 -73
  69. data/tests/en/wordnet.tests.rb +0 -95
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env spec -cfs
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
6
+
7
+ libdir = basedir + "lib"
8
+
9
+ $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
+ $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
+ }
12
+
13
+ require 'rspec'
14
+ require 'spec/lib/helpers'
15
+
16
+ require 'linguistics'
17
+ require 'linguistics/en'
18
+ require 'linguistics/en/stemmer'
19
+
20
+
21
+ describe Linguistics::EN::Stemmer do
22
+
23
+ before( :all ) do
24
+ setup_logging()
25
+ Linguistics.use( :en )
26
+ end
27
+
28
+ after( :all ) do
29
+ reset_logging()
30
+ end
31
+
32
+
33
+ it "adds EN::Stemmer to the list of English language modules" do
34
+ Linguistics::EN::MODULES.include?( Linguistics::EN::Stemmer )
35
+ end
36
+
37
+
38
+ describe "on a system that has the 'ruby-stemmer' library installed" do
39
+
40
+ before( :each ) do
41
+ pending "installation of the ruby-stemmer library" unless
42
+ Linguistics::EN.has_stemmer?
43
+ end
44
+
45
+ it "can fetch the stem of a word" do
46
+ "communication".en.stem.should == 'communic'
47
+ end
48
+
49
+ end
50
+
51
+
52
+ describe "on a system that doesn't have the 'ruby-stemmer' library" do
53
+
54
+ before( :all ) do
55
+ # If the system *does* have stemmer support, pretend it doesn't.
56
+ if Linguistics::EN.has_stemmer?
57
+ error = LoadError.new( "simulated exception: no such file to load -- lingua/stemmer" )
58
+ Linguistics::EN::Stemmer.instance_variable_set( :@has_stemmer, false )
59
+ Linguistics::EN::Stemmer.instance_variable_set( :@stemmer_error, error )
60
+ end
61
+ end
62
+
63
+ it "raises an NotImplementedError when you try to use stemmer functionality" do
64
+ expect {
65
+ "communication".en.stem
66
+ }.to raise_error( LoadError, %r{lingua/stemmer}i )
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+
@@ -0,0 +1,841 @@
1
+ #!/usr/bin/env rspec -cfd
2
+ #coding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
7
+
8
+ libdir = basedir + "lib"
9
+
10
+ $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
11
+ $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
12
+ }
13
+
14
+ require 'rspec'
15
+ require 'spec/lib/helpers'
16
+
17
+ require 'linguistics'
18
+ require 'linguistics/en'
19
+ require 'linguistics/en/titlecase'
20
+
21
+
22
+ describe Linguistics::EN::TitleCase do
23
+
24
+ before( :all ) do
25
+ setup_logging( :fatal )
26
+ Linguistics.use( :en )
27
+ end
28
+
29
+ after( :all ) do
30
+ reset_logging()
31
+ end
32
+
33
+ it "CamelCases 'motion is madness' correctly" do
34
+ "motion is madness".en.to_camel_case.should == 'motionIsMadness'
35
+ end
36
+
37
+ it "CamelCases 'Special Verb Case' correctly" do
38
+ "Special Verb Case".en.to_camel_case.should == 'SpecialVerbCase'
39
+ end
40
+
41
+ it "un-CamelCases 'motionIsMadness' correctly" do
42
+ "motionIsMadness".en.un_camel_case.should == 'motion is madness'
43
+ end
44
+
45
+ it "un-CamelCases 'ASpecialVerbCase' correctly" do
46
+ "ASpecialVerbCase".en.un_camel_case.should == 'a special verb case'
47
+ end
48
+
49
+ it "titlecases _Absalom, Absalom!_ correctly" do
50
+ %{Absalom, Absalom!}.downcase.en.titlecase.should == %{Absalom, Absalom!}
51
+ end
52
+
53
+ it "titlecases _After Many a Summer Dies the Swan_ correctly" do
54
+ %{After Many a Summer Dies the Swan}.downcase.en.titlecase.
55
+ should == %{After Many a Summer Dies the Swan}
56
+ end
57
+
58
+ it "titlecases _Ah, Wilderness!_ correctly" do
59
+ %{Ah, Wilderness!}.downcase.en.titlecase.should == %{Ah, Wilderness!}
60
+ end
61
+
62
+ it "titlecases _Alien Corn_ correctly" do
63
+ %{Alien Corn}.downcase.en.titlecase.should == %{Alien Corn}
64
+ end
65
+
66
+ it "titlecases _The Alien Corn_ correctly" do
67
+ %{The Alien Corn}.downcase.en.titlecase.
68
+ should == %{The Alien Corn}
69
+ end
70
+
71
+ it "titlecases _All Passion Spent_ correctly" do
72
+ %{All Passion Spent}.downcase.en.titlecase.should == %{All Passion Spent}
73
+ end
74
+
75
+ it "titlecases _All the King's Men_ correctly" do
76
+ %{All the King's Men}.downcase.en.titlecase.should == %{All the King's Men}
77
+ end
78
+
79
+ it "titlecases _Alone on a Wide, Wide Sea_ correctly" do
80
+ %{Alone on a Wide, Wide Sea}.downcase.en.titlecase.should == %{Alone on a Wide, Wide Sea}
81
+ end
82
+
83
+ it "titlecases _An Acceptable Time_ correctly" do
84
+ %{An Acceptable Time}.downcase.en.titlecase.should == %{An Acceptable Time}
85
+ end
86
+
87
+ it "titlecases _Antic Hay_ correctly" do
88
+ %{Antic Hay}.downcase.en.titlecase.should == %{Antic Hay}
89
+ end
90
+
91
+ it "titlecases _An Evil Cradling_ correctly" do
92
+ %{An Evil Cradling}.downcase.en.titlecase.should == %{An Evil Cradling}
93
+ end
94
+
95
+ it "titlecases _Arms and the Man_ correctly" do
96
+ %{Arms and the Man}.downcase.en.titlecase.
97
+ should == %{Arms and the Man}
98
+ end
99
+
100
+ it "titlecases _As I Lay Dying_ correctly" do
101
+ %{As I Lay Dying}.downcase.en.titlecase.
102
+ should == %{As I Lay Dying}
103
+ end
104
+
105
+ it "titlecases _A Time to Kill_ correctly" do
106
+ %{A Time to Kill}.downcase.en.titlecase.
107
+ should == %{A Time to Kill}
108
+ end
109
+
110
+ it "titlecases _Behold the Man_ correctly" do
111
+ %{Behold the Man}.downcase.en.titlecase.
112
+ should == %{Behold the Man}
113
+ end
114
+
115
+ it "titlecases _Beneath the Bleeding_ correctly" do
116
+ %{Beneath the Bleeding}.downcase.en.titlecase.
117
+ should == %{Beneath the Bleeding}
118
+ end
119
+
120
+ it "titlecases _Beyond the Mexique Bay_ correctly" do
121
+ %{Beyond the Mexique Bay}.downcase.en.titlecase.
122
+ should == %{Beyond the Mexique Bay}
123
+ end
124
+
125
+ it "titlecases _Blithe Spirit_ correctly" do
126
+ %{Blithe Spirit}.downcase.en.titlecase.
127
+ should == %{Blithe Spirit}
128
+ end
129
+
130
+ it "titlecases _Blood's a Rover_ correctly" do
131
+ %{Blood's a Rover}.downcase.en.titlecase.
132
+ should == %{Blood's a Rover}
133
+ end
134
+
135
+ it "titlecases _Boats Against the Current_ correctly" do
136
+ %{Boats Against the Current}.downcase.en.titlecase.
137
+ should == %{Boats Against the Current}
138
+ end
139
+
140
+ it "titlecases _Bonjour Tristesse_ correctly" do
141
+ %{Bonjour Tristesse}.downcase.en.titlecase.
142
+ should == %{Bonjour Tristesse}
143
+ end
144
+
145
+ it "titlecases _Brandy of the Damned_ correctly" do
146
+ %{Brandy of the Damned}.downcase.en.titlecase.
147
+ should == %{Brandy of the Damned}
148
+ end
149
+
150
+ it "titlecases _Bury My Heart at Wounded Knee_ correctly" do
151
+ %{Bury My Heart at Wounded Knee}.downcase.en.titlecase.
152
+ should == %{Bury My Heart at Wounded Knee}
153
+ end
154
+
155
+ it "titlecases _Cabbages and Kings_ correctly" do
156
+ %{Cabbages and Kings}.downcase.en.titlecase.
157
+ should == %{Cabbages and Kings}
158
+ end
159
+
160
+ it "titlecases _Clouds of Witness_ correctly" do
161
+ %{Clouds of Witness}.downcase.en.titlecase.
162
+ should == %{Clouds of Witness}
163
+ end
164
+
165
+ it "titlecases _A Confederacy of Dunces_ correctly" do
166
+ %{A Confederacy of Dunces}.downcase.en.titlecase.
167
+ should == %{A Confederacy of Dunces}
168
+ end
169
+
170
+ it "titlecases _Consider Phlebas_ correctly" do
171
+ %{Consider Phlebas}.downcase.en.titlecase.
172
+ should == %{Consider Phlebas}
173
+ end
174
+
175
+ it "titlecases _Consider the Lilies_ correctly" do
176
+ %{Consider the Lilies}.downcase.en.titlecase.
177
+ should == %{Consider the Lilies}
178
+ end
179
+
180
+ it "titlecases _Cover Her Face_ correctly" do
181
+ %{Cover Her Face}.downcase.en.titlecase.
182
+ should == %{Cover Her Face}
183
+ end
184
+
185
+ it "titlecases _The Cricket on the Hearth_ correctly" do
186
+ %{The Cricket on the Hearth}.downcase.en.titlecase.
187
+ should == %{The Cricket on the Hearth}
188
+ end
189
+
190
+ it "titlecases _The Curious Incident of the Dog in the Night-Time_ correctly" do
191
+ %{The Curious Incident of the Dog in the Night-Time}.downcase.en.titlecase.
192
+ should == %{The Curious Incident of the Dog in the Night-Time}
193
+ end
194
+
195
+ it "titlecases _The Daffodil Sky_ correctly" do
196
+ %{The Daffodil Sky}.downcase.en.titlecase.
197
+ should == %{The Daffodil Sky}
198
+ end
199
+
200
+ it "titlecases _A Darkling Plain_ correctly" do
201
+ %{A Darkling Plain}.downcase.en.titlecase.
202
+ should == %{A Darkling Plain}
203
+ end
204
+
205
+ it "titlecases _Death Be Not Proud_ correctly" do
206
+ %{Death Be Not Proud}.downcase.en.titlecase.
207
+ should == %{Death Be Not Proud}
208
+ end
209
+
210
+ it "titlecases _The Doors of Perception_ correctly" do
211
+ %{The Doors of Perception}.downcase.en.titlecase.
212
+ should == %{The Doors of Perception}
213
+ end
214
+
215
+ it "titlecases _Down to a Sunless Sea_ correctly" do
216
+ %{Down to a Sunless Sea}.downcase.en.titlecase.
217
+ should == %{Down to a Sunless Sea}
218
+ end
219
+
220
+ it "titlecases _Dying of the Light_ correctly" do
221
+ %{Dying of the Light}.downcase.en.titlecase.
222
+ should == %{Dying of the Light}
223
+ end
224
+
225
+ it "titlecases _East of Eden_ correctly" do
226
+ %{East of Eden}.downcase.en.titlecase.
227
+ should == %{East of Eden}
228
+ end
229
+
230
+ it "titlecases _Ego Dominus Tuus_ correctly" do
231
+ %{Ego Dominus Tuus}.downcase.en.titlecase.
232
+ should == %{Ego Dominus Tuus}
233
+ end
234
+
235
+ it "titlecases _Endless Night_ correctly" do
236
+ %{Endless Night}.downcase.en.titlecase.
237
+ should == %{Endless Night}
238
+ end
239
+
240
+ it "titlecases _Everything Is Illuminated_ correctly" do
241
+ %{Everything Is Illuminated}.downcase.en.titlecase.
242
+ should == %{Everything Is Illuminated}
243
+ end
244
+
245
+ it "titlecases _Eyeless in Gaza_ correctly" do
246
+ %{Eyeless in Gaza}.downcase.en.titlecase.
247
+ should == %{Eyeless in Gaza}
248
+ end
249
+
250
+ it "titlecases _Fair Stood the Wind for France_ correctly" do
251
+ %{Fair Stood the Wind for France}.downcase.en.titlecase.
252
+ should == %{Fair Stood the Wind for France}
253
+ end
254
+
255
+ it "titlecases _Fame Is the Spur_ correctly" do
256
+ %{Fame Is the Spur}.downcase.en.titlecase.
257
+ should == %{Fame Is the Spur}
258
+ end
259
+
260
+ it "titlecases _A Fanatic Heart_ correctly" do
261
+ %{A Fanatic Heart}.downcase.en.titlecase.
262
+ should == %{A Fanatic Heart}
263
+ end
264
+
265
+ it "titlecases _The Far-Distant Oxus_ correctly" do
266
+ %{The Far-Distant Oxus}.downcase.en.titlecase.
267
+ should == %{The Far-Distant Oxus}
268
+ end
269
+
270
+ it "titlecases _Far from the Madding Crowd_ correctly" do
271
+ %{Far from the Madding Crowd}.downcase.en.titlecase.
272
+ should == %{Far from the Madding Crowd}
273
+ end
274
+
275
+ it "titlecases _Fear and Trembling_ correctly" do
276
+ %{Fear and Trembling}.downcase.en.titlecase.
277
+ should == %{Fear and Trembling}
278
+ end
279
+
280
+ it "titlecases _For a Breath I Tarry_ correctly" do
281
+ %{For a Breath I Tarry}.downcase.en.titlecase.
282
+ should == %{For a Breath I Tarry}
283
+ end
284
+
285
+ it "titlecases _For Whom the Bell Tolls_ correctly" do
286
+ %{For Whom the Bell Tolls}.downcase.en.titlecase.
287
+ should == %{For Whom the Bell Tolls}
288
+ end
289
+
290
+ it "titlecases _A Glass of Blessings_ correctly" do
291
+ %{A Glass of Blessings}.downcase.en.titlecase.
292
+ should == %{A Glass of Blessings}
293
+ end
294
+
295
+ it "titlecases _The Glory and the Dream_ correctly" do
296
+ %{The Glory and the Dream}.downcase.en.titlecase.
297
+ should == %{The Glory and the Dream}
298
+ end
299
+
300
+ it "titlecases _The Golden Apples of the Sun_ correctly" do
301
+ %{The Golden Apples of the Sun}.downcase.en.titlecase.
302
+ should == %{The Golden Apples of the Sun}
303
+ end
304
+
305
+ it "titlecases _The Golden Bowl_ correctly" do
306
+ %{The Golden Bowl}.downcase.en.titlecase.
307
+ should == %{The Golden Bowl}
308
+ end
309
+
310
+ it "titlecases _Gone with the Wind_ correctly" do
311
+ %{Gone with the Wind}.downcase.en.titlecase.
312
+ should == %{Gone with the Wind}
313
+ end
314
+
315
+ it "titlecases _The Grapes of Wrath_ correctly" do
316
+ %{The Grapes of Wrath}.downcase.en.titlecase.
317
+ should == %{The Grapes of Wrath}
318
+ end
319
+
320
+ it "titlecases _Great Work of Time_ correctly" do
321
+ %{Great Work of Time}.downcase.en.titlecase.
322
+ should == %{Great Work of Time}
323
+ end
324
+
325
+ it "titlecases _The Green Bay Tree_ correctly" do
326
+ %{The Green Bay Tree}.downcase.en.titlecase.
327
+ should == %{The Green Bay Tree}
328
+ end
329
+
330
+ it "titlecases _A Handful of Dust_ correctly" do
331
+ %{A Handful of Dust}.downcase.en.titlecase.
332
+ should == %{A Handful of Dust}
333
+ end
334
+
335
+ it "titlecases _Have His Carcase_ correctly" do
336
+ %{Have His Carcase}.downcase.en.titlecase.
337
+ should == %{Have His Carcase}
338
+ end
339
+
340
+ it "titlecases _The Heart Is a Lonely Hunter_ correctly" do
341
+ %{The Heart Is a Lonely Hunter}.downcase.en.titlecase.
342
+ should == %{The Heart Is a Lonely Hunter}
343
+ end
344
+
345
+ it "titlecases _The Heart Is Deceitful Above All Things_ correctly" do
346
+ %{The Heart Is Deceitful Above All Things}.downcase.en.titlecase.
347
+ should == %{The Heart Is Deceitful Above All Things}
348
+ end
349
+
350
+ it "titlecases _His Dark Materials_ correctly" do
351
+ %{His Dark Materials}.downcase.en.titlecase.
352
+ should == %{His Dark Materials}
353
+ end
354
+
355
+ it "titlecases _The House of Mirth_ correctly" do
356
+ %{The House of Mirth}.downcase.en.titlecase.
357
+ should == %{The House of Mirth}
358
+ end
359
+
360
+ it "titlecases _How Sleep the Brave_ correctly" do
361
+ %{How Sleep the Brave}.downcase.en.titlecase.
362
+ should == %{How Sleep the Brave}
363
+ end
364
+
365
+ it "titlecases _If I Forget Thee Jerusalem_ correctly" do
366
+ %{If I Forget Thee Jerusalem}.downcase.en.titlecase.
367
+ should == %{If I Forget Thee Jerusalem}
368
+ end
369
+
370
+ it "titlecases _If Not Now, When?_ correctly" do
371
+ %{If Not Now, When?}.downcase.en.titlecase.
372
+ should == %{If Not Now, When?}
373
+ end
374
+
375
+ it "titlecases _In Death Ground_ correctly" do
376
+ %{In Death Ground}.downcase.en.titlecase.
377
+ should == %{In Death Ground}
378
+ end
379
+
380
+ it "titlecases _In Dubious Battle_ correctly" do
381
+ %{In Dubious Battle}.downcase.en.titlecase.
382
+ should == %{In Dubious Battle}
383
+ end
384
+
385
+ it "titlecases _I Know Why the Caged Bird Sings_ correctly" do
386
+ %{I Know Why the Caged Bird Sings}.downcase.en.titlecase.
387
+ should == %{I Know Why the Caged Bird Sings}
388
+ end
389
+
390
+ it "titlecases _In a Dry Season_ correctly" do
391
+ %{In a Dry Season}.downcase.en.titlecase.
392
+ should == %{In a Dry Season}
393
+ end
394
+
395
+ it "titlecases _An Instant in the Wind_ correctly" do
396
+ %{An Instant in the Wind}.downcase.en.titlecase.
397
+ should == %{An Instant in the Wind}
398
+ end
399
+
400
+ it "titlecases _I Sing the Body Electric_ correctly" do
401
+ %{I Sing the Body Electric}.downcase.en.titlecase.
402
+ should == %{I Sing the Body Electric}
403
+ end
404
+
405
+ it "titlecases _I Will Fear No Evil_ correctly" do
406
+ %{I Will Fear No Evil}.downcase.en.titlecase.
407
+ should == %{I Will Fear No Evil}
408
+ end
409
+
410
+ it "titlecases _O Jerusalem!_ correctly" do
411
+ %{O Jerusalem!}.downcase.en.titlecase.
412
+ should == %{O Jerusalem!}
413
+ end
414
+
415
+ it "titlecases _Jesting Pilate_ correctly" do
416
+ %{Jesting Pilate}.downcase.en.titlecase.
417
+ should == %{Jesting Pilate}
418
+ end
419
+
420
+ it "titlecases _The Last Temptation_ correctly" do
421
+ %{The Last Temptation}.downcase.en.titlecase.
422
+ should == %{The Last Temptation}
423
+ end
424
+
425
+ it "titlecases _The Lathe of Heaven_ correctly" do
426
+ %{The Lathe of Heaven}.downcase.en.titlecase.
427
+ should == %{The Lathe of Heaven}
428
+ end
429
+
430
+ it "titlecases _Let Us Now Praise Famous Men_ correctly" do
431
+ %{Let Us Now Praise Famous Men}.downcase.en.titlecase.
432
+ should == %{Let Us Now Praise Famous Men}
433
+ end
434
+
435
+ it "titlecases _Lilies of the Field_ correctly" do
436
+ %{Lilies of the Field}.downcase.en.titlecase.
437
+ should == %{Lilies of the Field}
438
+ end
439
+
440
+ it "titlecases _This Lime Tree Bower_ correctly" do
441
+ %{This Lime Tree Bower}.downcase.en.titlecase.
442
+ should == %{This Lime Tree Bower}
443
+ end
444
+
445
+ it "titlecases _The Line of Beauty_ correctly" do
446
+ %{The Line of Beauty}.downcase.en.titlecase.
447
+ should == %{The Line of Beauty}
448
+ end
449
+
450
+ it "titlecases _The Little Foxes_ correctly" do
451
+ %{The Little Foxes}.downcase.en.titlecase.
452
+ should == %{The Little Foxes}
453
+ end
454
+
455
+ it "titlecases _Little Hands Clapping_ correctly" do
456
+ %{Little Hands Clapping}.downcase.en.titlecase.
457
+ should == %{Little Hands Clapping}
458
+ end
459
+
460
+ it "titlecases _Look Homeward, Angel_ correctly" do
461
+ %{Look Homeward, Angel}.downcase.en.titlecase.
462
+ should == %{Look Homeward, Angel}
463
+ end
464
+
465
+ it "titlecases _Look to Windward_ correctly" do
466
+ %{Look to Windward}.downcase.en.titlecase.
467
+ should == %{Look to Windward}
468
+ end
469
+
470
+ it "titlecases _Many Waters_ correctly" do
471
+ %{Many Waters}.downcase.en.titlecase.
472
+ should == %{Many Waters}
473
+ end
474
+
475
+ it "titlecases _A Many-Splendoured Thing_ correctly" do
476
+ %{A Many-Splendoured Thing}.downcase.en.titlecase.
477
+ should == %{A Many-Splendoured Thing}
478
+ end
479
+
480
+ it "titlecases _The Mermaids Singing_ correctly" do
481
+ %{The Mermaids Singing}.downcase.en.titlecase.
482
+ should == %{The Mermaids Singing}
483
+ end
484
+
485
+ it "titlecases _The Mirror Crack'd from Side to Side_ correctly" do
486
+ %{The Mirror Crack'd from Side to Side}.downcase.en.titlecase.
487
+ should == %{The Mirror Crack'd from Side to Side}
488
+ end
489
+
490
+ it "titlecases _Moab Is My Washpot_ correctly" do
491
+ %{Moab Is My Washpot}.downcase.en.titlecase.
492
+ should == %{Moab Is My Washpot}
493
+ end
494
+
495
+ it "titlecases _The Monkey's Raincoat_ correctly" do
496
+ %{The Monkey's Raincoat}.downcase.en.titlecase.
497
+ should == %{The Monkey's Raincoat}
498
+ end
499
+
500
+ it "titlecases _A Monstrous Regiment of Women_ correctly" do
501
+ %{A Monstrous Regiment of Women}.downcase.en.titlecase.
502
+ should == %{A Monstrous Regiment of Women}
503
+ end
504
+
505
+ it "titlecases _The Moon by Night_ correctly" do
506
+ %{The Moon by Night}.downcase.en.titlecase.
507
+ should == %{The Moon by Night}
508
+ end
509
+
510
+ it "titlecases _Mother Night_ correctly" do
511
+ %{Mother Night}.downcase.en.titlecase.
512
+ should == %{Mother Night}
513
+ end
514
+
515
+ it "titlecases _The Moving Finger_ correctly" do
516
+ %{The Moving Finger}.downcase.en.titlecase.
517
+ should == %{The Moving Finger}
518
+ end
519
+
520
+ it "titlecases _Mr Standfast_ correctly" do
521
+ %{Mr Standfast}.downcase.en.titlecase.
522
+ should == %{Mr Standfast}
523
+ end
524
+
525
+ it "titlecases _Nectar in a Sieve_ correctly" do
526
+ %{Nectar in a Sieve}.downcase.en.titlecase.
527
+ should == %{Nectar in a Sieve}
528
+ end
529
+
530
+ it "titlecases _No Country for Old Men_ correctly" do
531
+ %{No Country for Old Men}.downcase.en.titlecase.
532
+ should == %{No Country for Old Men}
533
+ end
534
+
535
+ it "titlecases _No Highway_ correctly" do
536
+ %{No Highway}.downcase.en.titlecase.
537
+ should == %{No Highway}
538
+ end
539
+
540
+ it "titlecases _Noli Me Tangere_ correctly" do
541
+ %{Noli Me Tangere}.downcase.en.titlecase.
542
+ should == %{Noli Me Tangere}
543
+ end
544
+
545
+ it "titlecases _No Longer at Ease_ correctly" do
546
+ %{No Longer at Ease}.downcase.en.titlecase.
547
+ should == %{No Longer at Ease}
548
+ end
549
+
550
+ it "titlecases _Now Sleeps the Crimson Petal_ correctly" do
551
+ %{Now Sleeps the Crimson Petal}.downcase.en.titlecase.
552
+ should == %{Now Sleeps the Crimson Petal}
553
+ end
554
+
555
+ it "titlecases _Number the Stars_ correctly" do
556
+ %{Number the Stars}.downcase.en.titlecase.
557
+ should == %{Number the Stars}
558
+ end
559
+
560
+ it "titlecases _Of Human Bondage_ correctly" do
561
+ %{Of Human Bondage}.downcase.en.titlecase.
562
+ should == %{Of Human Bondage}
563
+ end
564
+
565
+ it "titlecases _Of Mice and Men_ correctly" do
566
+ %{Of Mice and Men}.downcase.en.titlecase.
567
+ should == %{Of Mice and Men}
568
+ end
569
+
570
+ it "titlecases _The Other Side of Silence_ correctly" do
571
+ %{The Other Side of Silence}.downcase.en.titlecase.
572
+ should == %{The Other Side of Silence}
573
+ end
574
+
575
+ it "titlecases _The Painted Veil_ correctly" do
576
+ %{The Painted Veil}.downcase.en.titlecase.
577
+ should == %{The Painted Veil}
578
+ end
579
+
580
+ it "titlecases _The Parliament of Man_ correctly" do
581
+ %{The Parliament of Man}.downcase.en.titlecase.
582
+ should == %{The Parliament of Man}
583
+ end
584
+
585
+ it "titlecases _Paths of Glory_ correctly" do
586
+ %{Paths of Glory}.downcase.en.titlecase.
587
+ should == %{Paths of Glory}
588
+ end
589
+
590
+ it "titlecases _A Passage to India_ correctly" do
591
+ %{A Passage to India}.downcase.en.titlecase.
592
+ should == %{A Passage to India}
593
+ end
594
+
595
+ it "titlecases _O Pioneers!_ correctly" do
596
+ %{O Pioneers!}.downcase.en.titlecase.
597
+ should == %{O Pioneers!}
598
+ end
599
+
600
+ it "titlecases _Postern of Fate_ correctly" do
601
+ %{Postern of Fate}.downcase.en.titlecase.
602
+ should == %{Postern of Fate}
603
+ end
604
+
605
+ it "titlecases _Precious Bane_ correctly" do
606
+ %{Precious Bane}.downcase.en.titlecase.
607
+ should == %{Precious Bane}
608
+ end
609
+
610
+ it "titlecases _The Proper Study_ correctly" do
611
+ %{The Proper Study}.downcase.en.titlecase.
612
+ should == %{The Proper Study}
613
+ end
614
+
615
+ it "titlecases _Quo Vadis_ correctly" do
616
+ %{Quo Vadis}.downcase.en.titlecase.
617
+ should == %{Quo Vadis}
618
+ end
619
+
620
+ it "titlecases _Recalled to Life_ correctly" do
621
+ %{Recalled to Life}.downcase.en.titlecase.
622
+ should == %{Recalled to Life}
623
+ end
624
+
625
+ it "titlecases _Recalled to Life_ correctly" do
626
+ %{Recalled to Life}.downcase.en.titlecase.
627
+ should == %{Recalled to Life}
628
+ end
629
+
630
+ it "titlecases _Ring of Bright Water_ correctly" do
631
+ %{Ring of Bright Water}.downcase.en.titlecase.
632
+ should == %{Ring of Bright Water}
633
+ end
634
+
635
+ it "titlecases _The Road Less Traveled_ correctly" do
636
+ %{The Road Less Traveled}.downcase.en.titlecase.
637
+ should == %{The Road Less Traveled}
638
+ end
639
+
640
+ it "titlecases _Shall Not Perish_ correctly" do
641
+ %{Shall Not Perish}.downcase.en.titlecase.
642
+ should == %{Shall Not Perish}
643
+ end
644
+
645
+ it "titlecases _The Skull Beneath the Skin_ correctly" do
646
+ %{The Skull Beneath the Skin}.downcase.en.titlecase.
647
+ should == %{The Skull Beneath the Skin}
648
+ end
649
+
650
+ it "titlecases _The Soldier's Art_ correctly" do
651
+ %{The Soldier's Art}.downcase.en.titlecase.
652
+ should == %{The Soldier's Art}
653
+ end
654
+
655
+ it "titlecases _Some Buried Caesar_ correctly" do
656
+ %{Some Buried Caesar}.downcase.en.titlecase.
657
+ should == %{Some Buried Caesar}
658
+ end
659
+
660
+ it "titlecases _Specimen Days_ correctly" do
661
+ %{Specimen Days}.downcase.en.titlecase.
662
+ should == %{Specimen Days}
663
+ end
664
+
665
+ it "titlecases _The Stars' Tennis Balls_ correctly" do
666
+ %{The Stars' Tennis Balls}.downcase.en.titlecase.
667
+ should == %{The Stars' Tennis Balls}
668
+ end
669
+
670
+ it "titlecases _Stranger in a Strange Land_ correctly" do
671
+ %{Stranger in a Strange Land}.downcase.en.titlecase.
672
+ should == %{Stranger in a Strange Land}
673
+ end
674
+
675
+ it "titlecases _Such, Such Were the Joys_ correctly" do
676
+ %{Such, Such Were the Joys}.downcase.en.titlecase.
677
+ should == %{Such, Such Were the Joys}
678
+ end
679
+
680
+ it "titlecases _The Sun Also Rises_ correctly" do
681
+ %{The Sun Also Rises}.downcase.en.titlecase.
682
+ should == %{The Sun Also Rises}
683
+ end
684
+
685
+ it "titlecases _Surprised by Joy_ correctly" do
686
+ %{Surprised by Joy}.downcase.en.titlecase.
687
+ should == %{Surprised by Joy}
688
+ end
689
+
690
+ it "titlecases _A Swiftly Tilting Planet_ correctly" do
691
+ %{A Swiftly Tilting Planet}.downcase.en.titlecase.
692
+ should == %{A Swiftly Tilting Planet}
693
+ end
694
+
695
+ it "titlecases _Tender Is the Night_ correctly" do
696
+ %{Tender Is the Night}.downcase.en.titlecase.
697
+ should == %{Tender Is the Night}
698
+ end
699
+
700
+ it "titlecases _Terrible Swift Sword_ correctly" do
701
+ %{Terrible Swift Sword}.downcase.en.titlecase.
702
+ should == %{Terrible Swift Sword}
703
+ end
704
+
705
+ it "titlecases _That Good Night_ correctly" do
706
+ %{That Good Night}.downcase.en.titlecase.
707
+ should == %{That Good Night}
708
+ end
709
+
710
+ it "titlecases _Things Fall Apart_ correctly" do
711
+ %{Things Fall Apart}.downcase.en.titlecase.
712
+ should == %{Things Fall Apart}
713
+ end
714
+
715
+ it "titlecases _This Side of Paradise_ correctly" do
716
+ %{This Side of Paradise}.downcase.en.titlecase.
717
+ should == %{This Side of Paradise}
718
+ end
719
+
720
+ it "titlecases _The Torment of Others_ correctly" do
721
+ %{The Torment of Others}.downcase.en.titlecase.
722
+ should == %{The Torment of Others}
723
+ end
724
+
725
+ it "titlecases _Those Barren Leaves_ correctly" do
726
+ %{Those Barren Leaves}.downcase.en.titlecase.
727
+ should == %{Those Barren Leaves}
728
+ end
729
+
730
+ it "titlecases _Thrones, Dominations_ correctly" do
731
+ %{Thrones, Dominations}.downcase.en.titlecase.
732
+ should == %{Thrones, Dominations}
733
+ end
734
+
735
+ it "titlecases _Tiger! Tiger!_ correctly" do
736
+ %{Tiger! Tiger!}.downcase.en.titlecase.
737
+ should == %{Tiger! Tiger!}
738
+ end
739
+
740
+ it "titlecases _A Time of Gifts_ correctly" do
741
+ %{A Time of Gifts}.downcase.en.titlecase.
742
+ should == %{A Time of Gifts}
743
+ end
744
+
745
+ it "titlecases _Time of Our Darkness_ correctly" do
746
+ %{Time of Our Darkness}.downcase.en.titlecase.
747
+ should == %{Time of Our Darkness}
748
+ end
749
+
750
+ it "titlecases _Time to Murder and Create_ correctly" do
751
+ %{Time to Murder and Create}.downcase.en.titlecase.
752
+ should == %{Time to Murder and Create}
753
+ end
754
+
755
+ it "titlecases _To a God Unknown_ correctly" do
756
+ %{To a God Unknown}.downcase.en.titlecase.
757
+ should == %{To a God Unknown}
758
+ end
759
+
760
+ it "titlecases _To Sail Beyond the Sunset_ correctly" do
761
+ %{To Sail Beyond the Sunset}.downcase.en.titlecase.
762
+ should == %{To Sail Beyond the Sunset}
763
+ end
764
+
765
+ it "titlecases _To Say Nothing of the Dog_ correctly" do
766
+ %{To Say Nothing of the Dog}.downcase.en.titlecase.
767
+ should == %{To Say Nothing of the Dog}
768
+ end
769
+
770
+ it "titlecases _Vanity Fair_ correctly" do
771
+ %{Vanity Fair}.downcase.en.titlecase.
772
+ should == %{Vanity Fair}
773
+ end
774
+
775
+ it "titlecases _Vile Bodies_ correctly" do
776
+ %{Vile Bodies}.downcase.en.titlecase.
777
+ should == %{Vile Bodies}
778
+ end
779
+
780
+ it "titlecases _The Violent Bear It Away_ correctly" do
781
+ %{The Violent Bear It Away}.downcase.en.titlecase.
782
+ should == %{The Violent Bear It Away}
783
+ end
784
+
785
+ it "titlecases _Waiting for the Barbarians_ correctly" do
786
+ %{Waiting for the Barbarians}.downcase.en.titlecase.
787
+ should == %{Waiting for the Barbarians}
788
+ end
789
+
790
+ it "titlecases _The Waste Land_ correctly" do
791
+ %{The Waste Land}.downcase.en.titlecase.
792
+ should == %{The Waste Land}
793
+ end
794
+
795
+ it "titlecases _The Way of All Flesh_ correctly" do
796
+ %{The Way of All Flesh}.downcase.en.titlecase.
797
+ should == %{The Way of All Flesh}
798
+ end
799
+
800
+ it "titlecases _The Way Through the Woods_ correctly" do
801
+ %{The Way Through the Woods}.downcase.en.titlecase.
802
+ should == %{The Way Through the Woods}
803
+ end
804
+
805
+ it "titlecases _The Wealth of Nations_ correctly" do
806
+ %{The Wealth of Nations}.downcase.en.titlecase.
807
+ should == %{The Wealth of Nations}
808
+ end
809
+
810
+ it "titlecases _What's Become of Waring_ correctly" do
811
+ %{What's Become of Waring}.downcase.en.titlecase.
812
+ should == %{What's Become of Waring}
813
+ end
814
+
815
+ it "titlecases _When the Green Woods Laugh_ correctly" do
816
+ %{When the Green Woods Laugh}.downcase.en.titlecase.
817
+ should == %{When the Green Woods Laugh}
818
+ end
819
+
820
+ it "titlecases _Where Angels Fear to Tread_ correctly" do
821
+ %{Where Angels Fear to Tread}.downcase.en.titlecase.
822
+ should == %{Where Angels Fear to Tread}
823
+ end
824
+
825
+ it "titlecases _The Wives of Bath_ correctly" do
826
+ %{The Wives of Bath}.downcase.en.titlecase.
827
+ should == %{The Wives of Bath}
828
+ end
829
+
830
+ it "titlecases _The World, the Flesh and the Devil_ correctly" do
831
+ %{The World, the Flesh and the Devil}.downcase.en.titlecase.
832
+ should == %{The World, the Flesh and the Devil}
833
+ end
834
+
835
+ it "titlecases _The Yellow Meads of Asphodel_ correctly" do
836
+ %{The Yellow Meads of Asphodel}.downcase.en.titlecase.
837
+ should == %{The Yellow Meads of Asphodel}
838
+ end
839
+
840
+ end
841
+