linguistics 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env spec -cfs
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
6
+
7
+ libdir = basedir + "lib"
8
+
9
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
10
+ }
11
+
12
+ begin
13
+ require 'spec/runner'
14
+ require 'linguistics/iso639'
15
+ rescue LoadError
16
+ unless Object.const_defined?( :Gem )
17
+ require 'rubygems'
18
+ retry
19
+ end
20
+ raise
21
+ end
22
+
23
+
24
+ describe Linguistics, " language codes" do
25
+
26
+ it "loads simple language codes from its __DATA__ section" do
27
+ Linguistics::LanguageCodes.should have_key( "en" )
28
+ Linguistics::LanguageCodes[ "en" ].should have(2).members
29
+
30
+ Linguistics::LanguageCodes[ "en" ].should have_key( :codes )
31
+ Linguistics::LanguageCodes[ "en" ][:codes].should have(2).members
32
+ Linguistics::LanguageCodes[ "en" ][:codes].should include("en")
33
+ Linguistics::LanguageCodes[ "en" ][:codes].should include("eng")
34
+
35
+ Linguistics::LanguageCodes[ "en" ].should have_key( :desc )
36
+ Linguistics::LanguageCodes[ "en" ][:desc].should == 'English'
37
+ end
38
+
39
+ it "loads language codes with variants from its __DATA__ section" do
40
+
41
+ # ces/cze cs Czech
42
+ Linguistics::LanguageCodes.should have_key( "cs" )
43
+ Linguistics::LanguageCodes[ "cs" ].should have(2).members
44
+
45
+ Linguistics::LanguageCodes[ "cs" ].should have_key( :codes )
46
+ Linguistics::LanguageCodes[ "cs" ][:codes].should have(3).members
47
+ Linguistics::LanguageCodes[ "cs" ][:codes].should include("cs")
48
+ Linguistics::LanguageCodes[ "cs" ][:codes].should include("ces")
49
+ Linguistics::LanguageCodes[ "cs" ][:codes].should include("cze")
50
+
51
+ Linguistics::LanguageCodes[ "cs" ].should have_key( :desc )
52
+ Linguistics::LanguageCodes[ "cs" ][:desc].should == 'Czech'
53
+
54
+ # jav/jaw jv/jw Javanese
55
+ Linguistics::LanguageCodes.should have_key( "jv" )
56
+ Linguistics::LanguageCodes.should have_key( "jw" )
57
+ Linguistics::LanguageCodes[ "jv" ].should == Linguistics::LanguageCodes[ "jw" ]
58
+ Linguistics::LanguageCodes[ "jv" ].should have(2).members
59
+
60
+ Linguistics::LanguageCodes[ "jv" ].should have_key( :codes )
61
+ Linguistics::LanguageCodes[ "jv" ][:codes].should have(4).members
62
+ Linguistics::LanguageCodes[ "jv" ][:codes].should include("jv")
63
+ Linguistics::LanguageCodes[ "jv" ][:codes].should include("jw")
64
+ Linguistics::LanguageCodes[ "jv" ][:codes].should include("jav")
65
+ Linguistics::LanguageCodes[ "jv" ][:codes].should include("jaw")
66
+
67
+ Linguistics::LanguageCodes[ "jv" ].should have_key( :desc )
68
+ Linguistics::LanguageCodes[ "jv" ][:desc].should == 'Javanese'
69
+
70
+ end
71
+
72
+ end
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env spec -cfs
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent
6
+
7
+ libdir = basedir + "lib"
8
+
9
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
10
+ }
11
+
12
+ begin
13
+ require 'spec/runner'
14
+ require 'linguistics'
15
+ rescue LoadError
16
+ unless Object.const_defined?( :Gem )
17
+ require 'rubygems'
18
+ retry
19
+ end
20
+ raise
21
+ end
22
+
23
+
24
+ describe Linguistics do
25
+
26
+ TestArray = %w{stone stick hammer stone lantern}
27
+ TestString = "banner"
28
+ TestNumber = 5
29
+
30
+ before( :all ) do
31
+ Linguistics.use( :en )
32
+ end
33
+
34
+
35
+ it "loads a language's linguistic functions via variants of its ISO639 code" do
36
+
37
+ [:en, :EN, 'en', 'EN', 'En', 'eN'].each do |code|
38
+ res = Linguistics.use( code )
39
+ res.should have(3).members
40
+ res.should include(Array)
41
+ res.should include(String)
42
+ res.should include(Numeric)
43
+ end
44
+ end
45
+
46
+
47
+ it "raises an error when a language that doesn't exist is requested" do
48
+ [ :zz, :ry, :qi ].each do |code|
49
+ lambda {
50
+ Linguistics.use( code )
51
+ }.should raise_error( RuntimeError, /unknown language code/i )
52
+ end
53
+ end
54
+
55
+
56
+ it "raises an error for valid languages that don't have any linguistic functions to load" do
57
+ [ :ja, :fr, :es ].each do |code|
58
+ lambda {
59
+ Linguistics.use( code )
60
+ }.should raise_error( LoadError, /failed to load language extension/i )
61
+ end
62
+
63
+ end
64
+
65
+
66
+ it "adds a method with the same name as the language code to Array that returns an inflector" +
67
+ " proxy for that language" do
68
+ TestArray.should respond_to( :en )
69
+ TestArray.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
70
+ end
71
+
72
+
73
+ it "adds a method with the same name as the language code to String that returns an inflector" +
74
+ " proxy for that language" do
75
+ TestString.should respond_to( :en )
76
+ TestString.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
77
+ end
78
+
79
+
80
+ it "adds a method with the same name as the language code to Numeric that returns an inflector" +
81
+ " proxy for that language" do
82
+ TestNumber.should respond_to( :en )
83
+ TestNumber.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
84
+ end
85
+
86
+
87
+ it "allows one to extend an additional class by passing it in the ':classes' argument to ::use" do
88
+ Linguistics.use( :en, :classes => Symbol )
89
+ :foo.should respond_to( :en )
90
+ :foo.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
91
+ end
92
+
93
+
94
+ it "allows one to extend multiple additional classes by passing them in an Array in the "+
95
+ " ':classes' argument to ::use" do
96
+ Linguistics.use( :en, :classes => [IO, Class, Range] )
97
+ $stderr.should respond_to( :en )
98
+ $stderr.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
99
+
100
+ Object.should respond_to( :en )
101
+ Object.en.should be_a_kind_of( Linguistics::LanguageProxyClass )
102
+
103
+ (0..155).should respond_to( :en )
104
+ (0..155).en.should be_a_kind_of( Linguistics::LanguageProxyClass )
105
+ end
106
+
107
+ end
@@ -0,0 +1,207 @@
1
+ #!/usr/bin/ruby -w
2
+ #
3
+ # Unit test for English infinitive (stem) forms.
4
+ # $Id$
5
+ #
6
+ # Copyright (c) 2003 The FaerieMUD Consortium.
7
+ #
8
+
9
+ unless defined? Linguistics::TestCase
10
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )
11
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir )
12
+
13
+ require 'lingtestcase'
14
+ end
15
+
16
+
17
+ ### This test case tests the English infinitive function.
18
+ class EnglishInfinitiveTestCase < Linguistics::TestCase
19
+
20
+ Linguistics::use( :en )
21
+ include Linguistics::EN
22
+
23
+ ### Auto-generate tests for the dataset beneath the '__END__'
24
+ begin
25
+ inDataSection = false
26
+ methodCounter = 5
27
+
28
+ # Read the lines of this file below the __END__, splitting each
29
+ # non-comment line into rule, original word, and expected infinitive
30
+ # form. Then generate a test method for each one.
31
+ File::readlines( __FILE__ ).find_all {|line|
32
+ case line
33
+ when /^__END_DATA__$/; inDataSection = false
34
+ when /^__END__$/; inDataSection = true; false
35
+ else inDataSection end
36
+ }.each {|line|
37
+ next if /^\s*#/ =~ line
38
+ rule, oword, stemword = line.split( /\s+/ )
39
+
40
+ # Add a test method for the method interface with a name generated
41
+ # from the origin word and the method counter.
42
+ methodname = "test_%04d_method_infinitive%s" %
43
+ [ methodCounter, oword.capitalize.gsub(/\W+/, '') ]
44
+ define_method( methodname.intern ) {||
45
+ rval = ''
46
+ printTestHeader "English: Stem of '#{oword}' (method)"
47
+
48
+ assert_nothing_raised { rval = oword.en.infinitive }
49
+ assert_instance_of Linguistics::EN::Infinitive, rval
50
+ assert_block( "Method iface: Stem for #{oword}" ) {
51
+ stemword == rval or stemword == rval.word2
52
+ }
53
+ assert_equal rule, rval.rule, "Method iface: Infinitive rule for #{oword}"
54
+ }
55
+
56
+ methodCounter += 1
57
+
58
+ # Add a test method for the functional interface with a name
59
+ # generated from the origin word and the method counter.
60
+ methodname = "test_%04d_function_infinitive%s" %
61
+ [ methodCounter, oword.capitalize.gsub(/\W+/, '') ]
62
+ define_method( methodname.intern ) {||
63
+ rval = ''
64
+ printTestHeader "English: Stem of '#{oword}' (functional)"
65
+
66
+ assert_nothing_raised { rval = infinitive( oword ) }
67
+ assert_instance_of Linguistics::EN::Infinitive, rval
68
+ assert_block( "Function iface: Stem for #{oword}" ) {
69
+ stemword == rval or stemword == rval.word2
70
+ }
71
+ assert_equal rule, rval.rule, "Function iface: Infinitive rule for #{oword}"
72
+ }
73
+
74
+ methodCounter += 1
75
+ }
76
+ end
77
+
78
+
79
+ ### Overridden initializer: auto-generated test methods have an arity of 1
80
+ ### even though they don't require an argument (as of the current Ruby CVS),
81
+ ### and the default initializer throws an :invalid_test for methods with
82
+ ### arity != 0.
83
+ def initialize( test_method_name )
84
+ if !respond_to?( test_method_name )
85
+ throw :invalid_test
86
+ end
87
+ @method_name = test_method_name
88
+ @test_passed = true
89
+ end
90
+
91
+
92
+ #################################################################
93
+ ### T E S T S
94
+ #################################################################
95
+
96
+ ### Test to be sure the infinitive module loaded.
97
+ def test_000_module
98
+ printTestHeader "English: Infinitive method"
99
+ assert_respond_to Linguistics::EN, :infinitive
100
+ end
101
+ end
102
+
103
+
104
+ ### Dataset is copied from Lingua::EN::Infinitive by Ron Savage (with a few
105
+ ### bugfixes).
106
+ __END__
107
+ 1 aches ache
108
+ 1 arches arch
109
+ 2 vases vase
110
+ 2 basses bass
111
+ 3 axes axe
112
+ 3 fixes fix
113
+ 4 hazes haze
114
+ 4 buzzes buzz
115
+ 6a caress caress
116
+ 6b bans ban
117
+ 7 Jones's Jones
118
+ 8 creater creater
119
+ 9 reacter reacter
120
+ 10 copier copy
121
+ 11 baker bake
122
+ 11 smaller small
123
+ 12a curried curry
124
+ 12b bored bore
125
+ 12b seated seat
126
+ # Can't handle these 2 with the special code as for the following 5 because after
127
+ # chopping the suffix, we are not left with a one-syllable word. Ie it's too hard.
128
+ # Yes, that was 5 not 7. Look for the doubled-consonant in the middle of the word.
129
+ # The special code is in Infinitive.pm @ line 1188.
130
+ #12b bootstrapped bootstrap
131
+ #12b bootstrapping bootstrap
132
+ 12b tipped tip
133
+ 12b kitted kit
134
+ 12b capped cap
135
+ 12b chopped chop
136
+ 13a flies fly
137
+ 13b palates palate
138
+ 14a liveliest lively
139
+ 14b wisest wise
140
+ 14b strongest strong
141
+ 15 living live
142
+ 15 laughing laugh
143
+ 15 swaying sway
144
+ 15 catching catch
145
+ 15 smiling smile
146
+ 15 swimming swim
147
+ 15 running run
148
+ 15 floating float
149
+ 15 keyboarding keyboard
150
+ 15 wrestling wrestle
151
+ 15 traveling travel
152
+ 15 traipsing traipse
153
+ 16 stylist style
154
+ 16 dentist dent
155
+ 17 cubism cube
156
+ 17 socialism social
157
+ 18 scarcity scarce
158
+ 18 rapidity rapid
159
+ 19 immunize immune
160
+ 19 lionize lion
161
+ 20c livable live
162
+ 20c portable port
163
+ 22 nobility noble
164
+ 23 identifiable identify
165
+ 24 psychologist psychology
166
+ 25 photographic photography
167
+ 26 stylistic stylist
168
+ 27 martensitic martensite
169
+ 27 politic polite
170
+ 28 ladylike lady
171
+ 29 biologic biology
172
+ 30 battlement battle
173
+ 31 supplemental supplement
174
+ 32 thermometry thermometer
175
+ 33 inadvertence inadvertent
176
+ 34 potency potent
177
+ 35 discipleship disciple
178
+ 36 mystical mystic
179
+ 37 regional region
180
+ 37 national nation
181
+ 38 horribly horrible
182
+ 39 scantily scanty
183
+ 40 partly part
184
+ 41a dutiful duty
185
+ 41b harmful harm
186
+ 42a likelihood likely
187
+ 42b neighborhood neighbor
188
+ 42b neighbourhood neighbour
189
+ 43a penniless penny
190
+ 43b listless list
191
+ 44a heartiness hearty
192
+ 44b coolness cool
193
+ 45 specification specify
194
+ 46 rationalization rationalize
195
+ 47 detection detect
196
+ 48 exertion exert
197
+ 49 creation create
198
+ 50 creator create
199
+ 51 detector detect
200
+ 52 creative creation
201
+ 52 decisive decision
202
+ 53 Australian Australia
203
+ 54 Jeffersonian Jefferson
204
+ irregular rove reeve
205
+ irregular dove dive
206
+ irregular snuck sneak
207
+ irregular wot wit
@@ -0,0 +1,1389 @@
1
+ #!/usr/bin/ruby -w
2
+ #
3
+ # Unit test for English inflection
4
+ # $Id$
5
+ #
6
+ # Copyright (c) 2003, 2005 The FaerieMUD Consortium.
7
+ #
8
+ # Much of this test was adapted from the test script for Lingua::EN::Inflect by
9
+ # Damien Conway:
10
+ #
11
+ # Copyright (c) 1997-2000, Damian Conway. All Rights Reserved.
12
+ # This module is free software. It may be used, redistributed
13
+ # and/or modified under the same terms as Perl itself.
14
+ #
15
+
16
+ unless defined? Linguistics::TestCase
17
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )
18
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir )
19
+
20
+ require 'lingtestcase'
21
+ end
22
+
23
+
24
+ ### This test case tests the english pluralization routines of the Linguistics
25
+ ### module.
26
+ class EnglishInflectionTestCase < Linguistics::TestCase
27
+
28
+ InflectFromItems = [ %w{foo bar}, "foo bar", 15, 18.13 ]
29
+
30
+ NumberTests = [
31
+ ["0", "zero", "zero", "zero", "zero", "zeroth", ],
32
+ ["1", "one", "one", "one", "one", "first", ],
33
+ ["2", "two", "two", "two", "two", "second", ],
34
+ ["3", "three", "three", "three", "three", "third", ],
35
+ ["4", "four", "four", "four", "four", "fourth", ],
36
+ ["5", "five", "five", "five", "five", "fifth", ],
37
+ ["6", "six", "six", "six", "six", "sixth", ],
38
+ ["7", "seven", "seven", "seven", "seven", "seventh", ],
39
+ ["8", "eight", "eight", "eight", "eight", "eighth", ],
40
+ ["9", "nine", "nine", "nine", "nine", "ninth", ],
41
+ ["10", "ten", "one, zero", "ten", "ten", "tenth", ],
42
+ ["11", "eleven", "one, one", "eleven", "eleven", "eleventh", ],
43
+ ["12", "twelve", "one, two", "twelve", "twelve", "twelfth", ],
44
+ ["13", "thirteen", "one, three", "thirteen", "thirteen", "thirteenth", ],
45
+ ["14", "fourteen", "one, four", "fourteen", "fourteen", "fourteenth", ],
46
+ ["15", "fifteen", "one, five", "fifteen", "fifteen", "fifteenth", ],
47
+ ["16", "sixteen", "one, six", "sixteen", "sixteen", "sixteenth", ],
48
+ ["17", "seventeen", "one, seven", "seventeen", "seventeen", "seventeenth", ],
49
+ ["18", "eighteen", "one, eight", "eighteen", "eighteen", "eighteenth", ],
50
+ ["19", "nineteen", "one, nine", "nineteen", "nineteen", "nineteenth", ],
51
+ ["20", "twenty", "two, zero", "twenty", "twenty", "twentieth", ],
52
+ ["21", "twenty-one", "two, one", "twenty-one", "twenty-one", "twenty-first", ],
53
+ ["29", "twenty-nine", "two, nine", "twenty-nine", "twenty-nine", "twenty-ninth", ],
54
+ ["99", "ninety-nine", "nine, nine", "ninety-nine", "ninety-nine", "ninety-ninth", ],
55
+
56
+ ["100", "one hundred", "one, zero, zero", "ten, zero", "one zero zero",
57
+ "one hundredth", ],
58
+ ["101", "one hundred and one", "one, zero, one", "ten, one", "one zero one",
59
+ "one hundred and first", ],
60
+ ["110", "one hundred and ten", "one, one, zero", "eleven, zero", "one ten",
61
+ "one hundred and tenth", ],
62
+ ["111", "one hundred and eleven", "one, one, one", "eleven, one", "one eleven",
63
+ "one hundred and eleventh", ],
64
+ ["900", "nine hundred", "nine, zero, zero", "ninety, zero", "nine zero zero",
65
+ "nine hundredth", ],
66
+ ["999", "nine hundred and ninety-nine", "nine, nine, nine", "ninety-nine, nine",
67
+ "nine ninety-nine", "nine hundred and ninety-ninth", ],
68
+
69
+ ["1000", "one thousand", "one, zero, zero, zero", "ten, zero zero",
70
+ "one zero zero, zero", "one thousandth", ],
71
+ ["1001", "one thousand and one", "one, zero, zero, one", "ten, zero one",
72
+ "one zero zero, one", "one thousand and first", ],
73
+ ["1010", "one thousand and ten", "one, zero, one, zero", "ten, ten",
74
+ "one zero one, zero", "one thousand and tenth", ],
75
+ ["1100", "one thousand, one hundred", "one, one, zero, zero",
76
+ "eleven, zero zero", "one ten, zero", "one thousand, one hundredth", ],
77
+ ["2000", "two thousand", "two, zero, zero, zero", "twenty, zero zero",
78
+ "two zero zero, zero", "two thousandth", ],
79
+ ["10000", "ten thousand", "one, zero, zero, zero, zero", "ten, zero zero, zero",
80
+ "one zero zero, zero zero", "ten thousandth", ],
81
+
82
+ ["100000", "one hundred thousand", "one, zero, zero, zero, zero, zero",
83
+ "ten, zero zero, zero zero", "one zero zero, zero zero zero",
84
+ "one hundred thousandth", ],
85
+ ["100001", "one hundred thousand and one", "one, zero, zero, zero, zero, one",
86
+ "ten, zero zero, zero one", "one zero zero, zero zero one",
87
+ "one hundred thousand and first", ],
88
+ ["123456", "one hundred and twenty-three thousand, four hundred and fifty-six",
89
+ "one, two, three, four, five, six", "twelve, thirty-four, fifty-six",
90
+ "one twenty-three, four fifty-six",
91
+ "one hundred and twenty-three thousand, four hundred and fifty-sixth", ],
92
+ ["0123456", "one hundred and twenty-three thousand, four hundred and fifty-six",
93
+ "zero, one, two, three, four, five, six",
94
+ "zero one, twenty-three, forty-five, six",
95
+ "zero twelve, three forty-five, six",
96
+ "one hundred and twenty-three thousand, four hundred and fifty-sixth", ],
97
+
98
+ ["1234567",
99
+ "one million, two hundred and thirty-four thousand, five hundred and sixty-seven",
100
+ "one, two, three, four, five, six, seven", "twelve, thirty-four, fifty-six, seven",
101
+ "one twenty-three, four fifty-six, seven",
102
+ "one million, two hundred and thirty-four thousand, five hundred and sixty-seventh", ],
103
+ ["12345678",
104
+ "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight",
105
+ "one, two, three, four, five, six, seven, eight",
106
+ "twelve, thirty-four, fifty-six, seventy-eight",
107
+ "one twenty-three, four fifty-six, seventy-eight",
108
+ "twelve million, three hundred and forty-five thousand, six hundred and seventy-eighth", ],
109
+ ["12_345_678",
110
+ "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight",
111
+ "one, two, three, four, five, six, seven, eight",
112
+ "twelve, thirty-four, fifty-six, seventy-eight",
113
+ "one twenty-three, four fifty-six, seventy-eight", ],
114
+ ["1234,5678",
115
+ "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight",
116
+ "one, two, three, four, five, six, seven, eight",
117
+ "twelve, thirty-four, fifty-six, seventy-eight",
118
+ "one twenty-three, four fifty-six, seventy-eight", ],
119
+ ["1234567890",
120
+ "one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninety",
121
+ "one, two, three, four, five, six, seven, eight, nine, zero",
122
+ "twelve, thirty-four, fifty-six, seventy-eight, ninety",
123
+ "one twenty-three, four fifty-six, seven eighty-nine, zero",
124
+ "one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninetieth", ],
125
+ ["123456789012345",
126
+ "one hundred and twenty-three trillion, four hundred and fifty-six billion, seven hundred and eighty-nine million, twelve thousand, three hundred and forty-five",
127
+ "one, two, three, four, five, six, seven, eight, nine, zero, one, two, three, four, five",
128
+ "twelve, thirty-four, fifty-six, seventy-eight, ninety, twelve, thirty-four, five",
129
+ "one twenty-three, four fifty-six, seven eighty-nine, zero twelve, three forty-five",
130
+ "one hundred and twenty-three trillion, four hundred and fifty-six billion, seven hundred and eighty-nine million, twelve thousand, three hundred and forty-fifth", ],
131
+ ["12345678901234567890",
132
+ "twelve quintillion, three hundred and forty-five quadrillion, six hundred and seventy-eight trillion, nine hundred and one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninety",
133
+ "one, two, three, four, five, six, seven, eight, nine, zero, one, two, three, four, five, six, seven, eight, nine, zero",
134
+ "twelve, thirty-four, fifty-six, seventy-eight, ninety, twelve, thirty-four, fifty-six, seventy-eight, ninety",
135
+ "one twenty-three, four fifty-six, seven eighty-nine, zero twelve, three forty-five, six seventy-eight, ninety",
136
+ "twelve quintillion, three hundred and forty-five quadrillion, six hundred and seventy-eight trillion, nine hundred and one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninetieth", ],
137
+
138
+ ["0.987654", "zero point nine eight seven six five four",
139
+ "zero, point, nine, eight, seven, six, five, four",
140
+ "zero, point, ninety-eight, seventy-six, fifty-four",
141
+ "zero, point, nine eighty-seven, six fifty-four",
142
+ "zero point nine eight seven six five fourth", ],
143
+ [".987654", "point nine eight seven six five four",
144
+ "point, nine, eight, seven, six, five, four",
145
+ "point, ninety-eight, seventy-six, fifty-four",
146
+ "point, nine eighty-seven, six fifty-four",
147
+ "point nine eight seven six five fourth", ],
148
+ ["9.87654", "nine point eight seven six five four",
149
+ "nine, point, eight, seven, six, five, four",
150
+ "nine, point, eighty-seven, sixty-five, four",
151
+ "nine, point, eight seventy-six, fifty-four",
152
+ "nine point eight seven six five fourth", ],
153
+ ["98.7654", "ninety-eight point seven six five four",
154
+ "nine, eight, point, seven, six, five, four",
155
+ "ninety-eight, point, seventy-six, fifty-four",
156
+ "ninety-eight, point, seven sixty-five, four",
157
+ "ninety-eight point seven six five fourth", ],
158
+ ["987.654", "nine hundred and eighty-seven point six five four",
159
+ "nine, eight, seven, point, six, five, four",
160
+ "ninety-eight, seven, point, sixty-five, four",
161
+ "nine eighty-seven, point, six fifty-four",
162
+ "nine hundred and eighty-seven point six five fourth", ],
163
+ ["9876.54", "nine thousand, eight hundred and seventy-six point five four",
164
+ "nine, eight, seven, six, point, five, four",
165
+ "ninety-eight, seventy-six, point, fifty-four",
166
+ "nine eighty-seven, six, point, fifty-four",
167
+ "nine thousand, eight hundred and seventy-six point five fourth", ],
168
+ ["98765.4", "ninety-eight thousand, seven hundred and sixty-five point four",
169
+ "nine, eight, seven, six, five, point, four",
170
+ "ninety-eight, seventy-six, five, point, four",
171
+ "nine eighty-seven, sixty-five, point, four",
172
+ "ninety-eight thousand, seven hundred and sixty-five point fourth", ],
173
+ ["101.202.303", "one hundred and one point two zero two three zero three",
174
+ "one, zero, one, point, two, zero, two, point, three, zero, three",
175
+ "ten, one, point, twenty, two, point, thirty, three",
176
+ "one zero one, point, two zero two, point, three zero three",
177
+ ]
178
+ ]
179
+
180
+
181
+ Ordinals = {
182
+ :numbers => {
183
+ 0 => "0th",
184
+ 1 => "1st",
185
+ 2 => "2nd",
186
+ 3 => "3rd",
187
+ 4 => "4th",
188
+ 5 => "5th",
189
+ 6 => "6th",
190
+ 7 => "7th",
191
+ 8 => "8th",
192
+ 9 => "9th",
193
+ 10 => "10th",
194
+ 11 => "11th",
195
+ 12 => "12th",
196
+ 13 => "13th",
197
+ 14 => "14th",
198
+ 15 => "15th",
199
+ 16 => "16th",
200
+ 17 => "17th",
201
+ 18 => "18th",
202
+ 19 => "19th",
203
+ 20 => "20th",
204
+ 21 => "21st",
205
+ 22 => "22nd",
206
+ 23 => "23rd",
207
+ 24 => "24th",
208
+ 100 => "100th",
209
+ 101 => "101st",
210
+ 102 => "102nd",
211
+ 103 => "103rd",
212
+ 104 => "104th",
213
+ },
214
+
215
+ :words => {
216
+ 'zero' => "zeroth",
217
+ 'one' => "first",
218
+ 'two' => "second",
219
+ 'three' => "third",
220
+ 'four' => "fourth",
221
+ 'five' => "fifth",
222
+ 'six' => "sixth",
223
+ 'seven' => "seventh",
224
+ 'eight' => "eighth",
225
+ 'nine' => "ninth",
226
+ 'ten' => "tenth",
227
+
228
+ 'eleven' => "eleventh",
229
+ 'twelve' => "twelfth",
230
+ 'thirteen' => "thirteenth",
231
+ 'fourteen' => "fourteenth",
232
+ 'fifteen' => "fifteenth",
233
+ 'sixteen' => "sixteenth",
234
+ 'seventeen' => "seventeenth",
235
+ 'eighteen' => "eighteenth",
236
+ 'nineteen' => "nineteenth",
237
+ 'twenty' => "twentieth",
238
+
239
+ 'twenty-one' => "twenty-first",
240
+ 'twenty-two' => "twenty-second",
241
+ 'twenty-three' => "twenty-third",
242
+ 'twenty-four' => "twenty-fourth",
243
+ 'one hundred' => "one hundredth",
244
+
245
+ 'one hundred and one' => "one hundred and first",
246
+ 'one hundred and two' => "one hundred and second",
247
+ 'one hundred and three' => "one hundred and third",
248
+ 'one hundred and four' => "one hundred and fourth",
249
+ }
250
+ }
251
+
252
+ PresentParticiples = {
253
+ 'sees' => "seeing",
254
+ 'eats' => "eating",
255
+ 'bats' => "batting",
256
+ 'hates' => "hating",
257
+ 'spies' => "spying",
258
+ }
259
+
260
+
261
+ PluralDataLine = /^\s*(.*?)\s*->\s*(.*?)\s*(?:\|\s*(.*?)\s*)?(?:#\s*(.*))?$/
262
+ ArticleDataLine = /^\s+(an?)\s+(.*?)\s*$/
263
+
264
+ ### Auto-generate tests for pluralization and indefinite articles
265
+ begin
266
+ inDataSection = false
267
+ methodCounter = 100
268
+ File::readlines( __FILE__ ).find_all do |line|
269
+ case line
270
+ when /^__END_DATA__$/
271
+ inDataSection = false
272
+ false
273
+
274
+ when /^__END__$/
275
+ inDataSection = true
276
+ false
277
+
278
+ else
279
+ inDataSection
280
+ end
281
+ end.each do |line|
282
+ case line
283
+ when PluralDataLine
284
+ singular, plural, altplural, comment = $~.to_a[1,4]
285
+ methodName = "test_%04d_pluralize%s" %
286
+ [ methodCounter, singular.gsub(/\W+/, '').capitalize ]
287
+ define_method( methodName.intern ) {||
288
+ printTestHeader "English: Plural of '#{singular}'"
289
+ assertPlural( singular, plural, altplural, comment )
290
+ }
291
+ methodCounter += 1
292
+
293
+ when ArticleDataLine
294
+ article, word = $~.to_a[1,2]
295
+ methodName = "test_%04d_%s%s" %
296
+ [ methodCounter, article, word.gsub(/\W+/, '').capitalize ]
297
+ define_method( methodName.intern ) {||
298
+ printTestHeader "English: Indefinite article for '#{word}'"
299
+ assertArticle( article, word )
300
+ }
301
+
302
+ methodCounter += 1
303
+ else
304
+ debug_msg "Skipped test data line '#{line.chomp}'"
305
+ end
306
+ end
307
+ end
308
+
309
+ ### Overridden initializer: auto-generated test methods have an arity of 1
310
+ ### even though they don't require an argument (as of the current Ruby CVS),
311
+ ### and the default initializer throws an :invalid_test for methods with
312
+ ### arity != 0.
313
+ def initialize( test_method_name )
314
+ if !respond_to?( test_method_name )
315
+ throw :invalid_test
316
+ end
317
+ @method_name = test_method_name
318
+ @test_passed = true
319
+
320
+ Linguistics::use( :en )
321
+ end
322
+
323
+
324
+
325
+ #################################################################
326
+ ### T E S T S
327
+ #################################################################
328
+
329
+ def test_0000_loaded
330
+ assert_respond_to Linguistics::EN, :numwords
331
+ end
332
+
333
+
334
+ def test_0030_numwords
335
+ printTestHeader "English: Numbers to words"
336
+ rval = nil
337
+
338
+ NumberTests.each do
339
+ |origin, regular, group1, group2, group3, numord, ordnum|
340
+
341
+ op = "Regular numwords for #{origin}"
342
+ assert_nothing_raised( op ) { rval = origin.en.numwords }
343
+ assert_equal regular, rval, op
344
+
345
+ op = "Group 1 numwords for #{origin}"
346
+ assert_nothing_raised( op ) { rval = origin.en.numwords( :group => 1 ) }
347
+ assert_equal group1, rval, op
348
+
349
+ op = "Group 2 numwords for #{origin}"
350
+ assert_nothing_raised( op ) { rval = origin.en.numwords( :group => 2 ) }
351
+ assert_equal group2, rval, op
352
+
353
+ op = "Group 3 numwords for #{origin}"
354
+ assert_nothing_raised( op ) { rval = origin.en.numwords( :group => 3 ) }
355
+ assert_equal group3, rval, op
356
+
357
+ if numord
358
+ op = "Numwords -> ordinal for #{origin}"
359
+ assert_nothing_raised( op ) { rval = origin.en.numwords.en.ordinal }
360
+ assert_equal numord, rval, op
361
+ end
362
+ end
363
+ end
364
+
365
+
366
+ def test_numwords_with_an_symboland_should_use_it_to_join_words
367
+ rval = nil
368
+
369
+ assert_nothing_raised do
370
+ rval = 2006.en.numwords( :and => ' ' )
371
+ end
372
+
373
+ assert_equal "two thousand six", rval
374
+ end
375
+
376
+
377
+ def test_0040_ordinalNumbers
378
+ printTestHeader "English: Numbers to ordinals"
379
+ rval = nil
380
+
381
+ Ordinals[:numbers].each do |input,output|
382
+ op = "Ordinal for #{input.inspect}"
383
+ assert_nothing_raised( op ) { rval = input.en.ordinal }
384
+ assert_kind_of String, rval, op
385
+ assert_equal output, rval, op
386
+ end
387
+ end
388
+
389
+
390
+ def test_0045_ordinalWords
391
+ printTestHeader "English: Number words to ordinals"
392
+ rval = nil
393
+
394
+ Ordinals[:numbers].each do |input,output|
395
+ op = "Ordinal for #{input.inspect}"
396
+ assert_nothing_raised( op ) { rval = input.en.ordinal }
397
+ assert_kind_of String, rval, op
398
+ assert_equal output, rval, op
399
+ end
400
+ end
401
+
402
+
403
+
404
+ #
405
+ # Common routines for auto-generated test methods
406
+ #
407
+
408
+ def assertPlural( singular, plural, altplural, comment )
409
+ rval, pl_noun, pl_verb, pl, pl_val, altpl_val = [nil] * 6
410
+
411
+ isNv = false
412
+ case comment
413
+ when /verb/i
414
+ isNv = 'verb'
415
+ when /noun/i
416
+ isNv = 'noun'
417
+ end
418
+
419
+ op = "Pluralizing '#{singular}': "
420
+ assert_nothing_raised( op + "plural verb" ) {
421
+ pl_verb = singular.en.plural_verb
422
+ }
423
+ assert_nothing_raised( op + "plural noun" ) {
424
+ pl_noun = singular.en.plural_noun
425
+ }
426
+ assert_nothing_raised( op + "plural" ) {
427
+ pl = singular.en.plural
428
+ }
429
+
430
+ if !altplural.nil? && !altplural.empty?
431
+ begin
432
+ assert_nothing_raised( op + "classical" ) {
433
+ Linguistics::classical = true
434
+ altpl_val = singular.en.plural
435
+ }
436
+ ensure
437
+ Linguistics::classical = false
438
+ end
439
+ end
440
+
441
+ pl_val = isNv ? (isNv == "noun" ? pl_noun : pl_verb) : pl
442
+
443
+ assert_equal plural, pl_val, "Plural of '#{singular}'"
444
+ assert_equal altplural, altpl_val,
445
+ "Classical plural of '#{singular}'" unless
446
+ altplural.nil? or altplural.empty?
447
+ end
448
+
449
+
450
+ def assertArticle( article, word )
451
+ rval = nil
452
+ op = "Indefinite article for '#{word}'"
453
+ assert_nothing_raised( op ) {
454
+ rval = word.en.a
455
+ }
456
+ assert_equal "#{article} #{word}", rval, op
457
+ end
458
+
459
+
460
+ end
461
+
462
+
463
+ ### Dataset is from Lingua::EN::Inflect's test suite.
464
+ __END__
465
+
466
+ a -> some # INDEFINITE ARTICLE
467
+ a -> as # NOUN FORM
468
+ A.C.R.O.N.Y.M. -> A.C.R.O.N.Y.M.s
469
+ abscissa -> abscissas|abscissae
470
+ Achinese -> Achinese
471
+ acropolis -> acropolises
472
+ adieu -> adieus|adieux
473
+ adjutant general -> adjutant generals
474
+ aegis -> aegises
475
+ afflatus -> afflatuses
476
+ afreet -> afreets|afreeti
477
+ afrit -> afrits|afriti
478
+ agendum -> agenda
479
+ aide-de-camp -> aides-de-camp
480
+ Alabaman -> Alabamans
481
+ albino -> albinos
482
+ album -> albums
483
+ Alfurese -> Alfurese
484
+ alga -> algae
485
+ alias -> aliases
486
+ alto -> altos|alti
487
+ alumna -> alumnae
488
+ alumnus -> alumni
489
+ alveolus -> alveoli
490
+ am -> are
491
+ am going -> are going
492
+ ambassador-at-large -> ambassadors-at-large
493
+ Amboinese -> Amboinese
494
+ Americanese -> Americanese
495
+ amoeba -> amoebas|amoebae
496
+ Amoyese -> Amoyese
497
+ an -> some # INDEFINITE ARTICLE
498
+ analysis -> analyses
499
+ anathema -> anathemas|anathemata
500
+ Andamanese -> Andamanese
501
+ Angolese -> Angolese
502
+ Annamese -> Annamese
503
+ antenna -> antennas|antennae
504
+ anus -> anuses
505
+ apex -> apexes|apices
506
+ apex's -> apexes'|apices' # POSSESSIVE FORM
507
+ aphelion -> aphelia
508
+ apparatus -> apparatuses|apparatus
509
+ appendix -> appendixes|appendices
510
+ apple -> apples
511
+ aquarium -> aquariums|aquaria
512
+ Aragonese -> Aragonese
513
+ Arakanese -> Arakanese
514
+ archipelago -> archipelagos
515
+ are -> are
516
+ are made -> are made
517
+ armadillo -> armadillos
518
+ arpeggio -> arpeggios
519
+ arthritis -> arthritises
520
+ asbestos -> asbestoses
521
+ asparagus -> asparaguses
522
+ ass -> asses
523
+ Assamese -> Assamese
524
+ asylum -> asylums
525
+ asyndeton -> asyndeta
526
+ at it -> at them # ACCUSATIVE
527
+ ate -> ate
528
+ atlas -> atlases
529
+ attorney general -> attorneys general
530
+ attorney of record -> attorneys of record
531
+ aurora -> auroras|aurorae
532
+ aviatrix -> aviatrixes|aviatrices
533
+ aviatrix's -> aviatrixes'|aviatrices'
534
+ Avignonese -> Avignonese
535
+ axe -> axes
536
+ axis -> axes
537
+ Azerbaijanese -> Azerbaijanese
538
+ bacillus -> bacilli
539
+ bacterium -> bacteria
540
+ Bahaman -> Bahamans
541
+ Balinese -> Balinese
542
+ bamboo -> bamboos
543
+ banjo -> banjoes
544
+ bass -> basses # INSTRUMENT, NOT FISH
545
+ basso -> bassos|bassi
546
+ bathos -> bathoses
547
+ beau -> beaus|beaux
548
+ beef -> beefs|beeves
549
+ beneath it -> beneath them # ACCUSATIVE
550
+ Bengalese -> Bengalese
551
+ bent -> bent # VERB FORM
552
+ bent -> bents # NOUN FORM
553
+ Bernese -> Bernese
554
+ Bhutanese -> Bhutanese
555
+ bias -> biases
556
+ biceps -> biceps
557
+ bison -> bisons|bison
558
+ Bolognese -> Bolognese
559
+ bonus -> bonuses
560
+ Borghese -> Borghese
561
+ boss -> bosses
562
+ Bostonese -> Bostonese
563
+ box -> boxes
564
+ boy -> boys
565
+ bravo -> bravoes
566
+ bream -> bream
567
+ breeches -> breeches
568
+ bride-to-be -> brides-to-be
569
+ britches -> britches
570
+ bronchitis -> bronchitises
571
+ bronchus -> bronchi
572
+ brother -> brothers|brethren
573
+ brother's -> brothers'|brethren's
574
+ buffalo -> buffaloes|buffalo
575
+ Buginese -> Buginese
576
+ buoy -> buoys
577
+ bureau -> bureaus|bureaux
578
+ Burman -> Burmans
579
+ Burmese -> Burmese
580
+ bursitis -> bursitises
581
+ bus -> buses
582
+ buzz -> buzzes
583
+ buzzes -> buzz # VERB FORM
584
+ by it -> by them # ACCUSATIVE
585
+ caddis -> caddises
586
+ cake -> cakes
587
+ Calabrese -> Calabrese
588
+ calf -> calves
589
+ callus -> calluses
590
+ Camaldolese -> Camaldolese
591
+ cameo -> cameos
592
+ campus -> campuses
593
+ can -> cans # NOUN FORM
594
+ can -> can # VERB FORM (all pers.)
595
+ candelabrum -> candelabra
596
+ cannabis -> cannabises
597
+ canto -> cantos
598
+ Cantonese -> Cantonese
599
+ cantus -> cantus
600
+ canvas -> canvases
601
+ CAPITAL -> CAPITALS
602
+ carcinoma -> carcinomas|carcinomata
603
+ care -> cares
604
+ cargo -> cargoes
605
+ Carlylese -> Carlylese
606
+ carp -> carp
607
+ Cassinese -> Cassinese
608
+ cat -> cats
609
+ catfish -> catfish
610
+ Celanese -> Celanese
611
+ Ceylonese -> Ceylonese
612
+ chairman -> chairmen
613
+ chamois -> chamois
614
+ chaos -> chaoses
615
+ chapeau -> chapeaus|chapeaux
616
+ charisma -> charismas|charismata
617
+ chases -> chase
618
+ chassis -> chassis
619
+ chateau -> chateaus|chateaux
620
+ cherub -> cherubs|cherubim
621
+ chickenpox -> chickenpox
622
+ chief -> chiefs
623
+ child -> children
624
+ Chinese -> Chinese
625
+ chorus -> choruses
626
+ church -> churches
627
+ cicatrix -> cicatrixes|cicatrices
628
+ circus -> circuses
629
+ class -> classes
630
+ classes -> class # VERB FORM
631
+ clippers -> clippers
632
+ clitoris -> clitorises|clitorides
633
+ cod -> cod
634
+ codex -> codices
635
+ coitus -> coitus
636
+ commando -> commandos
637
+ compendium -> compendiums|compendia
638
+ Congoese -> Congoese
639
+ Congolese -> Congolese
640
+ conspectus -> conspectuses
641
+ contralto -> contraltos|contralti
642
+ contretemps -> contretemps
643
+ conundrum -> conundrums
644
+ corps -> corps
645
+ corpus -> corpuses|corpora
646
+ cortex -> cortexes|cortices
647
+ cosmos -> cosmoses
648
+ court martial -> courts martial
649
+ cow -> cows|kine
650
+ cranium -> craniums|crania
651
+ crescendo -> crescendos
652
+ criterion -> criteria
653
+ curriculum -> curriculums|curricula
654
+ dais -> daises
655
+ data point -> data points
656
+ datum -> data
657
+ debris -> debris
658
+ decorum -> decorums
659
+ deer -> deer
660
+ delphinium -> delphiniums
661
+ desideratum -> desiderata
662
+ diabetes -> diabetes
663
+ dictum -> dictums|dicta
664
+ did -> did
665
+ did need -> did need
666
+ digitalis -> digitalises
667
+ dingo -> dingoes
668
+ diploma -> diplomas|diplomata
669
+ discus -> discuses
670
+ dish -> dishes
671
+ ditto -> dittos
672
+ djinn -> djinn
673
+ does -> do
674
+ dog -> dogs
675
+ dogma -> dogmas|dogmata
676
+ dominatrix -> dominatrixes|dominatrices
677
+ domino -> dominoes
678
+ Dongolese -> Dongolese
679
+ drama -> dramas|dramata
680
+ drum -> drums
681
+ dwarf -> dwarves
682
+ dynamo -> dynamos
683
+ edema -> edemas|edemata
684
+ eland -> elands|eland
685
+ elf -> elves
686
+ elk -> elks|elk
687
+ embryo -> embryos
688
+ emporium -> emporiums|emporia
689
+ encephalitis -> encephalitises
690
+ enconium -> enconiums|enconia
691
+ enema -> enemas|enemata
692
+ enigma -> enigmas|enigmata
693
+ ephemeris -> ephemerides
694
+ epidermis -> epidermises
695
+ erratum -> errata
696
+ ethos -> ethoses
697
+ eucalyptus -> eucalyptuses
698
+ extremum -> extrema
699
+ eyas -> eyases
700
+ factotum -> factotums
701
+ Faroese -> Faroese
702
+ fauna -> faunas|faunae
703
+ fax -> faxes
704
+ Ferrarese -> Ferrarese
705
+ ferry -> ferries
706
+ fetus -> fetuses
707
+ fiance -> fiances
708
+ fiancee -> fiancees
709
+ fiasco -> fiascos
710
+ fish -> fish
711
+ fizz -> fizzes
712
+ flamingo -> flamingoes
713
+ flora -> floras|florae
714
+ flounder -> flounder
715
+ focus -> focuses|foci
716
+ foetus -> foetuses
717
+ folio -> folios
718
+ Foochowese -> Foochowese
719
+ foot -> feet
720
+ foot's -> feet's # POSSESSIVE FORM
721
+ foramen -> foramens|foramina
722
+ formula -> formulas|formulae
723
+ forum -> forums
724
+ fought -> fought
725
+ fox -> foxes
726
+ from him -> from them
727
+ from it -> from them # ACCUSATIVE
728
+ fungus -> funguses|fungi
729
+ Gabunese -> Gabunese
730
+ gallows -> gallows
731
+ ganglion -> ganglions|ganglia
732
+ gas -> gases
733
+ gateau -> gateaus|gateaux
734
+ gave -> gave
735
+ generalissimo -> generalissimos
736
+ Genevese -> Genevese
737
+ genie -> genies|genii
738
+ genius -> geniuses|genii
739
+ Genoese -> Genoese
740
+ genus -> genera
741
+ German -> Germans
742
+ ghetto -> ghettos
743
+ Gilbertese -> Gilbertese
744
+ glottis -> glottises
745
+ Goanese -> Goanese
746
+ goose -> geese
747
+ Governor General -> Governors General
748
+ goy -> goys|goyim
749
+ graffiti -> graffiti
750
+ graffito -> graffiti
751
+ guano -> guanos
752
+ guardsman -> guardsmen
753
+ Guianese -> Guianese
754
+ gumma -> gummas|gummata
755
+ gymnasium -> gymnasiums|gymnasia
756
+ had -> had
757
+ had thought -> had thought
758
+ Hainanese -> Hainanese
759
+ handkerchief -> handkerchiefs
760
+ Hararese -> Hararese
761
+ Harlemese -> Harlemese
762
+ harmonium -> harmoniums
763
+ has -> have
764
+ has become -> have become
765
+ has been -> have been
766
+ has-been -> has-beens
767
+ Havanese -> Havanese
768
+ have -> have
769
+ have conceded -> have conceded
770
+ he -> they
771
+ headquarters -> headquarters
772
+ Heavenese -> Heavenese
773
+ helix -> helices
774
+ hepatitis -> hepatitises
775
+ her -> them # PRONOUN
776
+ her -> their # POSSESSIVE ADJ
777
+ hero -> heroes
778
+ herpes -> herpes
779
+ hers -> theirs # POSSESSIVE NOUN
780
+ herself -> themselves
781
+ hiatus -> hiatuses|hiatus
782
+ highlight -> highlights
783
+ hijinks -> hijinks
784
+ him -> them
785
+ himself -> themselves
786
+ hippopotamus -> hippopotamuses|hippopotami
787
+ Hiroshiman -> Hiroshimans
788
+ his -> their # POSSESSIVE ADJ
789
+ his -> theirs # POSSESSIVE NOUN
790
+ honorarium -> honorariums|honoraria
791
+ hoof -> hoofs|hooves
792
+ Hoosierese -> Hoosierese
793
+ Hottentotese -> Hottentotese
794
+ house -> houses
795
+ housewife -> housewives
796
+ hubris -> hubrises
797
+ human -> humans
798
+ Hunanese -> Hunanese
799
+ hydra -> hydras|hydrae
800
+ hyperbaton -> hyperbata
801
+ hyperbola -> hyperbolas|hyperbolae
802
+ I -> we
803
+ ibis -> ibises
804
+ ignoramus -> ignoramuses
805
+ impetus -> impetuses|impetus
806
+ incubus -> incubuses|incubi
807
+ index -> indexes|indices
808
+ Indochinese -> Indochinese
809
+ inferno -> infernos
810
+ innings -> innings
811
+ Inspector General -> Inspectors General
812
+ interregnum -> interregnums|interregna
813
+ iris -> irises|irides
814
+ is -> are
815
+ is eaten -> are eaten
816
+ it -> they # NOMINATIVE
817
+ its -> their # POSSESSIVE FORM
818
+ itself -> themselves
819
+ jackanapes -> jackanapes
820
+ Japanese -> Japanese
821
+ Javanese -> Javanese
822
+ Jerry -> Jerrys
823
+ jerry -> jerries
824
+ jinx -> jinxes
825
+ jinxes -> jinx # VERB FORM
826
+ Johnsonese -> Johnsonese
827
+ Jones -> Joneses
828
+ jumbo -> jumbos
829
+ Kanarese -> Kanarese
830
+ Kiplingese -> Kiplingese
831
+ knife -> knives # NOUN FORM
832
+ knife -> knife # VERB FORM (1st/2nd pers.)
833
+ knifes -> knife # VERB FORM (3rd pers.)
834
+ Kongoese -> Kongoese
835
+ Kongolese -> Kongolese
836
+ lacuna -> lacunas|lacunae
837
+ lady in waiting -> ladies in waiting
838
+ Lapponese -> Lapponese
839
+ larynx -> larynxes|larynges
840
+ latex -> latexes|latices
841
+ leaf -> leaf # VERB FORM (1st/2nd pers.)
842
+ leaf -> leaves # NOUN FORM
843
+ leafs -> leaf # VERB FORM (3rd pers.)
844
+ Lebanese -> Lebanese
845
+ lemma -> lemmas|lemmata
846
+ lens -> lenses
847
+ Leonese -> Leonese
848
+ lick of the cat -> licks of the cat
849
+ Lieutenant General -> Lieutenant Generals
850
+ life -> lives
851
+ Liman -> Limans
852
+ lingo -> lingos
853
+ loaf -> loaves
854
+ locus -> loci
855
+ Londonese -> Londonese
856
+ Lorrainese -> Lorrainese
857
+ lothario -> lotharios
858
+ louse -> lice
859
+ Lucchese -> Lucchese
860
+ lumbago -> lumbagos
861
+ lumen -> lumens|lumina
862
+ lustrum -> lustrums|lustra
863
+ lyceum -> lyceums
864
+ lymphoma -> lymphomas|lymphomata
865
+ lynx -> lynxes
866
+ Lyonese -> Lyonese
867
+ M.I.A. -> M.I.A.s
868
+ Macanese -> Macanese
869
+ Macassarese -> Macassarese
870
+ mackerel -> mackerel
871
+ made -> made
872
+ Madurese -> Madurese
873
+ magma -> magmas|magmata
874
+ magneto -> magnetos
875
+ Major General -> Major Generals
876
+ Malabarese -> Malabarese
877
+ Maltese -> Maltese
878
+ man -> men
879
+ mandamus -> mandamuses
880
+ manifesto -> manifestos
881
+ mantis -> mantises
882
+ marquis -> marquises
883
+ Mary -> Marys
884
+ maximum -> maximums|maxima
885
+ measles -> measles
886
+ medico -> medicos
887
+ medium -> mediums|media
888
+ medium's -> mediums'|media's
889
+ medusa -> medusas|medusae
890
+ memorandum -> memorandums|memoranda
891
+ meniscus -> menisci
892
+ Messinese -> Messinese
893
+ metamorphosis -> metamorphoses
894
+ metropolis -> metropolises
895
+ mews -> mews
896
+ miasma -> miasmas|miasmata
897
+ Milanese -> Milanese
898
+ milieu -> milieus|milieux
899
+ millenium -> milleniums|millenia
900
+ minimum -> minimums|minima
901
+ minx -> minxes
902
+ miss -> miss # VERB FORM (1st/2nd pers.)
903
+ miss -> misses # NOUN FORM
904
+ misses -> miss # VERB FORM (3rd pers.)
905
+ mittamus -> mittamuses
906
+ Modenese -> Modenese
907
+ momentum -> momentums|momenta
908
+ money -> monies
909
+ mongoose -> mongooses
910
+ moose -> mooses|moose
911
+ mother-in-law -> mothers-in-law
912
+ mouse -> mice
913
+ mumps -> mumps
914
+ Muranese -> Muranese
915
+ murex -> murices
916
+ museum -> museums
917
+ mustachio -> mustachios
918
+ my -> our # POSSESSIVE FORM
919
+ myself -> ourselves
920
+ mythos -> mythoi
921
+ Nakayaman -> Nakayamans
922
+ Nankingese -> Nankingese
923
+ nasturtium -> nasturtiums
924
+ Navarrese -> Navarrese
925
+ nebula -> nebulas|nebulae
926
+ Nepalese -> Nepalese
927
+ neuritis -> neuritises
928
+ neurosis -> neuroses
929
+ news -> news
930
+ nexus -> nexus
931
+ Niasese -> Niasese
932
+ Nicobarese -> Nicobarese
933
+ nimbus -> nimbuses|nimbi
934
+ Nipponese -> Nipponese
935
+ no -> noes
936
+ nostrum -> nostrums
937
+ noumenon -> noumena
938
+ nova -> novas|novae
939
+ nucleolus -> nucleoluses|nucleoli
940
+ nucleus -> nuclei
941
+ oaf -> oafs
942
+ octavo -> octavos
943
+ octopus -> octopuses|octopodes
944
+ oedema -> oedemas|oedemata
945
+ Oklahoman -> Oklahomans
946
+ omnibus -> omnibuses
947
+ on it -> on them # ACCUSATIVE
948
+ onus -> onuses
949
+ opera -> operas
950
+ optimum -> optimums|optima
951
+ opus -> opuses|opera
952
+ organon -> organa
953
+ ought to be -> ought to be # VERB (UNLIKE bride to be)
954
+ ovum -> ova
955
+ ox -> oxen
956
+ ox's -> oxen's # POSSESSIVE FORM
957
+ oxymoron -> oxymorons|oxymora
958
+ Panaman -> Panamans
959
+ parabola -> parabolas|parabolae
960
+ Parmese -> Parmese
961
+ pathos -> pathoses
962
+ pegasus -> pegasuses
963
+ Pekingese -> Pekingese
964
+ pelvis -> pelvises
965
+ pendulum -> pendulums
966
+ penis -> penises|penes
967
+ penumbra -> penumbras|penumbrae
968
+ perihelion -> perihelia
969
+ persona -> personae
970
+ petroleum -> petroleums
971
+ phalanx -> phalanxes|phalanges
972
+ PhD -> PhDs
973
+ phenomenon -> phenomena
974
+ philtrum -> philtrums
975
+ photo -> photos
976
+ phylum -> phylums|phyla
977
+ piano -> pianos|piani
978
+ Piedmontese -> Piedmontese
979
+ pincer -> pincers
980
+ pincers -> pincers
981
+ Pistoiese -> Pistoiese
982
+ plateau -> plateaus|plateaux
983
+ play -> plays
984
+ plexus -> plexuses|plexus
985
+ pliers -> pliers
986
+ plies -> ply # VERB FORM
987
+ polis -> polises
988
+ Polonese -> Polonese
989
+ pontifex -> pontifexes|pontifices
990
+ portmanteau -> portmanteaus|portmanteaux
991
+ Portuguese -> Portuguese
992
+ potato -> potatoes
993
+ pox -> pox
994
+ pragma -> pragmas|pragmata
995
+ premium -> premiums
996
+ prima donna -> prima donnas|prime donne
997
+ pro -> pros
998
+ proceedings -> proceedings
999
+ prolegomenon -> prolegomena
1000
+ proof -> proofs
1001
+ proof of concept -> proofs of concept
1002
+ prosecutrix -> prosecutrixes|prosecutrices
1003
+ prospectus -> prospectuses|prospectus
1004
+ protozoan -> protozoans
1005
+ protozoon -> protozoa
1006
+ put -> put
1007
+ quantum -> quantums|quanta
1008
+ quartermaster general -> quartermasters general
1009
+ quarto -> quartos
1010
+ quorum -> quorums
1011
+ rabies -> rabies
1012
+ radius -> radiuses|radii
1013
+ radix -> radices
1014
+ rebus -> rebuses
1015
+ reindeer -> reindeer
1016
+ rhino -> rhinos
1017
+ rhinoceros -> rhinoceroses|rhinoceros
1018
+ Romagnese -> Romagnese
1019
+ Romanese -> Romanese
1020
+ romeo -> romeos
1021
+ roof -> roofs
1022
+ rostrum -> rostrums|rostra
1023
+ ruckus -> ruckuses
1024
+ salmon -> salmon
1025
+ Sangirese -> Sangirese
1026
+ sank -> sank
1027
+ Sarawakese -> Sarawakese
1028
+ sarcoma -> sarcomas|sarcomata
1029
+ sassafras -> sassafrases
1030
+ saw -> saws # NOUN FORM
1031
+ saw -> saw # VERB FORM (1st/2nd pers.)
1032
+ saws -> saw # VERB FORM (3rd pers.)
1033
+ scarf -> scarves
1034
+ schema -> schemas|schemata
1035
+ scissors -> scissors
1036
+ Scotsman -> Scotsmen
1037
+ sea-bass -> sea-bass
1038
+ self -> selves
1039
+ Selman -> Selmans
1040
+ Senegalese -> Senegalese
1041
+ seraph -> seraphs|seraphim
1042
+ series -> series
1043
+ shall eat -> shall eat
1044
+ Shavese -> Shavese
1045
+ Shawanese -> Shawanese
1046
+ she -> they
1047
+ sheaf -> sheaves
1048
+ shears -> shears
1049
+ sheep -> sheep
1050
+ shelf -> shelves
1051
+ should have -> should have
1052
+ Siamese -> Siamese
1053
+ Sienese -> Sienese
1054
+ Sikkimese -> Sikkimese
1055
+ silex -> silices
1056
+ simplex -> simplexes|simplices
1057
+ Singhalese -> Singhalese
1058
+ Sinhalese -> Sinhalese
1059
+ sinus -> sinuses|sinus
1060
+ size -> sizes
1061
+ sizes -> size #VERB FORM
1062
+ smallpox -> smallpox
1063
+ Smith -> Smiths
1064
+ Sogdianese -> Sogdianese
1065
+ soliloquy -> soliloquies
1066
+ solo -> solos|soli
1067
+ soma -> somas|somata
1068
+ son of a bitch -> sons of bitches
1069
+ Sonaman -> Sonamans
1070
+ soprano -> sopranos|soprani
1071
+ sought -> sought
1072
+ species -> species
1073
+ spectrum -> spectrums|spectra
1074
+ speculum -> speculums|specula
1075
+ spent -> spent
1076
+ spermatozoon -> spermatozoa
1077
+ sphinx -> sphinxes|sphinges
1078
+ stadium -> stadiums|stadia
1079
+ stamen -> stamens|stamina
1080
+ status -> statuses|status
1081
+ stereo -> stereos
1082
+ stigma -> stigmas|stigmata
1083
+ stimulus -> stimuli
1084
+ stoma -> stomas|stomata
1085
+ storey -> storeys
1086
+ story -> stories
1087
+ stratum -> strata
1088
+ strife -> strifes
1089
+ stylo -> stylos
1090
+ stylus -> styluses|styli
1091
+ succubus -> succubuses|succubi
1092
+ Sudanese -> Sudanese
1093
+ suffix -> suffixes
1094
+ Sundanese -> Sundanese
1095
+ superior -> superiors
1096
+ Surgeon-General -> Surgeons-General
1097
+ surplus -> surpluses
1098
+ Swahilese -> Swahilese
1099
+ swine -> swines|swine
1100
+ syringe -> syringes
1101
+ syrinx -> syrinxes|syringes
1102
+ tableau -> tableaus|tableaux
1103
+ Tacoman -> Tacomans
1104
+ tattoo -> tattoos
1105
+ tempo -> tempos|tempi
1106
+ Tenggerese -> Tenggerese
1107
+ testatrix -> testatrixes|testatrices
1108
+ testes -> testes
1109
+ testis -> testes
1110
+ that -> those
1111
+ their -> their # POSSESSIVE FORM (GENDER-INCLUSIVE)
1112
+ themself -> themselves # ugly but gaining currency
1113
+ they -> they # for indeterminate gender
1114
+ this -> these
1115
+ thought -> thought # VERB FORM
1116
+ thought -> thoughts # NOUN FORM
1117
+ Times -> Timeses
1118
+ Timorese -> Timorese
1119
+ Tirolese -> Tirolese
1120
+ to her -> to them
1121
+ to herself -> to themselves
1122
+ to him -> to them
1123
+ to himself -> to themselves
1124
+ to it -> to them
1125
+ to it -> to them # ACCUSATIVE
1126
+ to itself -> to themselves
1127
+ to me -> to us
1128
+ to myself -> to ourselves
1129
+ to them -> to them # for indeterminate gender
1130
+ to themself -> to themselves # ugly but gaining currency
1131
+ to you -> to you
1132
+ to yourself -> to yourselves
1133
+ Tocharese -> Tocharese
1134
+ tomato -> tomatoes
1135
+ Tonkinese -> Tonkinese
1136
+ tonsillitis -> tonsillitises
1137
+ tooth -> teeth
1138
+ Torinese -> Torinese
1139
+ torus -> toruses|tori
1140
+ trapezium -> trapeziums|trapezia
1141
+ trauma -> traumas|traumata
1142
+ travois -> travois
1143
+ trellis -> trellises
1144
+ tries -> try
1145
+ trilby -> trilbys
1146
+ trousers -> trousers
1147
+ trousseau -> trousseaus|trousseaux
1148
+ trout -> trout
1149
+ try -> tries
1150
+ tuna -> tuna
1151
+ turf -> turfs|turves
1152
+ Tyrolese -> Tyrolese
1153
+ ultimatum -> ultimatums|ultimata
1154
+ umbilicus -> umbilicuses|umbilici
1155
+ umbra -> umbras|umbrae
1156
+ uterus -> uteruses|uteri
1157
+ vacuum -> vacuums|vacua
1158
+ vellum -> vellums
1159
+ velum -> velums|vela
1160
+ Vermontese -> Vermontese
1161
+ Veronese -> Veronese
1162
+ vertebra -> vertebrae
1163
+ vertex -> vertexes|vertices
1164
+ Viennese -> Viennese
1165
+ Vietnamese -> Vietnamese
1166
+ virus -> viruses
1167
+ vixen -> vixens
1168
+ vortex -> vortexes|vortices
1169
+ walrus -> walruses
1170
+ was -> were
1171
+ was faced with -> were faced with
1172
+ was hoping -> were hoping
1173
+ Wenchowese -> Wenchowese
1174
+ were -> were
1175
+ were found -> were found
1176
+ wharf -> wharves
1177
+ whiting -> whiting
1178
+ Whitmanese -> Whitmanese
1179
+ wife -> wives
1180
+ wildebeest -> wildebeests|wildebeest
1181
+ will -> will # VERB FORM
1182
+ will -> wills # NOUN FORM
1183
+ will eat -> will eat # VERB FORM
1184
+ wills -> will # VERB FORM
1185
+ wish -> wishes
1186
+ with him -> with them
1187
+ with it -> with them # ACCUSATIVE
1188
+ wolf -> wolves
1189
+ woman -> women
1190
+ woman of substance -> women of substance
1191
+ woman's -> women's # POSSESSIVE FORM
1192
+ woodlouse -> woodlice
1193
+ Yakiman -> Yakimans
1194
+ Yengeese -> Yengeese
1195
+ Yokohaman -> Yokohamans
1196
+ you -> you
1197
+ your -> your # POSSESSIVE FORM
1198
+ yourself -> yourselves
1199
+ Yuman -> Yumans
1200
+ Yunnanese -> Yunnanese
1201
+ zoon -> zoa
1202
+
1203
+ an A.B.C
1204
+ an AI
1205
+ an AGE
1206
+ an agendum
1207
+ an aide-de-camp
1208
+ an albino
1209
+ a B.L.T. sandwich
1210
+ a BMW
1211
+ a BLANK
1212
+ a bacterium
1213
+ a Burmese restaurant
1214
+ a C.O.
1215
+ a CCD
1216
+ a COLON
1217
+ a cameo
1218
+ a CAPITAL
1219
+ a D.S.M.
1220
+ a DNR
1221
+ a DINNER
1222
+ a dynamo
1223
+ an E.K.G.
1224
+ an ECG
1225
+ an EGG
1226
+ an embryo
1227
+ an erratum
1228
+ a eucalyptus
1229
+ an Euler number
1230
+ a eulogy
1231
+ a euphemism
1232
+ a euphoria
1233
+ a ewe
1234
+ a ewer
1235
+ an extremum
1236
+ an eye
1237
+ an F.B.I. agent
1238
+ an FSM
1239
+ a FACT
1240
+ a FAQ
1241
+ an F.A.Q.
1242
+ a fish
1243
+ a G-string
1244
+ a GSM phone
1245
+ a GOD
1246
+ a genus
1247
+ a Governor General
1248
+ an H-Bomb
1249
+ an H.M.S Ark Royal
1250
+ an HSL colour space
1251
+ a HAL 9000
1252
+ an H.A.L. 9000
1253
+ a has-been
1254
+ a height
1255
+ an heir
1256
+ a honed blade
1257
+ an honest man
1258
+ a honeymoon
1259
+ an honorarium
1260
+ an honorary degree
1261
+ an honoree
1262
+ an honorific
1263
+ a Hough transform
1264
+ a hound
1265
+ an hour
1266
+ an hourglass
1267
+ a houri
1268
+ a house
1269
+ an I.O.U.
1270
+ an IQ
1271
+ an IDEA
1272
+ an inferno
1273
+ an Inspector General
1274
+ a jumbo
1275
+ a knife
1276
+ an L.E.D.
1277
+ a LED
1278
+ an LCD
1279
+ a lady in waiting
1280
+ a leaf
1281
+ an M.I.A.
1282
+ a MIASMA
1283
+ an MTV channel
1284
+ a Major General
1285
+ an N.C.O.
1286
+ an NCO
1287
+ a NATO country
1288
+ a note
1289
+ an O.K.
1290
+ an OK
1291
+ an OLE
1292
+ an octavo
1293
+ an octopus
1294
+ an okay
1295
+ a once-and-future-king
1296
+ an oncologist
1297
+ a one night stand
1298
+ an onerous task
1299
+ an opera
1300
+ an optimum
1301
+ an opus
1302
+ an ox
1303
+ a Ph.D.
1304
+ a PET
1305
+ a P.E.T. scan
1306
+ a plateau
1307
+ a quantum
1308
+ an R.S.V.P.
1309
+ an RSVP
1310
+ a REST
1311
+ a reindeer
1312
+ an S.O.S.
1313
+ a SUM
1314
+ an SST
1315
+ a salmon
1316
+ a T.N.T. bomb
1317
+ a TNT bomb
1318
+ a TENT
1319
+ a thought
1320
+ a tomato
1321
+ a U-boat
1322
+ a U.F.O.
1323
+ a UFO
1324
+ a ubiquity
1325
+ a unicorn
1326
+ an unidentified flying object
1327
+ a uniform
1328
+ a unimodal system
1329
+ an unimpressive record
1330
+ an uninformed opinion
1331
+ an uninvited guest
1332
+ a union
1333
+ a uniplex
1334
+ a uniprocessor
1335
+ a unique opportunity
1336
+ a unisex hairdresser
1337
+ a unison
1338
+ a unit
1339
+ a unitarian
1340
+ a united front
1341
+ a unity
1342
+ a univalent bond
1343
+ a univariate statistic
1344
+ a universe
1345
+ an unordered meal
1346
+ a uranium atom
1347
+ an urban myth
1348
+ an urbane miss
1349
+ an urchin
1350
+ a urea detector
1351
+ a urethane monomer
1352
+ an urge
1353
+ an urgency
1354
+ a urinal
1355
+ an urn
1356
+ a usage
1357
+ a use
1358
+ an usher
1359
+ a usual suspect
1360
+ a usurer
1361
+ a usurper
1362
+ a utensil
1363
+ a utility
1364
+ an utmost urgency
1365
+ a utopia
1366
+ an utterance
1367
+ a V.I.P.
1368
+ a VIPER
1369
+ a viper
1370
+ an X-ray
1371
+ an X.O.
1372
+ a XYLAPHONE
1373
+ an XY chromosome
1374
+ a xenophobe
1375
+ a Y-shaped pipe
1376
+ a Y.Z. plane
1377
+ a YMCA
1378
+ an YBLENT eye
1379
+ an yblent eye
1380
+ an yclad body
1381
+ a yellowing
1382
+ a yield
1383
+ a youth
1384
+ a youth
1385
+ an ypsiliform junction
1386
+ an yttrium atom
1387
+ a zoo
1388
+
1389
+ __END_DATA__