]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "ascii: adding title case."
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Apr 2012 21:37:56 +0000 (14:37 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Apr 2012 21:37:56 +0000 (14:37 -0700)
This reverts commit 66ecd199d8ceb208a557d8bce4af3cd2f818145f.

basis/ascii/ascii-docs.factor
basis/ascii/ascii-tests.factor
basis/ascii/ascii.factor

index faec03b06b6621b24a777c8862c2b0ffba039410..54e66fea8a485d1f371f61590fee48e2fb65a5e9 100644 (file)
@@ -57,14 +57,6 @@ HELP: >upper
 { $values { "str" "a string" } { "upper" "a string" } }\r
 { $description "Converts an ASCII string to upper case." } ;\r
 \r
-HELP: >title\r
-{ $values { "string" "a string" } { "title" "a string" } }\r
-{ $description "Converts a string to title case." } ;\r
-\r
-HELP: >words\r
-{ $values { "str" "a string" } { "words" "an array of strings" } }\r
-{ $description "Divides the string up into words." } ;\r
-\r
 ARTICLE: "ascii" "ASCII"\r
 "The " { $vocab-link "ascii" } " vocabulary implements support for the legacy ASCII character set. Most applications should use " { $link "unicode" } " instead."\r
 $nl\r
@@ -85,7 +77,6 @@ $nl
     ch>upper\r
     >lower\r
     >upper\r
-    >title\r
 } ;\r
 \r
 ABOUT: "ascii"\r
index d46388d2d39034eafb46cde83a4c04bd57869a6a..8551ba53efc7c6dc715b6f4f20c1ff1e2221774b 100644 (file)
@@ -1,5 +1,4 @@
-USING: ascii tools.test sequences kernel math strings ;
-
+USING: ascii tools.test sequences kernel math ;
 IN: ascii.tests
 
 [ t ] [ CHAR: a letter? ] unit-test
@@ -18,5 +17,3 @@ IN: ascii.tests
 
 [ "HELLO HOW ARE YOU?" ] [ "hellO hOw arE YOU?" >upper ] unit-test
 [ "i'm good thx bai" ] [ "I'm Good THX bai" >lower ] unit-test
-[ "Hello How Are You?" ] [ "hEllo how ARE yOU?" >title ] unit-test
-[ { " " "Hello" "    " "World" } ] [ " Hello    World" >words [ >string ] map ] unit-test
index 4070944ceb1072eca50068b0c3d90d00665cce46..6f89dea6d92ce199cb5883d6ad0280bb187dc4d4 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
-USING: combinators.short-circuit hints kernel math math.order\r
-sequences splitting.monotonic strings ;\r
+USING: kernel math math.order sequences strings\r
+combinators.short-circuit hints ;\r
 IN: ascii\r
 \r
 : ascii? ( ch -- ? ) 0 127 between? ; inline\r
@@ -18,10 +18,6 @@ IN: ascii
 : >lower ( str -- lower ) [ ch>lower ] map ;\r
 : ch>upper ( ch -- upper ) dup letter? [ 0x20 - ] when ; inline\r
 : >upper ( str -- upper ) [ ch>upper ] map ;\r
-: >words ( str -- words ) [ [ blank? ] bi@ = ] slice monotonic-slice ;\r
-: capitalize ( str -- title ) unclip [ >lower ] [ ch>upper ] bi* prefix ;\r
-: >title ( str -- title ) >words [ capitalize ] map concat ;\r
 \r
 HINTS: >lower string ;\r
 HINTS: >upper string ;\r
-\r