Fixing doc errors

db4
Daniel Ehrenberg 2009-01-08 15:38:03 -06:00
parent 4f4198d850
commit e927d84404
5 changed files with 44 additions and 54 deletions

View File

@ -35,7 +35,7 @@ HELP: >title
{ $description "Converts a string to title case." } ;
HELP: >case-fold
{ $values { "string" string } { "case-fold" string } }
{ $values { "string" string } { "fold" string } }
{ $description "Converts a string to case-folded form." } ;
HELP: upper?

View File

@ -3,57 +3,47 @@
USING: help.markup help.syntax kernel ;
IN: unicode.categories
HELP: LETTER?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether the code point is an upper-cased letter" } ;
HELP: LETTER
{ $class-description "The class of upper cased letters" } ;
HELP: Letter?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether the code point is a letter of any case" } ;
HELP: Letter
{ $class-description "The class of letters" } ;
HELP: alpha?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether the code point is alphanumeric" } ;
HELP: alpha
{ $class-description "The class of code points which are alphanumeric" } ;
HELP: blank?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether the code point is whitespace" } ;
HELP: blank
{ $class-description "The class of code points which are whitespace" } ;
HELP: character?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a number is a code point which has been assigned" } ;
HELP: character
{ $class-description "The class of numbers which are pre-defined Unicode code points" } ;
HELP: control?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a code point is a control character" } ;
HELP: control
{ $class-description "The class of control characters" } ;
HELP: digit?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a code point is a digit" } ;
HELP: digit
{ $class-description "The class of code coints which are digits" } ;
HELP: letter?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a code point is a lower-cased letter" } ;
HELP: letter
{ $class-description "The class of code points which are lower-cased letters" } ;
HELP: printable?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a code point is printable, as opposed to being a control character or formatting character" } ;
HELP: printable
{ $class-description "The class of characters which are printable, as opposed to being control or formatting characters" } ;
HELP: uncased?
{ $values { "ch" "a character" } { "?" "a boolean" } }
{ $description "Determines whether a character has a case" } ;
HELP: uncased
{ $class-description "The class of letters which don't have a case" } ;
ARTICLE: "unicode.categories" "Character classes"
{ $vocab-link "unicode.categories" } " is a vocabulary which provides predicates for determining if a code point has a particular property, for example being a lower cased letter. These should be used in preference to the " { $vocab-link "ASCII" "ascii" } " equivalents in most cases. Below are links to the useful predicates, but note that each of these is defined to be a predicate class."
{ $subsection blank? }
{ $subsection letter? }
{ $subsection LETTER? }
{ $subsection Letter? }
{ $subsection digit? }
{ $subsection printable? }
{ $subsection alpha? }
{ $subsection control? }
{ $subsection uncased? }
{ $subsection character? } ;
{ $vocab-link "unicode.categories" } " is a vocabulary which provides predicates for determining if a code point has a particular property, for example being a lower cased letter. These should be used in preference to the " { $vocab-link "ascii" } " equivalents in most cases. Below are links to classes of characters, but note that each of these also has a predicate defined, which is usually more useful."
{ $subsection blank }
{ $subsection letter }
{ $subsection LETTER }
{ $subsection Letter }
{ $subsection digit }
{ $subsection printable }
{ $subsection alpha }
{ $subsection control }
{ $subsection uncased }
{ $subsection character } ;
ABOUT: "unicode.categories"

View File

@ -15,37 +15,37 @@ ARTICLE: "unicode.data" "Unicode data tables"
{ $subsection property? } ;
HELP: load-script
{ $value { "filename" string } { "table" "an interval map" } }
{ $values { "filename" string } { "table" "an interval map" } }
{ $description "This loads a file that looks like Script.txt in the Unicode Character Database and converts it into an efficient interval map, where the keys are characters and the values are strings for the properties." } ;
HELP: canonical-entry
{ $value { "char" "a code point" } { "seq" string } }
{ $values { "char" "a code point" } { "seq" string } }
{ $description "Finds the canonical decomposition (NFD) for a code point" } ;
HELP: combine-chars
{ $value { "a" "a code point" } { "b" "a code point" } { "char/f" "a code point" } }
{ $values { "a" "a code point" } { "b" "a code point" } { "char/f" "a code point" } }
{ $description "If a followed by b can be combined in NFC, this returns the code point of their combination." } ;
HELP: compatibility-entry
{ $value { "char" "a code point" } { "seq" string } }
{ $values { "char" "a code point" } { "seq" string } }
{ $description "This returns the compatibility decomposition (NFKD) for a code point" } ;
HELP: combining-class
{ $value { "char" "a code point" } { "n" "an integer" } }
{ $values { "char" "a code point" } { "n" "an integer" } }
{ $description "Finds the combining class of a code point." } ;
HELP: non-starter?
{ $value { "char" "a code point" } { "?" "a boolean" } }
{ $values { "char" "a code point" } { "?" "a boolean" } }
{ $description "Returns true if the code point has a combining class." } ;
HELP: char>name
{ $value { "char" "a code point" } { "name" string } }
{ $values { "char" "a code point" } { "name" string } }
{ $description "Looks up the name of a given code point. Warning: this is not optimized for speed, to save space." } ;
HELP: name>char
{ $value { "name" string } { "char" "a code point" } }
{ $values { "name" string } { "char" "a code point" } }
{ $description "Looks up the code point corresponding to a given name." } ;
HELP: property?
{ $value { "char" "a code point" } { "property" string } { "?" "a boolean" } }
{ $values { "char" "a code point" } { "property" string } { "?" "a boolean" } }
{ $description "Tests whether the code point is listed under the given property in PropList.txt in the Unicode Character Database." } ;

View File

@ -24,8 +24,8 @@ VALUE: properties
: compatibility-entry ( char -- seq ) compatibility-map at ;
: combining-class ( char -- n ) class-map at ;
: non-starter? ( char -- ? ) class-map key? ;
: name>char ( string -- char ) name-map at ;
: char>name ( char -- string ) name-map value-at ;
: name>char ( name -- char ) name-map at ;
: char>name ( char -- name ) name-map value-at ;
: property? ( char property -- ? ) properties at interval-key? ;
! Loading data from UnicodeData.txt

View File

@ -23,5 +23,5 @@ HELP: nfkc
{ $description "Converts a string to Normalization Form KC" } ;
HELP: nfkd
{ $values { "string" string } { "nfc" "a string in NFKD" } }
{ $values { "string" string } { "nfkd" "a string in NFKD" } }
{ $description "Converts a string to Normalization Form KD" } ;