From 7a1837b15ac69dec8a6ccddcbda560cf3e81525e Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 11 Aug 2009 15:34:11 -0500 Subject: [PATCH] don't capitalize the first letter of each word in math.text.english --- extra/math/text/english/english-tests.factor | 22 +++++------ extra/math/text/english/english.factor | 39 ++++++++++++-------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/extra/math/text/english/english-tests.factor b/extra/math/text/english/english-tests.factor index 8f8932c97d..81a94687a7 100644 --- a/extra/math/text/english/english-tests.factor +++ b/extra/math/text/english/english-tests.factor @@ -1,15 +1,15 @@ USING: math.functions math.text.english tools.test ; IN: math.text.english.tests -[ "Zero" ] [ 0 number>text ] unit-test -[ "Twenty-One" ] [ 21 number>text ] unit-test -[ "One Hundred" ] [ 100 number>text ] unit-test -[ "One Hundred and One" ] [ 101 number>text ] unit-test -[ "One Thousand and One" ] [ 1001 number>text ] unit-test -[ "One Thousand, One Hundred and One" ] [ 1101 number>text ] unit-test -[ "One Million, One Thousand and One" ] [ 1001001 number>text ] unit-test -[ "One Million, One Thousand, One Hundred and One" ] [ 1001101 number>text ] unit-test -[ "One Million, One Hundred and Eleven Thousand, One Hundred and Eleven" ] [ 1111111 number>text ] unit-test -[ "One Duotrigintillion" ] [ 10 99 ^ number>text ] unit-test +[ "zero" ] [ 0 number>text ] unit-test +[ "twenty-one" ] [ 21 number>text ] unit-test +[ "one hundred" ] [ 100 number>text ] unit-test +[ "one hundred and one" ] [ 101 number>text ] unit-test +[ "one thousand and one" ] [ 1001 number>text ] unit-test +[ "one thousand, one hundred and one" ] [ 1101 number>text ] unit-test +[ "one million, one thousand and one" ] [ 1001001 number>text ] unit-test +[ "one million, one thousand, one hundred and one" ] [ 1001101 number>text ] unit-test +[ "one million, one hundred and eleven thousand, one hundred and eleven" ] [ 1111111 number>text ] unit-test +[ "one duotrigintillion" ] [ 10 99 ^ number>text ] unit-test -[ "Negative One Hundred and Twenty-Three" ] [ -123 number>text ] unit-test +[ "negative one hundred and twenty-three" ] [ -123 number>text ] unit-test diff --git a/extra/math/text/english/english.factor b/extra/math/text/english/english.factor index 5a10e7af37..492453450b 100755 --- a/extra/math/text/english/english.factor +++ b/extra/math/text/english/english.factor @@ -7,35 +7,44 @@ IN: math.text.english ] } 1&& and-needed? set ; : negative-text ( n -- str ) - 0 < "Negative " "" ? ; + 0 < "negative " "" ? ; : hundreds-place ( n -- str ) 100 /mod over 0 = [ 2drop "" ] [ - [ small-numbers " Hundred" append ] dip + [ small-numbers " hundred" append ] dip 0 = [ " and " append ] unless ] if ;