linguistics 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.simplecov +12 -0
- data/ChangeLog +773 -11
- data/History.rdoc +9 -0
- data/Manifest.txt +3 -2
- data/README.rdoc +5 -5
- data/Rakefile +49 -19
- data/examples/generalize_sentence.rb +2 -2
- data/lib/linguistics.rb +4 -4
- data/lib/linguistics/en/articles.rb +1 -1
- data/lib/linguistics/en/conjugation.rb +6 -6
- data/lib/linguistics/en/conjunctions.rb +1 -1
- data/lib/linguistics/en/infinitives.rb +1 -1
- data/lib/linguistics/en/linkparser.rb +11 -11
- data/lib/linguistics/en/numbers.rb +11 -11
- data/lib/linguistics/en/participles.rb +1 -1
- data/lib/linguistics/en/pluralization.rb +16 -16
- data/lib/linguistics/en/wordnet.rb +1 -1
- data/lib/linguistics/languagebehavior.rb +1 -1
- data/spec/{lib/constants.rb → constants.rb} +0 -0
- data/spec/helpers.rb +39 -0
- data/spec/linguistics/en/articles_spec.rb +194 -203
- data/spec/linguistics/en/conjugation_spec.rb +519 -521
- data/spec/linguistics/en/conjunctions_spec.rb +31 -47
- data/spec/linguistics/en/infinitives_spec.rb +193 -207
- data/spec/linguistics/en/linkparser_spec.rb +9 -20
- data/spec/linguistics/en/numbers_spec.rb +289 -302
- data/spec/linguistics/en/participles_spec.rb +6 -20
- data/spec/linguistics/en/pluralization_spec.rb +894 -908
- data/spec/linguistics/en/stemmer_spec.rb +10 -23
- data/spec/linguistics/en/titlecase_spec.rb +3 -13
- data/spec/linguistics/en/wordnet_spec.rb +10 -30
- data/spec/linguistics/en_spec.rb +14 -28
- data/spec/linguistics/inflector_spec.rb +3 -21
- data/spec/linguistics/iso639_spec.rb +28 -37
- data/spec/linguistics/monkeypatches_spec.rb +5 -14
- data/spec/linguistics_spec.rb +11 -30
- metadata +44 -15
- metadata.gz.sig +0 -0
- data/spec/lib/helpers.rb +0 -38
@@ -1,17 +1,8 @@
|
|
1
1
|
#!/usr/bin/env spec -cfs
|
2
2
|
|
3
|
-
|
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
|
-
}
|
3
|
+
require_relative '../../helpers'
|
12
4
|
|
13
5
|
require 'rspec'
|
14
|
-
require 'spec/lib/helpers'
|
15
6
|
|
16
7
|
require 'linguistics'
|
17
8
|
require 'linguistics/en/linkparser'
|
@@ -20,17 +11,12 @@ require 'linguistics/en/linkparser'
|
|
20
11
|
describe Linguistics::EN::LinkParser do
|
21
12
|
|
22
13
|
before( :all ) do
|
23
|
-
setup_logging( :fatal )
|
24
14
|
Linguistics.use( :en )
|
25
15
|
end
|
26
16
|
|
27
|
-
after( :all ) do
|
28
|
-
reset_logging()
|
29
|
-
end
|
30
|
-
|
31
17
|
|
32
18
|
it "adds EN::LinkParser to the list of English language modules" do
|
33
|
-
Linguistics::EN::MODULES.include
|
19
|
+
expect( Linguistics::EN::MODULES ).to include( Linguistics::EN::LinkParser )
|
34
20
|
end
|
35
21
|
|
36
22
|
|
@@ -39,7 +25,7 @@ describe Linguistics::EN::LinkParser do
|
|
39
25
|
it "can create a LinkParser::Sentence from a sentence in a string" do
|
40
26
|
pending "installation of the linkparser library" unless
|
41
27
|
Linguistics::EN.has_linkparser?
|
42
|
-
"This is a sentence.".en.sentence.
|
28
|
+
expect( "This is a sentence.".en.sentence ).to be_a( LinkParser::Sentence )
|
43
29
|
end
|
44
30
|
|
45
31
|
end
|
@@ -50,9 +36,12 @@ describe Linguistics::EN::LinkParser do
|
|
50
36
|
|
51
37
|
# If the system *does* have linkparser support, pretend it doesn't.
|
52
38
|
if Linguistics::EN.has_linkparser?
|
53
|
-
|
54
|
-
|
55
|
-
Linguistics::EN::LinkParser.
|
39
|
+
exception = LoadError.new( 'no such file to load -- linkparser' )
|
40
|
+
|
41
|
+
allow( Linguistics::EN::LinkParser ).to receive( :has_linkparser? ).
|
42
|
+
and_return( false )
|
43
|
+
allow( Linguistics::EN::LinkParser ).to receive( :lp_error ).
|
44
|
+
and_return( exception )
|
56
45
|
end
|
57
46
|
|
58
47
|
expect {
|
@@ -1,17 +1,8 @@
|
|
1
1
|
#!/usr/bin/env spec -cfs
|
2
2
|
|
3
|
-
|
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
|
-
}
|
3
|
+
require_relative '../../helpers'
|
12
4
|
|
13
5
|
require 'rspec'
|
14
|
-
require 'spec/lib/helpers'
|
15
6
|
|
16
7
|
require 'linguistics'
|
17
8
|
require 'linguistics/en/numbers'
|
@@ -20,1272 +11,1268 @@ require 'linguistics/en/numbers'
|
|
20
11
|
describe Linguistics::EN::Numbers do
|
21
12
|
|
22
13
|
before( :all ) do
|
23
|
-
setup_logging( :fatal )
|
24
14
|
Linguistics.use( :en )
|
25
15
|
end
|
26
16
|
|
27
|
-
after( :all ) do
|
28
|
-
reset_logging()
|
29
|
-
end
|
30
|
-
|
31
17
|
|
32
18
|
it "adds EN::Numbers to the list of English language modules" do
|
33
|
-
Linguistics::EN.
|
19
|
+
expect( Linguistics::EN ).to have_extension( :numbers )
|
34
20
|
end
|
35
21
|
|
22
|
+
|
36
23
|
describe "numbers to words" do
|
37
24
|
|
38
25
|
it "can transform 0 into english words" do
|
39
|
-
"0".en.numwords.
|
26
|
+
expect( "0".en.numwords ).to eq( "zero" )
|
40
27
|
end
|
41
28
|
|
42
29
|
it "can transform 0 into english words in single-digit groups" do
|
43
|
-
"0".en.numwords(
|
30
|
+
expect( "0".en.numwords(group: 1) ).to eq( "zero" )
|
44
31
|
end
|
45
32
|
|
46
33
|
it "can transform 0 into english words in double-digit groups" do
|
47
|
-
"0".en.numwords(
|
34
|
+
expect( "0".en.numwords(group: 2) ).to eq( "zero" )
|
48
35
|
end
|
49
36
|
|
50
37
|
it "can transform 0 into english words in triple-digit groups" do
|
51
|
-
"0".en.numwords(
|
38
|
+
expect( "0".en.numwords(group: 3) ).to eq( "zero" )
|
52
39
|
end
|
53
40
|
|
54
41
|
|
55
42
|
it "can transform the english words for 0 into an ordinal" do
|
56
|
-
"0".en.numwords.en.ordinal.
|
43
|
+
expect( "0".en.numwords.en.ordinal ).to eq( "zeroth" )
|
57
44
|
end
|
58
45
|
|
59
46
|
|
60
47
|
it "can transform 1 into english words" do
|
61
|
-
"1".en.numwords.
|
48
|
+
expect( "1".en.numwords ).to eq( "one" )
|
62
49
|
end
|
63
50
|
|
64
51
|
it "can transform 1 into english words in single-digit groups" do
|
65
|
-
"1".en.numwords(
|
52
|
+
expect( "1".en.numwords(group: 1) ).to eq( "one" )
|
66
53
|
end
|
67
54
|
|
68
55
|
it "can transform 1 into english words in double-digit groups" do
|
69
|
-
"1".en.numwords(
|
56
|
+
expect( "1".en.numwords(group: 2) ).to eq( "one" )
|
70
57
|
end
|
71
58
|
|
72
59
|
it "can transform 1 into english words in triple-digit groups" do
|
73
|
-
"1".en.numwords(
|
60
|
+
expect( "1".en.numwords(group: 3) ).to eq( "one" )
|
74
61
|
end
|
75
62
|
|
76
63
|
|
77
64
|
it "can transform the english words for 1 into an ordinal" do
|
78
|
-
"1".en.numwords.en.ordinal.
|
65
|
+
expect( "1".en.numwords.en.ordinal ).to eq( "first" )
|
79
66
|
end
|
80
67
|
|
81
68
|
|
82
69
|
it "can transform 2 into english words" do
|
83
|
-
"2".en.numwords.
|
70
|
+
expect( "2".en.numwords ).to eq( "two" )
|
84
71
|
end
|
85
72
|
|
86
73
|
it "can transform 2 into english words in single-digit groups" do
|
87
|
-
"2".en.numwords(
|
74
|
+
expect( "2".en.numwords(group: 1) ).to eq( "two" )
|
88
75
|
end
|
89
76
|
|
90
77
|
it "can transform 2 into english words in double-digit groups" do
|
91
|
-
"2".en.numwords(
|
78
|
+
expect( "2".en.numwords(group: 2) ).to eq( "two" )
|
92
79
|
end
|
93
80
|
|
94
81
|
it "can transform 2 into english words in triple-digit groups" do
|
95
|
-
"2".en.numwords(
|
82
|
+
expect( "2".en.numwords(group: 3) ).to eq( "two" )
|
96
83
|
end
|
97
84
|
|
98
85
|
|
99
86
|
it "can transform the english words for 2 into an ordinal" do
|
100
|
-
"2".en.numwords.en.ordinal.
|
87
|
+
expect( "2".en.numwords.en.ordinal ).to eq( "second" )
|
101
88
|
end
|
102
89
|
|
103
90
|
|
104
91
|
it "can transform 3 into english words" do
|
105
|
-
"3".en.numwords.
|
92
|
+
expect( "3".en.numwords ).to eq( "three" )
|
106
93
|
end
|
107
94
|
|
108
95
|
it "can transform 3 into english words in single-digit groups" do
|
109
|
-
"3".en.numwords(
|
96
|
+
expect( "3".en.numwords(group: 1) ).to eq( "three" )
|
110
97
|
end
|
111
98
|
|
112
99
|
it "can transform 3 into english words in double-digit groups" do
|
113
|
-
"3".en.numwords(
|
100
|
+
expect( "3".en.numwords(group: 2) ).to eq( "three" )
|
114
101
|
end
|
115
102
|
|
116
103
|
it "can transform 3 into english words in triple-digit groups" do
|
117
|
-
"3".en.numwords(
|
104
|
+
expect( "3".en.numwords(group: 3) ).to eq( "three" )
|
118
105
|
end
|
119
106
|
|
120
107
|
|
121
108
|
it "can transform the english words for 3 into an ordinal" do
|
122
|
-
"3".en.numwords.en.ordinal.
|
109
|
+
expect( "3".en.numwords.en.ordinal ).to eq( "third" )
|
123
110
|
end
|
124
111
|
|
125
112
|
|
126
113
|
it "can transform 4 into english words" do
|
127
|
-
"4".en.numwords.
|
114
|
+
expect( "4".en.numwords ).to eq( "four" )
|
128
115
|
end
|
129
116
|
|
130
117
|
it "can transform 4 into english words in single-digit groups" do
|
131
|
-
"4".en.numwords(
|
118
|
+
expect( "4".en.numwords(group: 1) ).to eq( "four" )
|
132
119
|
end
|
133
120
|
|
134
121
|
it "can transform 4 into english words in double-digit groups" do
|
135
|
-
"4".en.numwords(
|
122
|
+
expect( "4".en.numwords(group: 2) ).to eq( "four" )
|
136
123
|
end
|
137
124
|
|
138
125
|
it "can transform 4 into english words in triple-digit groups" do
|
139
|
-
"4".en.numwords(
|
126
|
+
expect( "4".en.numwords(group: 3) ).to eq( "four" )
|
140
127
|
end
|
141
128
|
|
142
129
|
|
143
130
|
it "can transform the english words for 4 into an ordinal" do
|
144
|
-
"4".en.numwords.en.ordinal.
|
131
|
+
expect( "4".en.numwords.en.ordinal ).to eq( "fourth" )
|
145
132
|
end
|
146
133
|
|
147
134
|
|
148
135
|
it "can transform 5 into english words" do
|
149
|
-
"5".en.numwords.
|
136
|
+
expect( "5".en.numwords ).to eq( "five" )
|
150
137
|
end
|
151
138
|
|
152
139
|
it "can transform 5 into english words in single-digit groups" do
|
153
|
-
"5".en.numwords(
|
140
|
+
expect( "5".en.numwords(group: 1) ).to eq( "five" )
|
154
141
|
end
|
155
142
|
|
156
143
|
it "can transform 5 into english words in double-digit groups" do
|
157
|
-
"5".en.numwords(
|
144
|
+
expect( "5".en.numwords(group: 2) ).to eq( "five" )
|
158
145
|
end
|
159
146
|
|
160
147
|
it "can transform 5 into english words in triple-digit groups" do
|
161
|
-
"5".en.numwords(
|
148
|
+
expect( "5".en.numwords(group: 3) ).to eq( "five" )
|
162
149
|
end
|
163
150
|
|
164
151
|
|
165
152
|
it "can transform the english words for 5 into an ordinal" do
|
166
|
-
"5".en.numwords.en.ordinal.
|
153
|
+
expect( "5".en.numwords.en.ordinal ).to eq( "fifth" )
|
167
154
|
end
|
168
155
|
|
169
156
|
|
170
157
|
it "can transform 6 into english words" do
|
171
|
-
"6".en.numwords.
|
158
|
+
expect( "6".en.numwords ).to eq( "six" )
|
172
159
|
end
|
173
160
|
|
174
161
|
it "can transform 6 into english words in single-digit groups" do
|
175
|
-
"6".en.numwords(
|
162
|
+
expect( "6".en.numwords(group: 1) ).to eq( "six" )
|
176
163
|
end
|
177
164
|
|
178
165
|
it "can transform 6 into english words in double-digit groups" do
|
179
|
-
"6".en.numwords(
|
166
|
+
expect( "6".en.numwords(group: 2) ).to eq( "six" )
|
180
167
|
end
|
181
168
|
|
182
169
|
it "can transform 6 into english words in triple-digit groups" do
|
183
|
-
"6".en.numwords(
|
170
|
+
expect( "6".en.numwords(group: 3) ).to eq( "six" )
|
184
171
|
end
|
185
172
|
|
186
173
|
|
187
174
|
it "can transform the english words for 6 into an ordinal" do
|
188
|
-
"6".en.numwords.en.ordinal.
|
175
|
+
expect( "6".en.numwords.en.ordinal ).to eq( "sixth" )
|
189
176
|
end
|
190
177
|
|
191
178
|
|
192
179
|
it "can transform 7 into english words" do
|
193
|
-
"7".en.numwords.
|
180
|
+
expect( "7".en.numwords ).to eq( "seven" )
|
194
181
|
end
|
195
182
|
|
196
183
|
it "can transform 7 into english words in single-digit groups" do
|
197
|
-
"7".en.numwords(
|
184
|
+
expect( "7".en.numwords(group: 1) ).to eq( "seven" )
|
198
185
|
end
|
199
186
|
|
200
187
|
it "can transform 7 into english words in double-digit groups" do
|
201
|
-
"7".en.numwords(
|
188
|
+
expect( "7".en.numwords(group: 2) ).to eq( "seven" )
|
202
189
|
end
|
203
190
|
|
204
191
|
it "can transform 7 into english words in triple-digit groups" do
|
205
|
-
"7".en.numwords(
|
192
|
+
expect( "7".en.numwords(group: 3) ).to eq( "seven" )
|
206
193
|
end
|
207
194
|
|
208
195
|
|
209
196
|
it "can transform the english words for 7 into an ordinal" do
|
210
|
-
"7".en.numwords.en.ordinal.
|
197
|
+
expect( "7".en.numwords.en.ordinal ).to eq( "seventh" )
|
211
198
|
end
|
212
199
|
|
213
200
|
|
214
201
|
it "can transform 8 into english words" do
|
215
|
-
"8".en.numwords.
|
202
|
+
expect( "8".en.numwords ).to eq( "eight" )
|
216
203
|
end
|
217
204
|
|
218
205
|
it "can transform 8 into english words in single-digit groups" do
|
219
|
-
"8".en.numwords(
|
206
|
+
expect( "8".en.numwords(group: 1) ).to eq( "eight" )
|
220
207
|
end
|
221
208
|
|
222
209
|
it "can transform 8 into english words in double-digit groups" do
|
223
|
-
"8".en.numwords(
|
210
|
+
expect( "8".en.numwords(group: 2) ).to eq( "eight" )
|
224
211
|
end
|
225
212
|
|
226
213
|
it "can transform 8 into english words in triple-digit groups" do
|
227
|
-
"8".en.numwords(
|
214
|
+
expect( "8".en.numwords(group: 3) ).to eq( "eight" )
|
228
215
|
end
|
229
216
|
|
230
217
|
|
231
218
|
it "can transform the english words for 8 into an ordinal" do
|
232
|
-
"8".en.numwords.en.ordinal.
|
219
|
+
expect( "8".en.numwords.en.ordinal ).to eq( "eighth" )
|
233
220
|
end
|
234
221
|
|
235
222
|
|
236
223
|
it "can transform 9 into english words" do
|
237
|
-
"9".en.numwords.
|
224
|
+
expect( "9".en.numwords ).to eq( "nine" )
|
238
225
|
end
|
239
226
|
|
240
227
|
it "can transform 9 into english words in single-digit groups" do
|
241
|
-
"9".en.numwords(
|
228
|
+
expect( "9".en.numwords(group: 1) ).to eq( "nine" )
|
242
229
|
end
|
243
230
|
|
244
231
|
it "can transform 9 into english words in double-digit groups" do
|
245
|
-
"9".en.numwords(
|
232
|
+
expect( "9".en.numwords(group: 2) ).to eq( "nine" )
|
246
233
|
end
|
247
234
|
|
248
235
|
it "can transform 9 into english words in triple-digit groups" do
|
249
|
-
"9".en.numwords(
|
236
|
+
expect( "9".en.numwords(group: 3) ).to eq( "nine" )
|
250
237
|
end
|
251
238
|
|
252
239
|
|
253
240
|
it "can transform the english words for 9 into an ordinal" do
|
254
|
-
"9".en.numwords.en.ordinal.
|
241
|
+
expect( "9".en.numwords.en.ordinal ).to eq( "ninth" )
|
255
242
|
end
|
256
243
|
|
257
244
|
|
258
245
|
it "can transform 10 into english words" do
|
259
|
-
"10".en.numwords.
|
246
|
+
expect( "10".en.numwords ).to eq( "ten" )
|
260
247
|
end
|
261
248
|
|
262
249
|
it "can transform 10 into english words in single-digit groups" do
|
263
|
-
"10".en.numwords(
|
250
|
+
expect( "10".en.numwords(group: 1) ).to eq( "one, zero" )
|
264
251
|
end
|
265
252
|
|
266
253
|
it "can transform 10 into english words in double-digit groups" do
|
267
|
-
"10".en.numwords(
|
254
|
+
expect( "10".en.numwords(group: 2) ).to eq( "ten" )
|
268
255
|
end
|
269
256
|
|
270
257
|
it "can transform 10 into english words in triple-digit groups" do
|
271
|
-
"10".en.numwords(
|
258
|
+
expect( "10".en.numwords(group: 3) ).to eq( "ten" )
|
272
259
|
end
|
273
260
|
|
274
261
|
|
275
262
|
it "can transform the english words for 10 into an ordinal" do
|
276
|
-
"10".en.numwords.en.ordinal.
|
263
|
+
expect( "10".en.numwords.en.ordinal ).to eq( "tenth" )
|
277
264
|
end
|
278
265
|
|
279
266
|
|
280
267
|
it "can transform 11 into english words" do
|
281
|
-
"11".en.numwords.
|
268
|
+
expect( "11".en.numwords ).to eq( "eleven" )
|
282
269
|
end
|
283
270
|
|
284
271
|
it "can transform 11 into english words in single-digit groups" do
|
285
|
-
"11".en.numwords(
|
272
|
+
expect( "11".en.numwords(group: 1) ).to eq( "one, one" )
|
286
273
|
end
|
287
274
|
|
288
275
|
it "can transform 11 into english words in double-digit groups" do
|
289
|
-
"11".en.numwords(
|
276
|
+
expect( "11".en.numwords(group: 2) ).to eq( "eleven" )
|
290
277
|
end
|
291
278
|
|
292
279
|
it "can transform 11 into english words in triple-digit groups" do
|
293
|
-
"11".en.numwords(
|
280
|
+
expect( "11".en.numwords(group: 3) ).to eq( "eleven" )
|
294
281
|
end
|
295
282
|
|
296
283
|
|
297
284
|
it "can transform the english words for 11 into an ordinal" do
|
298
|
-
"11".en.numwords.en.ordinal.
|
285
|
+
expect( "11".en.numwords.en.ordinal ).to eq( "eleventh" )
|
299
286
|
end
|
300
287
|
|
301
288
|
|
302
289
|
it "can transform 12 into english words" do
|
303
|
-
"12".en.numwords.
|
290
|
+
expect( "12".en.numwords ).to eq( "twelve" )
|
304
291
|
end
|
305
292
|
|
306
293
|
it "can transform 12 into english words in single-digit groups" do
|
307
|
-
"12".en.numwords(
|
294
|
+
expect( "12".en.numwords(group: 1) ).to eq( "one, two" )
|
308
295
|
end
|
309
296
|
|
310
297
|
it "can transform 12 into english words in double-digit groups" do
|
311
|
-
"12".en.numwords(
|
298
|
+
expect( "12".en.numwords(group: 2) ).to eq( "twelve" )
|
312
299
|
end
|
313
300
|
|
314
301
|
it "can transform 12 into english words in triple-digit groups" do
|
315
|
-
"12".en.numwords(
|
302
|
+
expect( "12".en.numwords(group: 3) ).to eq( "twelve" )
|
316
303
|
end
|
317
304
|
|
318
305
|
|
319
306
|
it "can transform the english words for 12 into an ordinal" do
|
320
|
-
"12".en.numwords.en.ordinal.
|
307
|
+
expect( "12".en.numwords.en.ordinal ).to eq( "twelfth" )
|
321
308
|
end
|
322
309
|
|
323
310
|
|
324
311
|
it "can transform 13 into english words" do
|
325
|
-
"13".en.numwords.
|
312
|
+
expect( "13".en.numwords ).to eq( "thirteen" )
|
326
313
|
end
|
327
314
|
|
328
315
|
it "can transform 13 into english words in single-digit groups" do
|
329
|
-
"13".en.numwords(
|
316
|
+
expect( "13".en.numwords(group: 1) ).to eq( "one, three" )
|
330
317
|
end
|
331
318
|
|
332
319
|
it "can transform 13 into english words in double-digit groups" do
|
333
|
-
"13".en.numwords(
|
320
|
+
expect( "13".en.numwords(group: 2) ).to eq( "thirteen" )
|
334
321
|
end
|
335
322
|
|
336
323
|
it "can transform 13 into english words in triple-digit groups" do
|
337
|
-
"13".en.numwords(
|
324
|
+
expect( "13".en.numwords(group: 3) ).to eq( "thirteen" )
|
338
325
|
end
|
339
326
|
|
340
327
|
|
341
328
|
it "can transform the english words for 13 into an ordinal" do
|
342
|
-
"13".en.numwords.en.ordinal.
|
329
|
+
expect( "13".en.numwords.en.ordinal ).to eq( "thirteenth" )
|
343
330
|
end
|
344
331
|
|
345
332
|
|
346
333
|
it "can transform 14 into english words" do
|
347
|
-
"14".en.numwords.
|
334
|
+
expect( "14".en.numwords ).to eq( "fourteen" )
|
348
335
|
end
|
349
336
|
|
350
337
|
it "can transform 14 into english words in single-digit groups" do
|
351
|
-
"14".en.numwords(
|
338
|
+
expect( "14".en.numwords(group: 1) ).to eq( "one, four" )
|
352
339
|
end
|
353
340
|
|
354
341
|
it "can transform 14 into english words in double-digit groups" do
|
355
|
-
"14".en.numwords(
|
342
|
+
expect( "14".en.numwords(group: 2) ).to eq( "fourteen" )
|
356
343
|
end
|
357
344
|
|
358
345
|
it "can transform 14 into english words in triple-digit groups" do
|
359
|
-
"14".en.numwords(
|
346
|
+
expect( "14".en.numwords(group: 3) ).to eq( "fourteen" )
|
360
347
|
end
|
361
348
|
|
362
349
|
|
363
350
|
it "can transform the english words for 14 into an ordinal" do
|
364
|
-
"14".en.numwords.en.ordinal.
|
351
|
+
expect( "14".en.numwords.en.ordinal ).to eq( "fourteenth" )
|
365
352
|
end
|
366
353
|
|
367
354
|
|
368
355
|
it "can transform 15 into english words" do
|
369
|
-
"15".en.numwords.
|
356
|
+
expect( "15".en.numwords ).to eq( "fifteen" )
|
370
357
|
end
|
371
358
|
|
372
359
|
it "can transform 15 into english words in single-digit groups" do
|
373
|
-
"15".en.numwords(
|
360
|
+
expect( "15".en.numwords(group: 1) ).to eq( "one, five" )
|
374
361
|
end
|
375
362
|
|
376
363
|
it "can transform 15 into english words in double-digit groups" do
|
377
|
-
"15".en.numwords(
|
364
|
+
expect( "15".en.numwords(group: 2) ).to eq( "fifteen" )
|
378
365
|
end
|
379
366
|
|
380
367
|
it "can transform 15 into english words in triple-digit groups" do
|
381
|
-
"15".en.numwords(
|
368
|
+
expect( "15".en.numwords(group: 3) ).to eq( "fifteen" )
|
382
369
|
end
|
383
370
|
|
384
371
|
|
385
372
|
it "can transform the english words for 15 into an ordinal" do
|
386
|
-
"15".en.numwords.en.ordinal.
|
373
|
+
expect( "15".en.numwords.en.ordinal ).to eq( "fifteenth" )
|
387
374
|
end
|
388
375
|
|
389
376
|
|
390
377
|
it "can transform 16 into english words" do
|
391
|
-
"16".en.numwords.
|
378
|
+
expect( "16".en.numwords ).to eq( "sixteen" )
|
392
379
|
end
|
393
380
|
|
394
381
|
it "can transform 16 into english words in single-digit groups" do
|
395
|
-
"16".en.numwords(
|
382
|
+
expect( "16".en.numwords(group: 1) ).to eq( "one, six" )
|
396
383
|
end
|
397
384
|
|
398
385
|
it "can transform 16 into english words in double-digit groups" do
|
399
|
-
"16".en.numwords(
|
386
|
+
expect( "16".en.numwords(group: 2) ).to eq( "sixteen" )
|
400
387
|
end
|
401
388
|
|
402
389
|
it "can transform 16 into english words in triple-digit groups" do
|
403
|
-
"16".en.numwords(
|
390
|
+
expect( "16".en.numwords(group: 3) ).to eq( "sixteen" )
|
404
391
|
end
|
405
392
|
|
406
393
|
|
407
394
|
it "can transform the english words for 16 into an ordinal" do
|
408
|
-
"16".en.numwords.en.ordinal.
|
395
|
+
expect( "16".en.numwords.en.ordinal ).to eq( "sixteenth" )
|
409
396
|
end
|
410
397
|
|
411
398
|
|
412
399
|
it "can transform 17 into english words" do
|
413
|
-
"17".en.numwords.
|
400
|
+
expect( "17".en.numwords ).to eq( "seventeen" )
|
414
401
|
end
|
415
402
|
|
416
403
|
it "can transform 17 into english words in single-digit groups" do
|
417
|
-
"17".en.numwords(
|
404
|
+
expect( "17".en.numwords(group: 1) ).to eq( "one, seven" )
|
418
405
|
end
|
419
406
|
|
420
407
|
it "can transform 17 into english words in double-digit groups" do
|
421
|
-
"17".en.numwords(
|
408
|
+
expect( "17".en.numwords(group: 2) ).to eq( "seventeen" )
|
422
409
|
end
|
423
410
|
|
424
411
|
it "can transform 17 into english words in triple-digit groups" do
|
425
|
-
"17".en.numwords(
|
412
|
+
expect( "17".en.numwords(group: 3) ).to eq( "seventeen" )
|
426
413
|
end
|
427
414
|
|
428
415
|
|
429
416
|
it "can transform the english words for 17 into an ordinal" do
|
430
|
-
"17".en.numwords.en.ordinal.
|
417
|
+
expect( "17".en.numwords.en.ordinal ).to eq( "seventeenth" )
|
431
418
|
end
|
432
419
|
|
433
420
|
|
434
421
|
it "can transform 18 into english words" do
|
435
|
-
"18".en.numwords.
|
422
|
+
expect( "18".en.numwords ).to eq( "eighteen" )
|
436
423
|
end
|
437
424
|
|
438
425
|
it "can transform 18 into english words in single-digit groups" do
|
439
|
-
"18".en.numwords(
|
426
|
+
expect( "18".en.numwords(group: 1) ).to eq( "one, eight" )
|
440
427
|
end
|
441
428
|
|
442
429
|
it "can transform 18 into english words in double-digit groups" do
|
443
|
-
"18".en.numwords(
|
430
|
+
expect( "18".en.numwords(group: 2) ).to eq( "eighteen" )
|
444
431
|
end
|
445
432
|
|
446
433
|
it "can transform 18 into english words in triple-digit groups" do
|
447
|
-
"18".en.numwords(
|
434
|
+
expect( "18".en.numwords(group: 3) ).to eq( "eighteen" )
|
448
435
|
end
|
449
436
|
|
450
437
|
|
451
438
|
it "can transform the english words for 18 into an ordinal" do
|
452
|
-
"18".en.numwords.en.ordinal.
|
439
|
+
expect( "18".en.numwords.en.ordinal ).to eq( "eighteenth" )
|
453
440
|
end
|
454
441
|
|
455
442
|
|
456
443
|
it "can transform 19 into english words" do
|
457
|
-
"19".en.numwords.
|
444
|
+
expect( "19".en.numwords ).to eq( "nineteen" )
|
458
445
|
end
|
459
446
|
|
460
447
|
it "can transform 19 into english words in single-digit groups" do
|
461
|
-
"19".en.numwords(
|
448
|
+
expect( "19".en.numwords(group: 1) ).to eq( "one, nine" )
|
462
449
|
end
|
463
450
|
|
464
451
|
it "can transform 19 into english words in double-digit groups" do
|
465
|
-
"19".en.numwords(
|
452
|
+
expect( "19".en.numwords(group: 2) ).to eq( "nineteen" )
|
466
453
|
end
|
467
454
|
|
468
455
|
it "can transform 19 into english words in triple-digit groups" do
|
469
|
-
"19".en.numwords(
|
456
|
+
expect( "19".en.numwords(group: 3) ).to eq( "nineteen" )
|
470
457
|
end
|
471
458
|
|
472
459
|
|
473
460
|
it "can transform the english words for 19 into an ordinal" do
|
474
|
-
"19".en.numwords.en.ordinal.
|
461
|
+
expect( "19".en.numwords.en.ordinal ).to eq( "nineteenth" )
|
475
462
|
end
|
476
463
|
|
477
464
|
|
478
465
|
it "can transform 20 into english words" do
|
479
|
-
"20".en.numwords.
|
466
|
+
expect( "20".en.numwords ).to eq( "twenty" )
|
480
467
|
end
|
481
468
|
|
482
469
|
it "can transform 20 into english words in single-digit groups" do
|
483
|
-
"20".en.numwords(
|
470
|
+
expect( "20".en.numwords(group: 1) ).to eq( "two, zero" )
|
484
471
|
end
|
485
472
|
|
486
473
|
it "can transform 20 into english words in double-digit groups" do
|
487
|
-
"20".en.numwords(
|
474
|
+
expect( "20".en.numwords(group: 2) ).to eq( "twenty" )
|
488
475
|
end
|
489
476
|
|
490
477
|
it "can transform 20 into english words in triple-digit groups" do
|
491
|
-
"20".en.numwords(
|
478
|
+
expect( "20".en.numwords(group: 3) ).to eq( "twenty" )
|
492
479
|
end
|
493
480
|
|
494
481
|
|
495
482
|
it "can transform the english words for 20 into an ordinal" do
|
496
|
-
"20".en.numwords.en.ordinal.
|
483
|
+
expect( "20".en.numwords.en.ordinal ).to eq( "twentieth" )
|
497
484
|
end
|
498
485
|
|
499
486
|
|
500
487
|
it "can transform 21 into english words" do
|
501
|
-
"21".en.numwords.
|
488
|
+
expect( "21".en.numwords ).to eq( "twenty-one" )
|
502
489
|
end
|
503
490
|
|
504
491
|
it "can transform 21 into english words in single-digit groups" do
|
505
|
-
"21".en.numwords(
|
492
|
+
expect( "21".en.numwords(group: 1) ).to eq( "two, one" )
|
506
493
|
end
|
507
494
|
|
508
495
|
it "can transform 21 into english words in double-digit groups" do
|
509
|
-
"21".en.numwords(
|
496
|
+
expect( "21".en.numwords(group: 2) ).to eq( "twenty-one" )
|
510
497
|
end
|
511
498
|
|
512
499
|
it "can transform 21 into english words in triple-digit groups" do
|
513
|
-
"21".en.numwords(
|
500
|
+
expect( "21".en.numwords(group: 3) ).to eq( "twenty-one" )
|
514
501
|
end
|
515
502
|
|
516
503
|
|
517
504
|
it "can transform the english words for 21 into an ordinal" do
|
518
|
-
"21".en.numwords.en.ordinal.
|
505
|
+
expect( "21".en.numwords.en.ordinal ).to eq( "twenty-first" )
|
519
506
|
end
|
520
507
|
|
521
508
|
|
522
509
|
it "can transform 29 into english words" do
|
523
|
-
"29".en.numwords.
|
510
|
+
expect( "29".en.numwords ).to eq( "twenty-nine" )
|
524
511
|
end
|
525
512
|
|
526
513
|
it "can transform 29 into english words in single-digit groups" do
|
527
|
-
"29".en.numwords(
|
514
|
+
expect( "29".en.numwords(group: 1) ).to eq( "two, nine" )
|
528
515
|
end
|
529
516
|
|
530
517
|
it "can transform 29 into english words in double-digit groups" do
|
531
|
-
"29".en.numwords(
|
518
|
+
expect( "29".en.numwords(group: 2) ).to eq( "twenty-nine" )
|
532
519
|
end
|
533
520
|
|
534
521
|
it "can transform 29 into english words in triple-digit groups" do
|
535
|
-
"29".en.numwords(
|
522
|
+
expect( "29".en.numwords(group: 3) ).to eq( "twenty-nine" )
|
536
523
|
end
|
537
524
|
|
538
525
|
|
539
526
|
it "can transform the english words for 29 into an ordinal" do
|
540
|
-
"29".en.numwords.en.ordinal.
|
527
|
+
expect( "29".en.numwords.en.ordinal ).to eq( "twenty-ninth" )
|
541
528
|
end
|
542
529
|
|
543
530
|
|
544
531
|
it "can transform 99 into english words" do
|
545
|
-
"99".en.numwords.
|
532
|
+
expect( "99".en.numwords ).to eq( "ninety-nine" )
|
546
533
|
end
|
547
534
|
|
548
535
|
it "can transform 99 into english words in single-digit groups" do
|
549
|
-
"99".en.numwords(
|
536
|
+
expect( "99".en.numwords(group: 1) ).to eq( "nine, nine" )
|
550
537
|
end
|
551
538
|
|
552
539
|
it "can transform 99 into english words in double-digit groups" do
|
553
|
-
"99".en.numwords(
|
540
|
+
expect( "99".en.numwords(group: 2) ).to eq( "ninety-nine" )
|
554
541
|
end
|
555
542
|
|
556
543
|
it "can transform 99 into english words in triple-digit groups" do
|
557
|
-
"99".en.numwords(
|
544
|
+
expect( "99".en.numwords(group: 3) ).to eq( "ninety-nine" )
|
558
545
|
end
|
559
546
|
|
560
547
|
|
561
548
|
it "can transform the english words for 99 into an ordinal" do
|
562
|
-
"99".en.numwords.en.ordinal.
|
549
|
+
expect( "99".en.numwords.en.ordinal ).to eq( "ninety-ninth" )
|
563
550
|
end
|
564
551
|
|
565
552
|
|
566
553
|
it "can transform 100 into english words" do
|
567
|
-
"100".en.numwords.
|
554
|
+
expect( "100".en.numwords ).to eq( "one hundred" )
|
568
555
|
end
|
569
556
|
|
570
557
|
it "can transform 100 into english words in single-digit groups" do
|
571
|
-
"100".en.numwords(
|
558
|
+
expect( "100".en.numwords(group: 1) ).to eq( "one, zero, zero" )
|
572
559
|
end
|
573
560
|
|
574
561
|
it "can transform 100 into english words in double-digit groups" do
|
575
|
-
"100".en.numwords(
|
562
|
+
expect( "100".en.numwords(group: 2) ).to eq( "ten, zero" )
|
576
563
|
end
|
577
564
|
|
578
565
|
it "can transform 100 into english words in triple-digit groups" do
|
579
|
-
"100".en.numwords(
|
566
|
+
expect( "100".en.numwords(group: 3) ).to eq( "one zero zero" )
|
580
567
|
end
|
581
568
|
|
582
569
|
|
583
570
|
it "can transform the english words for 100 into an ordinal" do
|
584
|
-
"100".en.numwords.en.ordinal.
|
571
|
+
expect( "100".en.numwords.en.ordinal ).to eq( "one hundredth" )
|
585
572
|
end
|
586
573
|
|
587
574
|
|
588
575
|
it "can transform 101 into english words" do
|
589
|
-
"101".en.numwords.
|
576
|
+
expect( "101".en.numwords ).to eq( "one hundred and one" )
|
590
577
|
end
|
591
578
|
|
592
579
|
it "can transform 101 into english words in single-digit groups" do
|
593
|
-
"101".en.numwords(
|
580
|
+
expect( "101".en.numwords(group: 1) ).to eq( "one, zero, one" )
|
594
581
|
end
|
595
582
|
|
596
583
|
it "can transform 101 into english words in double-digit groups" do
|
597
|
-
"101".en.numwords(
|
584
|
+
expect( "101".en.numwords(group: 2) ).to eq( "ten, one" )
|
598
585
|
end
|
599
586
|
|
600
587
|
it "can transform 101 into english words in triple-digit groups" do
|
601
|
-
"101".en.numwords(
|
588
|
+
expect( "101".en.numwords(group: 3) ).to eq( "one zero one" )
|
602
589
|
end
|
603
590
|
|
604
591
|
|
605
592
|
it "can transform the english words for 101 into an ordinal" do
|
606
|
-
"101".en.numwords.en.ordinal.
|
593
|
+
expect( "101".en.numwords.en.ordinal ).to eq( "one hundred and first" )
|
607
594
|
end
|
608
595
|
|
609
596
|
it "can transform the english words for 101 into an ordinal" do
|
610
|
-
"101".en.numwords.en.ordinal.
|
597
|
+
expect( "101".en.numwords.en.ordinal ).to eq( "one hundred and first" )
|
611
598
|
end
|
612
599
|
|
613
600
|
|
614
601
|
it "can transform 110 into english words" do
|
615
|
-
"110".en.numwords.
|
602
|
+
expect( "110".en.numwords ).to eq( "one hundred and ten" )
|
616
603
|
end
|
617
604
|
|
618
605
|
it "can transform 110 into english words in single-digit groups" do
|
619
|
-
"110".en.numwords(
|
606
|
+
expect( "110".en.numwords(group: 1) ).to eq( "one, one, zero" )
|
620
607
|
end
|
621
608
|
|
622
609
|
it "can transform 110 into english words in double-digit groups" do
|
623
|
-
"110".en.numwords(
|
610
|
+
expect( "110".en.numwords(group: 2) ).to eq( "eleven, zero" )
|
624
611
|
end
|
625
612
|
|
626
613
|
it "can transform 110 into english words in triple-digit groups" do
|
627
|
-
"110".en.numwords(
|
614
|
+
expect( "110".en.numwords(group: 3) ).to eq( "one ten" )
|
628
615
|
end
|
629
616
|
|
630
617
|
|
631
618
|
it "can transform the english words for 110 into an ordinal" do
|
632
|
-
"110".en.numwords.en.ordinal.
|
619
|
+
expect( "110".en.numwords.en.ordinal ).to eq( "one hundred and tenth" )
|
633
620
|
end
|
634
621
|
|
635
622
|
|
636
623
|
it "can transform 111 into english words" do
|
637
|
-
"111".en.numwords.
|
624
|
+
expect( "111".en.numwords ).to eq( "one hundred and eleven" )
|
638
625
|
end
|
639
626
|
|
640
627
|
it "can transform 111 into english words in single-digit groups" do
|
641
|
-
"111".en.numwords(
|
628
|
+
expect( "111".en.numwords(group: 1) ).to eq( "one, one, one" )
|
642
629
|
end
|
643
630
|
|
644
631
|
it "can transform 111 into english words in double-digit groups" do
|
645
|
-
"111".en.numwords(
|
632
|
+
expect( "111".en.numwords(group: 2) ).to eq( "eleven, one" )
|
646
633
|
end
|
647
634
|
|
648
635
|
it "can transform 111 into english words in triple-digit groups" do
|
649
|
-
"111".en.numwords(
|
636
|
+
expect( "111".en.numwords(group: 3) ).to eq( "one eleven" )
|
650
637
|
end
|
651
638
|
|
652
639
|
|
653
640
|
it "can transform the english words for 111 into an ordinal" do
|
654
|
-
"111".en.numwords.en.ordinal.
|
641
|
+
expect( "111".en.numwords.en.ordinal ).to eq( "one hundred and eleventh" )
|
655
642
|
end
|
656
643
|
|
657
644
|
|
658
645
|
it "can transform 900 into english words" do
|
659
|
-
"900".en.numwords.
|
646
|
+
expect( "900".en.numwords ).to eq( "nine hundred" )
|
660
647
|
end
|
661
648
|
|
662
649
|
it "can transform 900 into english words in single-digit groups" do
|
663
|
-
"900".en.numwords(
|
650
|
+
expect( "900".en.numwords(group: 1) ).to eq( "nine, zero, zero" )
|
664
651
|
end
|
665
652
|
|
666
653
|
it "can transform 900 into english words in double-digit groups" do
|
667
|
-
"900".en.numwords(
|
654
|
+
expect( "900".en.numwords(group: 2) ).to eq( "ninety, zero" )
|
668
655
|
end
|
669
656
|
|
670
657
|
it "can transform 900 into english words in triple-digit groups" do
|
671
|
-
"900".en.numwords(
|
658
|
+
expect( "900".en.numwords(group: 3) ).to eq( "nine zero zero" )
|
672
659
|
end
|
673
660
|
|
674
661
|
|
675
662
|
it "can transform the english words for 900 into an ordinal" do
|
676
|
-
"900".en.numwords.en.ordinal.
|
663
|
+
expect( "900".en.numwords.en.ordinal ).to eq( "nine hundredth" )
|
677
664
|
end
|
678
665
|
|
679
666
|
|
680
667
|
it "can transform 999 into english words" do
|
681
|
-
"999".en.numwords.
|
668
|
+
expect( "999".en.numwords ).to eq( "nine hundred and ninety-nine" )
|
682
669
|
end
|
683
670
|
|
684
671
|
it "can transform 999 into english words in single-digit groups" do
|
685
|
-
"999".en.numwords(
|
672
|
+
expect( "999".en.numwords(group: 1) ).to eq( "nine, nine, nine" )
|
686
673
|
end
|
687
674
|
|
688
675
|
it "can transform 999 into english words in double-digit groups" do
|
689
|
-
"999".en.numwords(
|
676
|
+
expect( "999".en.numwords(group: 2) ).to eq( "ninety-nine, nine" )
|
690
677
|
end
|
691
678
|
|
692
679
|
it "can transform 999 into english words in triple-digit groups" do
|
693
|
-
"999".en.numwords(
|
680
|
+
expect( "999".en.numwords(group: 3) ).to eq( "nine ninety-nine" )
|
694
681
|
end
|
695
682
|
|
696
683
|
|
697
684
|
it "can transform the english words for 999 into an ordinal" do
|
698
|
-
"999".en.numwords.en.ordinal.
|
685
|
+
expect( "999".en.numwords.en.ordinal ).to eq( "nine hundred and ninety-ninth" )
|
699
686
|
end
|
700
687
|
|
701
688
|
|
702
689
|
it "can transform 1000 into english words" do
|
703
|
-
"1000".en.numwords.
|
690
|
+
expect( "1000".en.numwords ).to eq( "one thousand" )
|
704
691
|
end
|
705
692
|
|
706
693
|
it "can transform 1000 into english words in single-digit groups" do
|
707
|
-
"1000".en.numwords(
|
694
|
+
expect( "1000".en.numwords(group: 1) ).to eq( "one, zero, zero, zero" )
|
708
695
|
end
|
709
696
|
|
710
697
|
it "can transform 1000 into english words in double-digit groups" do
|
711
|
-
"1000".en.numwords(
|
698
|
+
expect( "1000".en.numwords(group: 2) ).to eq( "ten, zero zero" )
|
712
699
|
end
|
713
700
|
|
714
701
|
it "can transform 1000 into english words in triple-digit groups" do
|
715
|
-
"1000".en.numwords(
|
702
|
+
expect( "1000".en.numwords(group: 3) ).to eq( "one zero zero, zero" )
|
716
703
|
end
|
717
704
|
|
718
705
|
|
719
706
|
it "can transform the english words for 1000 into an ordinal" do
|
720
|
-
"1000".en.numwords.en.ordinal.
|
707
|
+
expect( "1000".en.numwords.en.ordinal ).to eq( "one thousandth" )
|
721
708
|
end
|
722
709
|
|
723
710
|
|
724
711
|
it "can transform 1001 into english words" do
|
725
|
-
"1001".en.numwords.
|
712
|
+
expect( "1001".en.numwords ).to eq( "one thousand and one" )
|
726
713
|
end
|
727
714
|
|
728
715
|
it "can transform 1001 into english words in single-digit groups" do
|
729
|
-
"1001".en.numwords(
|
716
|
+
expect( "1001".en.numwords(group: 1) ).to eq( "one, zero, zero, one" )
|
730
717
|
end
|
731
718
|
|
732
719
|
it "can transform 1001 into english words in double-digit groups" do
|
733
|
-
"1001".en.numwords(
|
720
|
+
expect( "1001".en.numwords(group: 2) ).to eq( "ten, zero one" )
|
734
721
|
end
|
735
722
|
|
736
723
|
it "can transform 1001 into english words in triple-digit groups" do
|
737
|
-
"1001".en.numwords(
|
724
|
+
expect( "1001".en.numwords(group: 3) ).to eq( "one zero zero, one" )
|
738
725
|
end
|
739
726
|
|
740
727
|
|
741
728
|
it "can transform the english words for 1001 into an ordinal" do
|
742
|
-
"1001".en.numwords.en.ordinal.
|
729
|
+
expect( "1001".en.numwords.en.ordinal ).to eq( "one thousand and first" )
|
743
730
|
end
|
744
731
|
|
745
732
|
|
746
733
|
it "can transform 1010 into english words" do
|
747
|
-
"1010".en.numwords.
|
734
|
+
expect( "1010".en.numwords ).to eq( "one thousand and ten" )
|
748
735
|
end
|
749
736
|
|
750
737
|
it "can transform 1010 into english words in single-digit groups" do
|
751
|
-
"1010".en.numwords(
|
738
|
+
expect( "1010".en.numwords(group: 1) ).to eq( "one, zero, one, zero" )
|
752
739
|
end
|
753
740
|
|
754
741
|
it "can transform 1010 into english words in double-digit groups" do
|
755
|
-
"1010".en.numwords(
|
742
|
+
expect( "1010".en.numwords(group: 2) ).to eq( "ten, ten" )
|
756
743
|
end
|
757
744
|
|
758
745
|
it "can transform 1010 into english words in triple-digit groups" do
|
759
|
-
"1010".en.numwords(
|
746
|
+
expect( "1010".en.numwords(group: 3) ).to eq( "one zero one, zero" )
|
760
747
|
end
|
761
748
|
|
762
749
|
|
763
750
|
it "can transform the english words for 1010 into an ordinal" do
|
764
|
-
"1010".en.numwords.en.ordinal.
|
751
|
+
expect( "1010".en.numwords.en.ordinal ).to eq( "one thousand and tenth" )
|
765
752
|
end
|
766
753
|
|
767
754
|
|
768
755
|
it "can transform 1100 into english words" do
|
769
|
-
"1100".en.numwords.
|
756
|
+
expect( "1100".en.numwords ).to eq( "one thousand, one hundred" )
|
770
757
|
end
|
771
758
|
|
772
759
|
it "can transform 1100 into english words in single-digit groups" do
|
773
|
-
"1100".en.numwords(
|
760
|
+
expect( "1100".en.numwords(group: 1) ).to eq( "one, one, zero, zero" )
|
774
761
|
end
|
775
762
|
|
776
763
|
it "can transform 1100 into english words in double-digit groups" do
|
777
|
-
"1100".en.numwords(
|
764
|
+
expect( "1100".en.numwords(group: 2) ).to eq( "eleven, zero zero" )
|
778
765
|
end
|
779
766
|
|
780
767
|
it "can transform 1100 into english words in triple-digit groups" do
|
781
|
-
"1100".en.numwords(
|
768
|
+
expect( "1100".en.numwords(group: 3) ).to eq( "one ten, zero" )
|
782
769
|
end
|
783
770
|
|
784
771
|
|
785
772
|
it "can transform the english words for 1100 into an ordinal" do
|
786
|
-
"1100".en.numwords.en.ordinal.
|
773
|
+
expect( "1100".en.numwords.en.ordinal ).to eq( "one thousand, one hundredth" )
|
787
774
|
end
|
788
775
|
|
789
776
|
|
790
777
|
it "can transform 2000 into english words" do
|
791
|
-
"2000".en.numwords.
|
778
|
+
expect( "2000".en.numwords ).to eq( "two thousand" )
|
792
779
|
end
|
793
780
|
|
794
781
|
it "can transform 2000 into english words in single-digit groups" do
|
795
|
-
"2000".en.numwords(
|
782
|
+
expect( "2000".en.numwords(group: 1) ).to eq( "two, zero, zero, zero" )
|
796
783
|
end
|
797
784
|
|
798
785
|
it "can transform 2000 into english words in double-digit groups" do
|
799
|
-
"2000".en.numwords(
|
786
|
+
expect( "2000".en.numwords(group: 2) ).to eq( "twenty, zero zero" )
|
800
787
|
end
|
801
788
|
|
802
789
|
it "can transform 2000 into english words in triple-digit groups" do
|
803
|
-
"2000".en.numwords(
|
790
|
+
expect( "2000".en.numwords(group: 3) ).to eq( "two zero zero, zero" )
|
804
791
|
end
|
805
792
|
|
806
793
|
|
807
794
|
it "can transform the english words for 2000 into an ordinal" do
|
808
|
-
"2000".en.numwords.en.ordinal.
|
795
|
+
expect( "2000".en.numwords.en.ordinal ).to eq( "two thousandth" )
|
809
796
|
end
|
810
797
|
|
811
798
|
|
812
799
|
it "can transform 10000 into english words" do
|
813
|
-
"10000".en.numwords.
|
800
|
+
expect( "10000".en.numwords ).to eq( "ten thousand" )
|
814
801
|
end
|
815
802
|
|
816
803
|
it "can transform 10000 into english words in single-digit groups" do
|
817
|
-
"10000".en.numwords(
|
804
|
+
expect( "10000".en.numwords(group: 1) ).to eq( "one, zero, zero, zero, zero" )
|
818
805
|
end
|
819
806
|
|
820
807
|
it "can transform 10000 into english words in double-digit groups" do
|
821
|
-
"10000".en.numwords(
|
808
|
+
expect( "10000".en.numwords(group: 2) ).to eq( "ten, zero zero, zero" )
|
822
809
|
end
|
823
810
|
|
824
811
|
it "can transform 10000 into english words in triple-digit groups" do
|
825
|
-
"10000".en.numwords(
|
812
|
+
expect( "10000".en.numwords(group: 3) ).to eq( "one zero zero, zero zero" )
|
826
813
|
end
|
827
814
|
|
828
815
|
|
829
816
|
it "can transform the english words for 10000 into an ordinal" do
|
830
|
-
"10000".en.numwords.en.ordinal.
|
817
|
+
expect( "10000".en.numwords.en.ordinal ).to eq( "ten thousandth" )
|
831
818
|
end
|
832
819
|
|
833
820
|
|
834
821
|
it "can transform 100000 into english words" do
|
835
|
-
"100000".en.numwords.
|
822
|
+
expect( "100000".en.numwords ).to eq( "one hundred thousand" )
|
836
823
|
end
|
837
824
|
|
838
825
|
it "can transform 100000 into english words in single-digit groups" do
|
839
|
-
"100000".en.numwords(
|
826
|
+
expect( "100000".en.numwords(group: 1) ).to eq( "one, zero, zero, zero, zero, zero" )
|
840
827
|
end
|
841
828
|
|
842
829
|
it "can transform 100000 into english words in double-digit groups" do
|
843
|
-
"100000".en.numwords(
|
830
|
+
expect( "100000".en.numwords(group: 2) ).to eq( "ten, zero zero, zero zero" )
|
844
831
|
end
|
845
832
|
|
846
833
|
it "can transform 100000 into english words in triple-digit groups" do
|
847
|
-
"100000".en.numwords(
|
834
|
+
expect( "100000".en.numwords(group: 3) ).to eq( "one zero zero, zero zero zero" )
|
848
835
|
end
|
849
836
|
|
850
837
|
|
851
838
|
it "can transform the english words for 100000 into an ordinal" do
|
852
|
-
"100000".en.numwords.en.ordinal.
|
839
|
+
expect( "100000".en.numwords.en.ordinal ).to eq( "one hundred thousandth" )
|
853
840
|
end
|
854
841
|
|
855
842
|
|
856
843
|
it "can transform 100001 into english words" do
|
857
|
-
"100001".en.numwords.
|
844
|
+
expect( "100001".en.numwords ).to eq( "one hundred thousand and one" )
|
858
845
|
end
|
859
846
|
|
860
847
|
it "can transform 100001 into english words in single-digit groups" do
|
861
|
-
"100001".en.numwords(
|
848
|
+
expect( "100001".en.numwords(group: 1) ).to eq( "one, zero, zero, zero, zero, one" )
|
862
849
|
end
|
863
850
|
|
864
851
|
it "can transform 100001 into english words in double-digit groups" do
|
865
|
-
"100001".en.numwords(
|
852
|
+
expect( "100001".en.numwords(group: 2) ).to eq( "ten, zero zero, zero one" )
|
866
853
|
end
|
867
854
|
|
868
855
|
it "can transform 100001 into english words in triple-digit groups" do
|
869
|
-
"100001".en.numwords(
|
856
|
+
expect( "100001".en.numwords(group: 3) ).to eq( "one zero zero, zero zero one" )
|
870
857
|
end
|
871
858
|
|
872
859
|
|
873
860
|
it "can transform the english words for 100001 into an ordinal" do
|
874
|
-
"100001".en.numwords.en.ordinal.
|
861
|
+
expect( "100001".en.numwords.en.ordinal ).to eq( "one hundred thousand and first" )
|
875
862
|
end
|
876
863
|
|
877
864
|
|
878
865
|
it "can transform 123456 into english words" do
|
879
|
-
"123456".en.numwords.
|
866
|
+
expect( "123456".en.numwords ).to eq( "one hundred and twenty-three thousand, four hundred and fifty-six" )
|
880
867
|
end
|
881
868
|
|
882
869
|
it "can transform 123456 into english words in single-digit groups" do
|
883
|
-
"123456".en.numwords(
|
870
|
+
expect( "123456".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six" )
|
884
871
|
end
|
885
872
|
|
886
873
|
it "can transform 123456 into english words in double-digit groups" do
|
887
|
-
"123456".en.numwords(
|
874
|
+
expect( "123456".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six" )
|
888
875
|
end
|
889
876
|
|
890
877
|
it "can transform 123456 into english words in triple-digit groups" do
|
891
|
-
"123456".en.numwords(
|
878
|
+
expect( "123456".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six" )
|
892
879
|
end
|
893
880
|
|
894
881
|
|
895
882
|
it "can transform the english words for 123456 into an ordinal" do
|
896
|
-
"123456".en.numwords.en.ordinal.
|
883
|
+
expect( "123456".en.numwords.en.ordinal ).to eq( "one hundred and twenty-three thousand, four hundred and fifty-sixth" )
|
897
884
|
end
|
898
885
|
|
899
886
|
|
900
887
|
it "can transform 0123456 into english words" do
|
901
|
-
"0123456".en.numwords.
|
888
|
+
expect( "0123456".en.numwords ).to eq( "one hundred and twenty-three thousand, four hundred and fifty-six" )
|
902
889
|
end
|
903
890
|
|
904
891
|
it "can transform 0123456 into english words in single-digit groups" do
|
905
|
-
"0123456".en.numwords(
|
892
|
+
expect( "0123456".en.numwords(group: 1) ).to eq( "zero, one, two, three, four, five, six" )
|
906
893
|
end
|
907
894
|
|
908
895
|
it "can transform 0123456 into english words in double-digit groups" do
|
909
|
-
"0123456".en.numwords(
|
896
|
+
expect( "0123456".en.numwords(group: 2) ).to eq( "zero one, twenty-three, forty-five, six" )
|
910
897
|
end
|
911
898
|
|
912
899
|
it "can transform 0123456 into english words in triple-digit groups" do
|
913
|
-
"0123456".en.numwords(
|
900
|
+
expect( "0123456".en.numwords(group: 3) ).to eq( "zero twelve, three forty-five, six" )
|
914
901
|
end
|
915
902
|
|
916
903
|
|
917
904
|
it "can transform the english words for 0123456 into an ordinal" do
|
918
|
-
"0123456".en.numwords.en.ordinal.
|
905
|
+
expect( "0123456".en.numwords.en.ordinal ).to eq( "one hundred and twenty-three thousand, four hundred and fifty-sixth" )
|
919
906
|
end
|
920
907
|
|
921
908
|
|
922
909
|
it "can transform 1234567 into english words" do
|
923
|
-
"1234567".en.numwords.
|
910
|
+
expect( "1234567".en.numwords ).to eq( "one million, two hundred and thirty-four thousand, five hundred and sixty-seven" )
|
924
911
|
end
|
925
912
|
|
926
913
|
it "can transform 1234567 into english words in single-digit groups" do
|
927
|
-
"1234567".en.numwords(
|
914
|
+
expect( "1234567".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven" )
|
928
915
|
end
|
929
916
|
|
930
917
|
it "can transform 1234567 into english words in double-digit groups" do
|
931
|
-
"1234567".en.numwords(
|
918
|
+
expect( "1234567".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seven" )
|
932
919
|
end
|
933
920
|
|
934
921
|
it "can transform 1234567 into english words in triple-digit groups" do
|
935
|
-
"1234567".en.numwords(
|
922
|
+
expect( "1234567".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seven" )
|
936
923
|
end
|
937
924
|
|
938
925
|
|
939
926
|
it "can transform the english words for 1234567 into an ordinal" do
|
940
|
-
"1234567".en.numwords.en.ordinal.
|
927
|
+
expect( "1234567".en.numwords.en.ordinal ).to eq( "one million, two hundred and thirty-four thousand, five hundred and sixty-seventh" )
|
941
928
|
end
|
942
929
|
|
943
930
|
|
944
931
|
it "can transform 12345678 into english words" do
|
945
|
-
"12345678".en.numwords.
|
932
|
+
expect( "12345678".en.numwords ).to eq( "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight" )
|
946
933
|
end
|
947
934
|
|
948
935
|
it "can transform 12345678 into english words in single-digit groups" do
|
949
|
-
"12345678".en.numwords(
|
936
|
+
expect( "12345678".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight" )
|
950
937
|
end
|
951
938
|
|
952
939
|
it "can transform 12345678 into english words in double-digit groups" do
|
953
|
-
"12345678".en.numwords(
|
940
|
+
expect( "12345678".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight" )
|
954
941
|
end
|
955
942
|
|
956
943
|
it "can transform 12345678 into english words in triple-digit groups" do
|
957
|
-
"12345678".en.numwords(
|
944
|
+
expect( "12345678".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seventy-eight" )
|
958
945
|
end
|
959
946
|
|
960
947
|
|
961
948
|
it "can transform the english words for 12345678 into an ordinal" do
|
962
|
-
"12345678".en.numwords.en.ordinal.
|
949
|
+
expect( "12345678".en.numwords.en.ordinal ).to eq( "twelve million, three hundred and forty-five thousand, six hundred and seventy-eighth" )
|
963
950
|
end
|
964
951
|
|
965
952
|
|
966
953
|
it "can transform 12_345_678 into english words" do
|
967
|
-
"12_345_678".en.numwords.
|
954
|
+
expect( "12_345_678".en.numwords ).to eq( "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight" )
|
968
955
|
end
|
969
956
|
|
970
957
|
it "can transform 12_345_678 into english words in single-digit groups" do
|
971
|
-
"12_345_678".en.numwords(
|
958
|
+
expect( "12_345_678".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight" )
|
972
959
|
end
|
973
960
|
|
974
961
|
it "can transform 12_345_678 into english words in double-digit groups" do
|
975
|
-
"12_345_678".en.numwords(
|
962
|
+
expect( "12_345_678".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight" )
|
976
963
|
end
|
977
964
|
|
978
965
|
it "can transform 12_345_678 into english words in triple-digit groups" do
|
979
|
-
"12_345_678".en.numwords(
|
966
|
+
expect( "12_345_678".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seventy-eight" )
|
980
967
|
end
|
981
968
|
|
982
969
|
|
983
970
|
it "can transform 1234,5678 into english words" do
|
984
|
-
"1234,5678".en.numwords.
|
971
|
+
expect( "1234,5678".en.numwords ).to eq( "twelve million, three hundred and forty-five thousand, six hundred and seventy-eight" )
|
985
972
|
end
|
986
973
|
|
987
974
|
it "can transform 1234,5678 into english words in single-digit groups" do
|
988
|
-
"1234,5678".en.numwords(
|
975
|
+
expect( "1234,5678".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight" )
|
989
976
|
end
|
990
977
|
|
991
978
|
it "can transform 1234,5678 into english words in double-digit groups" do
|
992
|
-
"1234,5678".en.numwords(
|
979
|
+
expect( "1234,5678".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight" )
|
993
980
|
end
|
994
981
|
|
995
982
|
it "can transform 1234,5678 into english words in triple-digit groups" do
|
996
|
-
"1234,5678".en.numwords(
|
983
|
+
expect( "1234,5678".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seventy-eight" )
|
997
984
|
end
|
998
985
|
|
999
986
|
|
1000
987
|
it "can transform 1234567890 into english words" do
|
1001
|
-
"1234567890".en.numwords.
|
988
|
+
expect( "1234567890".en.numwords ).to eq( "one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninety" )
|
1002
989
|
end
|
1003
990
|
|
1004
991
|
it "can transform 1234567890 into english words in single-digit groups" do
|
1005
|
-
"1234567890".en.numwords(
|
992
|
+
expect( "1234567890".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight, nine, zero" )
|
1006
993
|
end
|
1007
994
|
|
1008
995
|
it "can transform 1234567890 into english words in double-digit groups" do
|
1009
|
-
"1234567890".en.numwords(
|
996
|
+
expect( "1234567890".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight, ninety" )
|
1010
997
|
end
|
1011
998
|
|
1012
999
|
it "can transform 1234567890 into english words in triple-digit groups" do
|
1013
|
-
"1234567890".en.numwords(
|
1000
|
+
expect( "1234567890".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seven eighty-nine, zero" )
|
1014
1001
|
end
|
1015
1002
|
|
1016
1003
|
|
1017
1004
|
it "can transform the english words for 1234567890 into an ordinal" do
|
1018
|
-
"1234567890".en.numwords.en.ordinal.
|
1005
|
+
expect( "1234567890".en.numwords.en.ordinal ).to eq( "one billion, two hundred and thirty-four million, five hundred and sixty-seven thousand, eight hundred and ninetieth" )
|
1019
1006
|
end
|
1020
1007
|
|
1021
1008
|
|
1022
1009
|
it "can transform 123456789012345 into english words" do
|
1023
|
-
"123456789012345".en.numwords.
|
1010
|
+
expect( "123456789012345".en.numwords ).to eq( "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" )
|
1024
1011
|
end
|
1025
1012
|
|
1026
1013
|
it "can transform 123456789012345 into english words in single-digit groups" do
|
1027
|
-
"123456789012345".en.numwords(
|
1014
|
+
expect( "123456789012345".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight, nine, zero, one, two, three, four, five" )
|
1028
1015
|
end
|
1029
1016
|
|
1030
1017
|
it "can transform 123456789012345 into english words in double-digit groups" do
|
1031
|
-
"123456789012345".en.numwords(
|
1018
|
+
expect( "123456789012345".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight, ninety, twelve, thirty-four, five" )
|
1032
1019
|
end
|
1033
1020
|
|
1034
1021
|
it "can transform 123456789012345 into english words in triple-digit groups" do
|
1035
|
-
"123456789012345".en.numwords(
|
1022
|
+
expect( "123456789012345".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seven eighty-nine, zero twelve, three forty-five" )
|
1036
1023
|
end
|
1037
1024
|
|
1038
1025
|
|
1039
1026
|
it "can transform the english words for 123456789012345 into an ordinal" do
|
1040
|
-
"123456789012345".en.numwords.en.ordinal.
|
1027
|
+
expect( "123456789012345".en.numwords.en.ordinal ).to eq( "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" )
|
1041
1028
|
end
|
1042
1029
|
|
1043
1030
|
|
1044
1031
|
it "can transform 12345678901234567890 into english words" do
|
1045
|
-
"12345678901234567890".en.numwords.
|
1032
|
+
expect( "12345678901234567890".en.numwords ).to eq( "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" )
|
1046
1033
|
end
|
1047
1034
|
|
1048
1035
|
it "can transform 12345678901234567890 into english words in single-digit groups" do
|
1049
|
-
"12345678901234567890".en.numwords(
|
1036
|
+
expect( "12345678901234567890".en.numwords(group: 1) ).to eq( "one, two, three, four, five, six, seven, eight, nine, zero, one, two, three, four, five, six, seven, eight, nine, zero" )
|
1050
1037
|
end
|
1051
1038
|
|
1052
1039
|
it "can transform 12345678901234567890 into english words in double-digit groups" do
|
1053
|
-
"12345678901234567890".en.numwords(
|
1040
|
+
expect( "12345678901234567890".en.numwords(group: 2) ).to eq( "twelve, thirty-four, fifty-six, seventy-eight, ninety, twelve, thirty-four, fifty-six, seventy-eight, ninety" )
|
1054
1041
|
end
|
1055
1042
|
|
1056
1043
|
it "can transform 12345678901234567890 into english words in triple-digit groups" do
|
1057
|
-
"12345678901234567890".en.numwords(
|
1044
|
+
expect( "12345678901234567890".en.numwords(group: 3) ).to eq( "one twenty-three, four fifty-six, seven eighty-nine, zero twelve, three forty-five, six seventy-eight, ninety" )
|
1058
1045
|
end
|
1059
1046
|
|
1060
1047
|
|
1061
1048
|
it "can transform the english words for 12345678901234567890 into an ordinal" do
|
1062
|
-
"12345678901234567890".en.numwords.en.ordinal.
|
1049
|
+
expect( "12345678901234567890".en.numwords.en.ordinal ).to eq( "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" )
|
1063
1050
|
end
|
1064
1051
|
|
1065
1052
|
|
1066
1053
|
it "can transform 0.987654 into english words" do
|
1067
|
-
"0.987654".en.numwords.
|
1054
|
+
expect( "0.987654".en.numwords ).to eq( "zero point nine eight seven six five four" )
|
1068
1055
|
end
|
1069
1056
|
|
1070
1057
|
it "can transform 0.987654 into english words in single-digit groups" do
|
1071
|
-
"0.987654".en.numwords(
|
1058
|
+
expect( "0.987654".en.numwords(group: 1) ).to eq( "zero, point, nine, eight, seven, six, five, four" )
|
1072
1059
|
end
|
1073
1060
|
|
1074
1061
|
it "can transform 0.987654 into english words in double-digit groups" do
|
1075
|
-
"0.987654".en.numwords(
|
1062
|
+
expect( "0.987654".en.numwords(group: 2) ).to eq( "zero, point, ninety-eight, seventy-six, fifty-four" )
|
1076
1063
|
end
|
1077
1064
|
|
1078
1065
|
it "can transform 0.987654 into english words in triple-digit groups" do
|
1079
|
-
"0.987654".en.numwords(
|
1066
|
+
expect( "0.987654".en.numwords(group: 3) ).to eq( "zero, point, nine eighty-seven, six fifty-four" )
|
1080
1067
|
end
|
1081
1068
|
|
1082
1069
|
|
1083
1070
|
it "can transform the english words for 0.987654 into an ordinal" do
|
1084
|
-
"0.987654".en.numwords.en.ordinal.
|
1071
|
+
expect( "0.987654".en.numwords.en.ordinal ).to eq( "zero point nine eight seven six five fourth" )
|
1085
1072
|
end
|
1086
1073
|
|
1087
1074
|
|
1088
1075
|
it "can transform .987654 into english words" do
|
1089
|
-
".987654".en.numwords.
|
1076
|
+
expect( ".987654".en.numwords ).to eq( "point nine eight seven six five four" )
|
1090
1077
|
end
|
1091
1078
|
|
1092
1079
|
it "can transform .987654 into english words in single-digit groups" do
|
1093
|
-
".987654".en.numwords(
|
1080
|
+
expect( ".987654".en.numwords(group: 1) ).to eq( "point, nine, eight, seven, six, five, four" )
|
1094
1081
|
end
|
1095
1082
|
|
1096
1083
|
it "can transform .987654 into english words in double-digit groups" do
|
1097
|
-
".987654".en.numwords(
|
1084
|
+
expect( ".987654".en.numwords(group: 2) ).to eq( "point, ninety-eight, seventy-six, fifty-four" )
|
1098
1085
|
end
|
1099
1086
|
|
1100
1087
|
it "can transform .987654 into english words in triple-digit groups" do
|
1101
|
-
".987654".en.numwords(
|
1088
|
+
expect( ".987654".en.numwords(group: 3) ).to eq( "point, nine eighty-seven, six fifty-four" )
|
1102
1089
|
end
|
1103
1090
|
|
1104
1091
|
|
1105
1092
|
it "can transform the english words for .987654 into an ordinal" do
|
1106
|
-
".987654".en.numwords.en.ordinal.
|
1093
|
+
expect( ".987654".en.numwords.en.ordinal ).to eq( "point nine eight seven six five fourth" )
|
1107
1094
|
end
|
1108
1095
|
|
1109
1096
|
|
1110
1097
|
it "can transform 9.87654 into english words" do
|
1111
|
-
"9.87654".en.numwords.
|
1098
|
+
expect( "9.87654".en.numwords ).to eq( "nine point eight seven six five four" )
|
1112
1099
|
end
|
1113
1100
|
|
1114
1101
|
it "can transform 9.87654 into english words in single-digit groups" do
|
1115
|
-
"9.87654".en.numwords(
|
1102
|
+
expect( "9.87654".en.numwords(group: 1) ).to eq( "nine, point, eight, seven, six, five, four" )
|
1116
1103
|
end
|
1117
1104
|
|
1118
1105
|
it "can transform 9.87654 into english words in double-digit groups" do
|
1119
|
-
"9.87654".en.numwords(
|
1106
|
+
expect( "9.87654".en.numwords(group: 2) ).to eq( "nine, point, eighty-seven, sixty-five, four" )
|
1120
1107
|
end
|
1121
1108
|
|
1122
1109
|
it "can transform 9.87654 into english words in triple-digit groups" do
|
1123
|
-
"9.87654".en.numwords(
|
1110
|
+
expect( "9.87654".en.numwords(group: 3) ).to eq( "nine, point, eight seventy-six, fifty-four" )
|
1124
1111
|
end
|
1125
1112
|
|
1126
1113
|
|
1127
1114
|
it "can transform the english words for 9.87654 into an ordinal" do
|
1128
|
-
"9.87654".en.numwords.en.ordinal.
|
1115
|
+
expect( "9.87654".en.numwords.en.ordinal ).to eq( "nine point eight seven six five fourth" )
|
1129
1116
|
end
|
1130
1117
|
|
1131
1118
|
|
1132
1119
|
it "can transform 98.7654 into english words" do
|
1133
|
-
"98.7654".en.numwords.
|
1120
|
+
expect( "98.7654".en.numwords ).to eq( "ninety-eight point seven six five four" )
|
1134
1121
|
end
|
1135
1122
|
|
1136
1123
|
it "can transform 98.7654 into english words in single-digit groups" do
|
1137
|
-
"98.7654".en.numwords(
|
1124
|
+
expect( "98.7654".en.numwords(group: 1) ).to eq( "nine, eight, point, seven, six, five, four" )
|
1138
1125
|
end
|
1139
1126
|
|
1140
1127
|
it "can transform 98.7654 into english words in double-digit groups" do
|
1141
|
-
"98.7654".en.numwords(
|
1128
|
+
expect( "98.7654".en.numwords(group: 2) ).to eq( "ninety-eight, point, seventy-six, fifty-four" )
|
1142
1129
|
end
|
1143
1130
|
|
1144
1131
|
it "can transform 98.7654 into english words in triple-digit groups" do
|
1145
|
-
"98.7654".en.numwords(
|
1132
|
+
expect( "98.7654".en.numwords(group: 3) ).to eq( "ninety-eight, point, seven sixty-five, four" )
|
1146
1133
|
end
|
1147
1134
|
|
1148
1135
|
|
1149
1136
|
it "can transform the english words for 98.7654 into an ordinal" do
|
1150
|
-
"98.7654".en.numwords.en.ordinal.
|
1137
|
+
expect( "98.7654".en.numwords.en.ordinal ).to eq( "ninety-eight point seven six five fourth" )
|
1151
1138
|
end
|
1152
1139
|
|
1153
1140
|
|
1154
1141
|
it "can transform 987.654 into english words" do
|
1155
|
-
"987.654".en.numwords.
|
1142
|
+
expect( "987.654".en.numwords ).to eq( "nine hundred and eighty-seven point six five four" )
|
1156
1143
|
end
|
1157
1144
|
|
1158
1145
|
it "can transform 987.654 into english words in single-digit groups" do
|
1159
|
-
"987.654".en.numwords(
|
1146
|
+
expect( "987.654".en.numwords(group: 1) ).to eq( "nine, eight, seven, point, six, five, four" )
|
1160
1147
|
end
|
1161
1148
|
|
1162
1149
|
it "can transform 987.654 into english words in double-digit groups" do
|
1163
|
-
"987.654".en.numwords(
|
1150
|
+
expect( "987.654".en.numwords(group: 2) ).to eq( "ninety-eight, seven, point, sixty-five, four" )
|
1164
1151
|
end
|
1165
1152
|
|
1166
1153
|
it "can transform 987.654 into english words in triple-digit groups" do
|
1167
|
-
"987.654".en.numwords(
|
1154
|
+
expect( "987.654".en.numwords(group: 3) ).to eq( "nine eighty-seven, point, six fifty-four" )
|
1168
1155
|
end
|
1169
1156
|
|
1170
1157
|
|
1171
1158
|
it "can transform the english words for 987.654 into an ordinal" do
|
1172
|
-
"987.654".en.numwords.en.ordinal.
|
1159
|
+
expect( "987.654".en.numwords.en.ordinal ).to eq( "nine hundred and eighty-seven point six five fourth" )
|
1173
1160
|
end
|
1174
1161
|
|
1175
1162
|
|
1176
1163
|
it "can transform 9876.54 into english words" do
|
1177
|
-
"9876.54".en.numwords.
|
1164
|
+
expect( "9876.54".en.numwords ).to eq( "nine thousand, eight hundred and seventy-six point five four" )
|
1178
1165
|
end
|
1179
1166
|
|
1180
1167
|
it "can transform 9876.54 into english words in single-digit groups" do
|
1181
|
-
"9876.54".en.numwords(
|
1168
|
+
expect( "9876.54".en.numwords(group: 1) ).to eq( "nine, eight, seven, six, point, five, four" )
|
1182
1169
|
end
|
1183
1170
|
|
1184
1171
|
it "can transform 9876.54 into english words in double-digit groups" do
|
1185
|
-
"9876.54".en.numwords(
|
1172
|
+
expect( "9876.54".en.numwords(group: 2) ).to eq( "ninety-eight, seventy-six, point, fifty-four" )
|
1186
1173
|
end
|
1187
1174
|
|
1188
1175
|
it "can transform 9876.54 into english words in triple-digit groups" do
|
1189
|
-
"9876.54".en.numwords(
|
1176
|
+
expect( "9876.54".en.numwords(group: 3) ).to eq( "nine eighty-seven, six, point, fifty-four" )
|
1190
1177
|
end
|
1191
1178
|
|
1192
1179
|
|
1193
1180
|
it "can transform the english words for 9876.54 into an ordinal" do
|
1194
|
-
"9876.54".en.numwords.en.ordinal.
|
1181
|
+
expect( "9876.54".en.numwords.en.ordinal ).to eq( "nine thousand, eight hundred and seventy-six point five fourth" )
|
1195
1182
|
end
|
1196
1183
|
|
1197
1184
|
|
1198
1185
|
it "can transform 98765.4 into english words" do
|
1199
|
-
"98765.4".en.numwords.
|
1186
|
+
expect( "98765.4".en.numwords ).to eq( "ninety-eight thousand, seven hundred and sixty-five point four" )
|
1200
1187
|
end
|
1201
1188
|
|
1202
1189
|
it "can transform 98765.4 into english words in single-digit groups" do
|
1203
|
-
"98765.4".en.numwords(
|
1190
|
+
expect( "98765.4".en.numwords(group: 1) ).to eq( "nine, eight, seven, six, five, point, four" )
|
1204
1191
|
end
|
1205
1192
|
|
1206
1193
|
it "can transform 98765.4 into english words in double-digit groups" do
|
1207
|
-
"98765.4".en.numwords(
|
1194
|
+
expect( "98765.4".en.numwords(group: 2) ).to eq( "ninety-eight, seventy-six, five, point, four" )
|
1208
1195
|
end
|
1209
1196
|
|
1210
1197
|
it "can transform 98765.4 into english words in triple-digit groups" do
|
1211
|
-
"98765.4".en.numwords(
|
1198
|
+
expect( "98765.4".en.numwords(group: 3) ).to eq( "nine eighty-seven, sixty-five, point, four" )
|
1212
1199
|
end
|
1213
1200
|
|
1214
1201
|
|
1215
1202
|
it "can transform the english words for 98765.4 into an ordinal" do
|
1216
|
-
"98765.4".en.numwords.en.ordinal.
|
1203
|
+
expect( "98765.4".en.numwords.en.ordinal ).to eq( "ninety-eight thousand, seven hundred and sixty-five point fourth" )
|
1217
1204
|
end
|
1218
1205
|
|
1219
1206
|
|
1220
1207
|
it "can transform 101.202.303 into english words" do
|
1221
|
-
"101.202.303".en.numwords.
|
1208
|
+
expect( "101.202.303".en.numwords ).to eq( "one hundred and one point two zero two three zero three" )
|
1222
1209
|
end
|
1223
1210
|
|
1224
1211
|
it "can transform 101.202.303 into english words in single-digit groups" do
|
1225
|
-
"101.202.303".en.numwords(
|
1212
|
+
expect( "101.202.303".en.numwords(group: 1) ).to eq( "one, zero, one, point, two, zero, two, point, three, zero, three" )
|
1226
1213
|
end
|
1227
1214
|
|
1228
1215
|
it "can transform 101.202.303 into english words in double-digit groups" do
|
1229
|
-
"101.202.303".en.numwords(
|
1216
|
+
expect( "101.202.303".en.numwords(group: 2) ).to eq( "ten, one, point, twenty, two, point, thirty, three" )
|
1230
1217
|
end
|
1231
1218
|
|
1232
1219
|
it "can transform 101.202.303 into english words in triple-digit groups" do
|
1233
|
-
"101.202.303".en.numwords(
|
1220
|
+
expect( "101.202.303".en.numwords(group: 3) ).to eq( "one zero one, point, two zero two, point, three zero three" )
|
1234
1221
|
end
|
1235
1222
|
end
|
1236
1223
|
|
1237
1224
|
|
1238
1225
|
describe "quantification" do
|
1239
1226
|
it "quantifies 0 objects as 'no'" do
|
1240
|
-
"driver".en.quantify( 0 ).
|
1227
|
+
expect( "driver".en.quantify( 0 ) ).to eq( 'no drivers' )
|
1241
1228
|
end
|
1242
1229
|
|
1243
1230
|
it "quantifies 1 object as 'a'" do
|
1244
|
-
"driver".en.quantify( 1 ).
|
1231
|
+
expect( "driver".en.quantify( 1 ) ).to eq( 'a driver' )
|
1245
1232
|
end
|
1246
1233
|
|
1247
1234
|
it "quantifies 1 object that starts with a vowel sound as 'an'" do
|
1248
|
-
"hour".en.quantify( 1 ).
|
1235
|
+
expect( "hour".en.quantify( 1 ) ).to eq( 'an hour' )
|
1249
1236
|
end
|
1250
1237
|
|
1251
1238
|
it "quantifies 2-5 objects as 'several'" do
|
1252
|
-
"driver".en.quantify( 4 ).
|
1239
|
+
expect( "driver".en.quantify( 4 ) ).to eq( 'several drivers' )
|
1253
1240
|
end
|
1254
1241
|
|
1255
1242
|
it "quantifies 6-19 objects as 'a number of'" do
|
1256
|
-
"driver".en.quantify( 11 ).
|
1243
|
+
expect( "driver".en.quantify( 11 ) ).to eq( 'a number of drivers' )
|
1257
1244
|
end
|
1258
1245
|
|
1259
1246
|
it "quantifies 20-45 objects as 'numerous'" do
|
1260
|
-
"driver".en.quantify( 41 ).
|
1247
|
+
expect( "driver".en.quantify( 41 ) ).to eq( 'numerous drivers' )
|
1261
1248
|
end
|
1262
1249
|
|
1263
1250
|
it "quantifies 46-99 objects as 'many'" do
|
1264
|
-
"driver".en.quantify( 58 ).
|
1251
|
+
expect( "driver".en.quantify( 58 ) ).to eq( 'many drivers' )
|
1265
1252
|
end
|
1266
1253
|
|
1267
1254
|
it "quantifies 100-999 objects as 'hundreds of'" do
|
1268
|
-
"driver".en.quantify( 318 ).
|
1255
|
+
expect( "driver".en.quantify( 318 ) ).to eq( 'hundreds of drivers' )
|
1269
1256
|
end
|
1270
1257
|
|
1271
1258
|
it "quantifies 1000-9999 objects as 'thousands of'" do
|
1272
|
-
"driver".en.quantify( 4158 ).
|
1259
|
+
expect( "driver".en.quantify( 4158 ) ).to eq( 'thousands of drivers' )
|
1273
1260
|
end
|
1274
1261
|
|
1275
1262
|
it "quantifies 10000-99999 objects as 'tens of thousands of'" do
|
1276
|
-
"driver".en.quantify( 14158 ).
|
1263
|
+
expect( "driver".en.quantify( 14158 ) ).to eq( 'tens of thousands of drivers' )
|
1277
1264
|
end
|
1278
1265
|
|
1279
1266
|
it "quantifies 100000-999999 objects as 'hundreds of thousands of'" do
|
1280
|
-
"driver".en.quantify( 614158 ).
|
1267
|
+
expect( "driver".en.quantify( 614158 ) ).to eq( 'hundreds of thousands of drivers' )
|
1281
1268
|
end
|
1282
1269
|
|
1283
1270
|
it "quantifies 2.6M objects as 'millions of'" do
|
1284
|
-
"driver".en.quantify( 2614158 ).
|
1271
|
+
expect( "driver".en.quantify( 2614158 ) ).to eq( 'millions of drivers' )
|
1285
1272
|
end
|
1286
1273
|
|
1287
1274
|
it "quantifies 8.122B objects as 'billions of'" do
|
1288
|
-
"driver".en.quantify( 8122614158 ).
|
1275
|
+
expect( "driver".en.quantify( 8122614158 ) ).to eq( 'billions of drivers' )
|
1289
1276
|
end
|
1290
1277
|
|
1291
1278
|
|