Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] [[toc:]] == icu Chicken bindings to the ICU unicode library Select bindings to the [[https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/index.html|ICU unicode library]]. === Introduction This library is partially inspired by [[https://docs.python.org/3/library/unicodedata.html|Python's unicodedata library]]. As it deals with unicode, it also reexports the utf8 egg for ease of use. === Procedures ==== Names <procedure>(char-from-name name)</procedure> Return char corresponding to string name {{name}}. {{name}} is passed through {{string-upcase}}. <enscript highlight="scheme"> (char-from-name "fire") ;; => #\x1f525 (char-from-name "FIRE") ;; => #\x1f525 </enscript> <procedure>(char-string-name char)</procedure> Returns string name for {{char}}. <enscript highlight="scheme"> (char-string-name #\x1f525) ;; => "FIRE" </enscript> ==== Decomposition and Normalization <procedure>(char-decomposition char)</procedure> Returns the decomposition mapping of {{char}}. For example, for ¼, VULGAR FRACTION ONE QUARTER: <enscript highlight="scheme"> (char-decomposition #\xBC) ;; => '(#\1 #\x2044 #\4) </enscript> <procedure>(string-normalize input #!optional (form "nfkc"))</procedure> Returns the normalized form of {{str}} to the destination string according to {{form}} ; form : Any of {{"nfc"}}, {{"nfkc"}}, {{"nfd"}}, or {{"nfkd"}} <enscript highlight="scheme"> (string-normalize "¼") ;; => "1/4" </enscript> ==== Numbers <procedure>(char-digit-value char)</procedure> Binding for {{u_charDigitValue}}. Returns the decimal digit value of a decimal digit character. <enscript highlight="scheme"> (char-digit-value #\4) ;; => 4 </enscript> <procedure>(char-numeric-value char)</procedure> Binding for {{u_getNumericValue}}. Get the numeric value (as a double) for a Unicode code point as defined in the Unicode Character Database. <enscript highlight="scheme"> (char-numeric-value #\4) ;; => 4.0 (char-numeric-value #\xBC) ;; => .25 </enscript> <procedure>(char-digit char radix)</procedure> Binding for {{u_digit}}. Returns the decimal digit value of the code point in the specified radix. <enscript highlight="scheme"> (char-digit #\f 16) ;; => 15 </enscript> <procedure>(char-for-digit char radix)</procedure> Binding for {{u_isdigit}}. Determines whether the specified code point is a digit character according to Java. <enscript highlight="scheme"> (char-for-digit 15 16) ;; => #\f </enscript> <procedure>(char-digit? char)</procedure> Binding for {{u_isdigit}}. Determines whether the specified code point is a digit character according to Java. <procedure>(char-xdigit? char)</procedure> Binding for {{u_isxdigit}}. Determines whether the specified code point is a hexadecimal digit. ==== Operators and transformers <procedure>(char-mirror char)</procedure> Binding for {{u_charMirror}}. Maps the specified character to a "mirror-image" character. <procedure>(char-bidi-paired-bracket char)</procedure> Binding for {{u_getBidiPairedBracket}}. Maps the specified character to its paired bracket character. <procedure>(char->lower char)</procedure> <procedure>(char->upper char)</procedure> <procedure>(char->title char)</procedure> Bindings for {{u_tolower}},{{u_toupper}}, and {{u_totitle}} ==== Properties <procedure>(char-category char)</procedure> Binding for {{u_charType}}. Returns the general category value for the code point (an integer, see below). You can convert this to a symbol with {{category->integer}}, and vice versa with {{integer->category}} Categories: <constant>category/unassigned</constant> <constant>category/uppercase-letter</constant> <constant>category/lowercase-letter</constant> <constant>category/titlecase-letter</constant> <constant>category/modifier-letter</constant> <constant>category/other-letter</constant> <constant>category/non-spacing-mark</constant> <constant>category/enclosing-mark</constant> <constant>category/combining-spacing-mark</constant> <constant>category/decimal-digit-number</constant> <constant>category/letter-number</constant> <constant>category/other-number</constant> <constant>category/space-separator</constant> <constant>category/line-separator</constant> <constant>category/paragraph-separator</constant> <constant>category/control-char</constant> <constant>category/format-char</constant> <constant>category/private-use-char</constant> <constant>category/surrogate</constant> <constant>category/dash-punctuation</constant> <constant>category/start-punctuation</constant> <constant>category/end-punctuation</constant> <constant>category/connector-punctuation</constant> <constant>category/other-punctuation</constant> <constant>category/math-symbol</constant> <constant>category/currency-symbol</constant> <constant>category/modifier-symbol</constant> <constant>category/other-symbol</constant> <constant>category/initial-punctuation</constant> <constant>category/final-punctuation</constant> <constant>category/char-category-count</constant> ---- <procedure>(char-direction char)</procedure> Binding for {{u_charDirection}}. Returns the bidirectional category value for the code point, which is used in the Unicode bidirectional algorithm (an integer, see below). You can convert this to a symbol with {{direction->integer}}, and vice versa with {{integer->direction}}. Directions: <constant>direction/left-to-right</constant> <constant>direction/right-to-left</constant> <constant>direction/european-number</constant> <constant>direction/european-number-separator</constant> <constant>direction/european-number-terminator</constant> <constant>direction/arabic-number</constant> <constant>direction/common-number-separator</constant> <constant>direction/block-separator</constant> <constant>direction/segment-separator</constant> <constant>direction/white-space-neutral</constant> <constant>direction/other-neutral</constant> <constant>direction/left-to-right-embedding</constant> <constant>direction/left-to-right-override</constant> <constant>direction/right-to-left-arabic</constant> <constant>direction/right-to-left-embedding</constant> <constant>direction/right-to-left-override</constant> <constant>direction/pop-directional-format</constant> <constant>direction/dir-non-spacing-mark</constant> <constant>direction/boundary-neutral</constant> <constant>direction/first-strong-isolate</constant> <constant>direction/left-to-right-isolate</constant> <constant>direction/right-to-left-isolate</constant> <constant>direction/pop-directional-isolate</constant> <constant>direction/char-direction-count</constant> ---- <procedure>(char-combining-class char)</procedure> Binding for {{u_getCombiningClass}}. Returns the combining class of the code point as specified in UnicodeData.txt. ==== Predicates <procedure>(char-mirrored? char)</procedure> <procedure>(char-ualphabetic? char)</procedure> <procedure>(char-ulowercase? char)</procedure> <procedure>(char-uuppercase? char)</procedure> <procedure>(char-uwhitespace? char)</procedure> <procedure>(char-whitespace? char)</procedure> <procedure>(char-java-space? char)</procedure> <procedure>(char-space? char)</procedure> <procedure>(char-blank? char)</procedure> <procedure>(char-lower? char)</procedure> <procedure>(char-upper? char)</procedure> <procedure>(char-alpha? char)</procedure> <procedure>(char-alnum? char)</procedure> <procedure>(char-punct? char)</procedure> <procedure>(char-graph? char)</procedure> <procedure>(char-defined? char)</procedure> <procedure>(char-cntrl? char)</procedure> <procedure>(char-iso-control? char)</procedure> <procedure>(char-print? char)</procedure> <procedure>(char-base? char)</procedure> === Author Diego A. Mundo === Repository [[https://git.sr.ht/~dieggsy/icu]] === Version History ; 0.3.2 : Document with chalk ; 0.3.1 : Fix issue with utf8 reexports ; 0.3.0 : Slight API change ; 0.2.0 : Make string-normalize form parameter optional ; 0.1.0 : Initial version === License Unicode COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) Copyright © 1991-2020 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation. THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 14 to 2?