]> gitweb.factorcode.org Git - factor.git/commitdiff
Cleaning up Unicode docs
authorDaniel Ehrenberg <littledan@Macintosh-103.local>
Thu, 29 Jan 2009 05:45:12 +0000 (23:45 -0600)
committerDaniel Ehrenberg <littledan@Macintosh-103.local>
Thu, 29 Jan 2009 05:45:12 +0000 (23:45 -0600)
basis/unicode/collation/collation-docs.factor

index 183ca85b69ff5a50af12aa7a6b813b212639d315..990390e82fbe060b9681506b632195f0b1f54f40 100644 (file)
@@ -1,11 +1,12 @@
-USING: help.syntax help.markup strings byte-arrays ;
+USING: help.syntax help.markup strings byte-arrays math.order ;
 IN: unicode.collation
 
 ARTICLE: "unicode.collation" "Collation and weak comparison"
-"The " { $vocab-link "unicode.collation" "unicode.collation" } " vocabulary implements the Unicode Collation Algorithm. The Unicode Collation Algorithm (UTS #10) forms a reasonable way to sort strings when accouting for all of the characters in Unicode. It is far preferred over code point order when sorting for human consumption, in user interfaces. At the moment, only the default Unicode collation element table (DUCET) is used, but a more accurate collation would take locale into account. The following words are defined:"
+"The " { $vocab-link "unicode.collation" "unicode.collation" } " vocabulary implements the Unicode Collation Algorithm. The Unicode Collation Algorithm (UTS #10) forms a reasonable way to sort strings when accouting for all of the characters in Unicode. It is far preferred over code point order when sorting for human consumption, in user interfaces. At the moment, only the default Unicode collation element table (DUCET) is used, but a more accurate collation would take locale into account. The following words are useful for collation directly:"
 { $subsection sort-strings }
 { $subsection collation-key }
 { $subsection string<=> }
+"Predicates for weak equality testing:"
 { $subsection primary= }
 { $subsection secondary= }
 { $subsection tertiary= }
@@ -14,12 +15,12 @@ ARTICLE: "unicode.collation" "Collation and weak comparison"
 ABOUT: "unicode.collation"
 
 HELP: sort-strings
-{ $values { "strings" "a sequence of strings" } { "sorted" "the strings in DUCET order" } }
-{ $description "This word takes a sequence of strings and sorts them according to the UCA, using code point order as a tie-breaker." } ;
+{ $values { "strings" "a sequence of strings" } { "sorted" "the strings in lexicographical order" } }
+{ $description "This word takes a sequence of strings and sorts them according to the Unicode Collation Algorithm with the default collation order described in the DUCET. It uses code point order as a tie-breaker." } ;
 
 HELP: collation-key
 { $values { "string" string } { "key" byte-array } }
-{ $description "This takes a string and gives a representation of the collation key, which can be compared with <=>" } ;
+{ $description "This takes a string and gives a representation of the collation key, which can be compared with " { $link <=> } ". The representation is according to the DUCET." } ;
 
 HELP: string<=>
 { $values { "str1" string } { "str2" string } { "<=>" "one of +lt+, +gt+ or +eq+" } }
@@ -27,16 +28,16 @@ HELP: string<=>
 
 HELP: primary=
 { $values { "str1" string } { "str2" string } { "?" "t or f" } }
-{ $description "This checks whether the first level of collation is identical. This is the least specific kind of equality test. In Latin script, it can be understood as ignoring case, punctuation and accent marks." } ;
+{ $description "This checks whether the first level of collation key is identical. This is the least specific kind of equality test. In Latin script, it can be understood as ignoring case, punctuation, whitespace and accent marks." } ;
 
 HELP: secondary=
 { $values { "str1" string } { "str2" string } { "?" "t or f" } }
-{ $description "This checks whether the first two levels of collation are equal. For Latin script, this means accent marks are significant again, and it is otherwise similar to primary=." } ;
+{ $description "This checks whether the first two levels of collation key are equal. For Latin script, this means accent marks are significant again, and it is otherwise similar to " { $link primary= } "." } ;
 
 HELP: tertiary=
 { $values { "str1" string } { "str2" string } { "?" "t or f" } }
-{ $description "Along the same lines as secondary=, but case is significant." } ;
+{ $description "This checks if the first three levels of collation key are equal. For Latin-based scripts, it can be understood as testing for what " { $link secondary= } " tests for, but case is significant." } ;
 
 HELP: quaternary=
 { $values { "str1" string } { "str2" string } { "?" "t or f" } }
-{ $description "This is similar to tertiary= but it makes punctuation significant again, while still leaving out things like null bytes and Hebrew vowel marks, which mean absolutely nothing in collation." } ;
+{ $description "This checks if the first four levels of collation key are equal. This is similar to " { $link tertiary= } " but it makes punctuation significant again, while still leaving out things like null bytes and Hebrew vowel marks, which mean absolutely nothing in collation." } ;