Changeset 39459 in project


Ignore:
Timestamp:
12/24/20 04:37:51 (3 weeks ago)
Author:
dieggsy
Message:

Update icu docs with chalk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/icu

    r39437 r39459  
    11[[tags: egg]]
    2 
    32[[toc:]]
    4 
    53== icu
     4Chicken bindings to the ICU unicode library
    65
    76Select bindings to the
     
    1110
    1211This library is partially inspired by
    13 [[https://docs.python.org/3/library/unicodedata.html|Python's unicodedata
    14 library]]. As it deals with unicode, it also reexports the utf8 egg for ease of use.
     12[[https://docs.python.org/3/library/unicodedata.html|Python's unicodedata library]].
     13As it deals with unicode, it also reexports the utf8 egg for ease of use.
    1514
    1615=== Procedures
    1716
    1817==== Names
     18
    1919<procedure>(char-from-name name)</procedure>
    20 Return char corresponding to string name {{name}}. {{name}} is passed through
    21 {{string-upcase}}.
     20Return char corresponding to string name {{name}}. {{name}} is passed
     21through {{string-upcase}}.
    2222
    2323<enscript highlight="scheme">
     
    3636
    3737<procedure>(char-decomposition char)</procedure>
    38 
    3938Returns the decomposition mapping of {{char}}.
    4039
     
    4443</enscript>
    4544
    46 <procedure>(string-normalize str [form])</procedure>
    47 
    48 Returns the normalized form of {{str}} to the destination string according to
    49 {{form}}, which can be any of {{"nfc"}}, {{"nfkc"}}, {{"nfd"}}, or "{{nfkd}}"
     45<procedure>(string-normalize input #!optional (form "nfkc"))</procedure>
     46Returns the normalized form of {{str}} to the destination string
     47according to {{form}}
     48
     49; form : Any of {{"nfc"}}, {{"nfkc"}}, {{"nfd"}}, or {{"nfkd"}}
    5050
    5151<enscript highlight="scheme">
     
    5454
    5555==== Numbers
     56
    5657<procedure>(char-digit-value char)</procedure>
    57 Binding for {{u_charDigitValue}}. Returns the decimal digit value of a decimal
    58 digit character.
     58Binding for {{u_charDigitValue}}. Returns the decimal digit value of a
     59decimal digit character.
    5960
    6061<enscript highlight="scheme">
     
    7273
    7374<procedure>(char-digit char radix)</procedure>
    74 
    7575Binding for {{u_digit}}. Returns the decimal digit value of the code point in
    7676the specified radix.
     
    8181
    8282<procedure>(char-for-digit char radix)</procedure>
    83 
    84 Binding for {{u_forDigit}}. Determines the character representation for a
    85 specific digit in the specified radix.
    86 
    87 <enscript highlight="scheme">
    88 (char-for-digit 15 16) ;; => #\f
    89 </enscript>
    90 
    91 <procedure>(char-digit? char)</procedure>
    92 
    9383Binding for {{u_isdigit}}. Determines whether the specified code point is a
    9484digit character according to Java.
    9585
     86<enscript highlight="scheme">
     87(char-for-digit 15 16) ;; => #\f
     88</enscript>
     89
     90<procedure>(char-digit? char)</procedure>
     91Binding for {{u_isdigit}}. Determines whether the specified code point is a
     92digit character according to Java.
     93
    9694<procedure>(char-xdigit? char)</procedure>
    97 
    9895Binding for {{u_isxdigit}}. Determines whether the specified code point is a
    9996hexadecimal digit.
    10097
    101 === Operators and transformers
     98==== Operators and transformers
    10299
    103100<procedure>(char-mirror char)</procedure>
    104 
    105101Binding for {{u_charMirror}}. Maps the specified character to a "mirror-image"
    106102character.
    107103
    108 <procedure>(char-bidi-paired-pracket)</procedure>
    109 
     104<procedure>(char-bidi-paired-bracket char)</procedure>
    110105Binding for {{u_getBidiPairedBracket}}. Maps the specified character to its
    111106paired bracket character.
     
    114109<procedure>(char->upper char)</procedure>
    115110<procedure>(char->title char)</procedure>
    116 
    117111Bindings for {{u_tolower}},{{u_toupper}}, and {{u_totitle}}
    118112
    119 === Properties
     113==== Properties
    120114
    121115<procedure>(char-category char)</procedure>
    122 
    123116Binding for {{u_charType}}. Returns the general category value for the code
    124117point (an integer, see below).
     
    128121
    129122Categories:
    130 <enscript>
    131 category/unassigned
    132 category/uppercase-letter
    133 category/lowercase-letter
    134 category/titlecase-letter
    135 category/modifier-letter
    136 category/other-letter
    137 category/non-spacing-mark
    138 category/enclosing-mark
    139 category/combining-spacing-mark
    140 category/decimal-digit-number
    141 category/letter-number
    142 category/other-number
    143 category/space-separator
    144 category/line-separator
    145 category/paragraph-separator
    146 category/control-char
    147 category/format-char
    148 category/private-use-char
    149 category/surrogate
    150 category/dash-punctuation
    151 category/start-punctuation
    152 category/end-punctuation
    153 category/connector-punctuation
    154 category/other-punctuation
    155 category/math-symbol
    156 category/currency-symbol
    157 category/modifier-symbol
    158 category/other-symbol
    159 category/initial-punctuation
    160 category/final-punctuation
    161 category/char-category-count
    162 </enscript>
     123
     124<constant>category/unassigned</constant>
     125<constant>category/uppercase-letter</constant>
     126<constant>category/lowercase-letter</constant>
     127<constant>category/titlecase-letter</constant>
     128<constant>category/modifier-letter</constant>
     129<constant>category/other-letter</constant>
     130<constant>category/non-spacing-mark</constant>
     131<constant>category/enclosing-mark</constant>
     132<constant>category/combining-spacing-mark</constant>
     133<constant>category/decimal-digit-number</constant>
     134<constant>category/letter-number</constant>
     135<constant>category/other-number</constant>
     136<constant>category/space-separator</constant>
     137<constant>category/line-separator</constant>
     138<constant>category/paragraph-separator</constant>
     139<constant>category/control-char</constant>
     140<constant>category/format-char</constant>
     141<constant>category/private-use-char</constant>
     142<constant>category/surrogate</constant>
     143<constant>category/dash-punctuation</constant>
     144<constant>category/start-punctuation</constant>
     145<constant>category/end-punctuation</constant>
     146<constant>category/connector-punctuation</constant>
     147<constant>category/other-punctuation</constant>
     148<constant>category/math-symbol</constant>
     149<constant>category/currency-symbol</constant>
     150<constant>category/modifier-symbol</constant>
     151<constant>category/other-symbol</constant>
     152<constant>category/initial-punctuation</constant>
     153<constant>category/final-punctuation</constant>
     154<constant>category/char-category-count</constant>
     155----
    163156
    164157<procedure>(char-direction char)</procedure>
    165 
    166158Binding for {{u_charDirection}}. Returns the bidirectional category value for
    167159the code point, which is used in the Unicode bidirectional algorithm (an
     
    169161
    170162You can convert this to a symbol with {{direction->integer}}, and vice versa
    171 with {{integer->direction}}
     163with {{integer->direction}}.
    172164
    173165Directions:
    174 <enscript>
    175 direction/left-to-right
    176 direction/right-to-left
    177 direction/european-number
    178 direction/european-number-separator
    179 direction/european-number-terminator
    180 direction/arabic-number
    181 direction/common-number-separator
    182 direction/block-separator
    183 direction/segment-separator
    184 direction/white-space-neutral
    185 direction/other-neutral
    186 direction/left-to-right-embedding
    187 direction/left-to-right-override
    188 direction/right-to-left-arabic
    189 direction/right-to-left-embedding
    190 direction/right-to-left-override
    191 direction/pop-directional-format
    192 direction/dir-non-spacing-mark
    193 direction/boundary-neutral
    194 direction/first-strong-isolate
    195 direction/left-to-right-isolate
    196 direction/right-to-left-isolate
    197 direction/pop-directional-isolate
    198 direction/char-direction-count
    199 </enscript>
     166
     167<constant>direction/left-to-right</constant>
     168<constant>direction/right-to-left</constant>
     169<constant>direction/european-number</constant>
     170<constant>direction/european-number-separator</constant>
     171<constant>direction/european-number-terminator</constant>
     172<constant>direction/arabic-number</constant>
     173<constant>direction/common-number-separator</constant>
     174<constant>direction/block-separator</constant>
     175<constant>direction/segment-separator</constant>
     176<constant>direction/white-space-neutral</constant>
     177<constant>direction/other-neutral</constant>
     178<constant>direction/left-to-right-embedding</constant>
     179<constant>direction/left-to-right-override</constant>
     180<constant>direction/right-to-left-arabic</constant>
     181<constant>direction/right-to-left-embedding</constant>
     182<constant>direction/right-to-left-override</constant>
     183<constant>direction/pop-directional-format</constant>
     184<constant>direction/dir-non-spacing-mark</constant>
     185<constant>direction/boundary-neutral</constant>
     186<constant>direction/first-strong-isolate</constant>
     187<constant>direction/left-to-right-isolate</constant>
     188<constant>direction/right-to-left-isolate</constant>
     189<constant>direction/pop-directional-isolate</constant>
     190<constant>direction/char-direction-count</constant>
     191----
    200192
    201193<procedure>(char-combining-class char)</procedure>
    202 
    203194Binding for {{u_getCombiningClass}}. Returns the combining class of the code
    204195point as specified in UnicodeData.txt.
    205196
    206 === Predicates
    207 
    208 <enscript>
    209 char-mirrored?
    210 char-ualphabetic?
    211 char-ulowercase?
    212 char-uuppercase?
    213 char-uwhitespace?
    214 char-whitespace?
    215 char-java-space?
    216 char-space?
    217 char-blank?
    218 char-lower?
    219 char-upper?
    220 char-digit?
    221 char-alpha?
    222 char-alnum?
    223 char-xdigit?
    224 char-punct?
    225 char-graph?
    226 char-defined?
    227 char-cntrl?
    228 char-iso-control?
    229 char-print?
    230 char-base?
    231 </enscript>
    232 
    233 
     197==== Predicates
     198
     199<procedure>(char-mirrored? char)</procedure>
     200<procedure>(char-ualphabetic? char)</procedure>
     201<procedure>(char-ulowercase? char)</procedure>
     202<procedure>(char-uuppercase? char)</procedure>
     203<procedure>(char-uwhitespace? char)</procedure>
     204<procedure>(char-whitespace? char)</procedure>
     205<procedure>(char-java-space? char)</procedure>
     206<procedure>(char-space? char)</procedure>
     207<procedure>(char-blank? char)</procedure>
     208<procedure>(char-lower? char)</procedure>
     209<procedure>(char-upper? char)</procedure>
     210<procedure>(char-alpha? char)</procedure>
     211<procedure>(char-alnum? char)</procedure>
     212<procedure>(char-punct? char)</procedure>
     213<procedure>(char-graph? char)</procedure>
     214<procedure>(char-defined? char)</procedure>
     215<procedure>(char-cntrl? char)</procedure>
     216<procedure>(char-iso-control? char)</procedure>
     217<procedure>(char-print? char)</procedure>
     218<procedure>(char-base? char)</procedure>
    234219=== Author
    235 
    236220Diego A. Mundo
    237221
    238222=== License
    239 
    240223[[https://github.com/unicode-org/icu/blob/master/icu4c/LICENSE|ICU License]]
    241224
    242225=== Version History
    243 
     226; 0.3.2 : Document with chalk
     227; 0.3.1 : Fix issue with utf8 reexports
    244228; 0.3.0 : Slight API change
    245229; 0.2.0 : Make string-normalize form parameter optional
Note: See TracChangeset for help on using the changeset viewer.