]> gitweb.factorcode.org Git - factor.git/blob - extra/math/text/english/english-tests.factor
math.text.english: expand the supported number range
[factor.git] / extra / math / text / english / english-tests.factor
1 USING: kernel math.functions math.parser math.text.english
2 sequences tools.test ;
3
4 { "zero" } [ 0 number>text ] unit-test
5 { "twenty-one" } [ 21 number>text ] unit-test
6 { "one hundred" } [ 100 number>text ] unit-test
7 { "one hundred and one" } [ 101 number>text ] unit-test
8 { "one thousand and one" } [ 1001 number>text ] unit-test
9 { "one thousand, one hundred and one" } [ 1101 number>text ] unit-test
10 { "one million, one thousand and one" } [ 1001001 number>text ] unit-test
11 { "one million, one thousand, one hundred and one" } [ 1001101 number>text ] unit-test
12 { "one million, one hundred and eleven thousand, one hundred and eleven" } [ 1111111 number>text ] unit-test
13 { "one duotrigintillion" } [ 10 99 ^ number>text ] unit-test
14 { "one noveducentillion" } [ 630 10^ number>text ] unit-test
15
16 { "negative one hundred and twenty-three" } [ -123 number>text ] unit-test
17
18 { "0th" } [ 0 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
19 { "1st" } [ 1 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
20 { "2nd" } [ 2 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
21 { "3rd" } [ 3 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
22 { "4th" } [ 4 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
23 { "5th" } [ 5 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
24 { "6th" } [ 6 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
25 { "7th" } [ 7 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
26 { "10th" } [ 10 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
27 { "11th" } [ 11 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
28 { "12th" } [ 12 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
29 { "13th" } [ 13 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
30 { "101st" } [ 101 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
31 { "110th" } [ 110 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
32 { "111th" } [ 111 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
33 { "112th" } [ 112 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
34 { "113th" } [ 113 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
35
36 { "-101st" } [ -101 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
37 { "-110th" } [ -110 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
38 { "-111th" } [ -111 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
39 { "-112th" } [ -112 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
40 { "-113th" } [ -113 [ number>string ] [ ordinal-suffix ] bi append ] unit-test
41
42 { "th" } [ 13.5 ordinal-suffix ] unit-test
43 { "th" } [ 9+1/3 ordinal-suffix ] unit-test