]> gitweb.factorcode.org Git - factor.git/blob - basis/unicode/data/data-docs.factor
unicode: make this the API for all unicode things.
[factor.git] / basis / unicode / data / data-docs.factor
1 ! Copyright (C) 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup kernel math strings unicode ;
4 IN: unicode.data
5
6 ABOUT: "unicode.data"
7
8 ARTICLE: "unicode.data" "Unicode data tables"
9 "The " { $vocab-link "unicode.data" } " vocabulary contains core Unicode data tables and code for parsing this from files. The following words access these data tables."
10 { $subsections
11     canonical-entry
12     combine-chars
13     combining-class
14     non-starter?
15     name>char
16     char>name
17     property?
18     category
19     ch>upper
20     ch>lower
21     ch>title
22     special-case
23 } ;
24
25 HELP: canonical-entry
26 { $values { "char" "a code point" } { "seq" string } }
27 { $description "Finds the canonical decomposition (NFD) for a code point" } ;
28
29 HELP: combine-chars
30 { $values { "a" "a code point" } { "b" "a code point" } { "char/f" "a code point" } }
31 { $description "If a followed by b can be combined in NFC, this returns the code point of their combination." } ;
32
33 HELP: compatibility-entry
34 { $values { "char" "a code point" } { "seq" string } }
35 { $description "This returns the compatibility decomposition (NFKD) for a code point" } ;
36
37 HELP: combining-class
38 { $values { "char" "a code point" } { "n" integer } }
39 { $description "Finds the combining class of a code point." } ;
40
41 HELP: non-starter?
42 { $values { "char" "a code point" } { "?" boolean } }
43 { $description "Returns true if the code point has a combining class." } ;
44
45 HELP: char>name
46 { $values { "char" "a code point" } { "name" string } }
47 { $description "Looks up the name of a given code point. Warning: this is not optimized for speed, to save space." } ;
48
49 HELP: name>char
50 { $values { "name" string } { "char" "a code point" } }
51 { $description "Looks up the code point corresponding to a given name." } ;
52
53 HELP: property?
54 { $values { "char" "a code point" } { "property" string } { "?" boolean } }
55 { $description "Tests whether the code point is listed under the given property in PropList.txt in the Unicode Character Database." } ;
56
57 HELP: category
58 { $values { "char" "a code point" } { "category" string } }
59 { $description "Returns the general category of a code point, in the form of a string. This will always be a string within the ASCII range of length two. If the code point is unassigned, then it returns " { $snippet "Cn" } "." } ;
60
61 HELP: ch>upper
62 { $values { "ch" "a code point" } { "upper" "a code point" } }
63 { $description "Returns the simple upper-cased version of the code point, if it exists. This does not handle context-sensitive or locale-dependent properties of linguistically accurate case conversion, and does not correctly handle characters which become multiple characters on conversion to this case." } ;
64
65 HELP: ch>lower
66 { $values { "ch" "a code point" } { "lower" "a code point" } }
67 { $description "Returns the simple lower-cased version of the code point, if it exists. This does not handle context-sensitive or locale-dependent properties of linguistically accurate case conversion, and does not correctly handle characters which become multiple characters on conversion to this case." } ;
68
69 HELP: ch>title
70 { $values { "ch" "a code point" } { "title" "a code point" } }
71 { $description "Returns the simple title-cased version of the code point, if it exists. This does not handle context-sensitive or locale-dependent properties of linguistically accurate case conversion, and does not correctly handle characters which become multiple characters on conversion to this case." } ;
72
73 HELP: special-case
74 { $values { "ch" "a code point" } { "casing-tuple" { "a tuple, or " { $link f } } } }
75 { $description "If a code point has special casing behavior, returns a tuple which represents that information." } ;