HomeAboutCodePastes
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordieggsy <dieggsy@protonmail.com>2020-12-17 14:21:33 -0500
committerdieggsy <dieggsy@protonmail.com>2020-12-17 14:21:33 -0500
commit22c1c79349b989a8668a9a76887239abeae2ea21 (patch)
treead342813ed978b8a20871bc3239946c3dbafddb4
parentced331210e29886feed3ae0501103677c738c100 (diff)
downloadicu-22c1c79349b989a8668a9a76887239abeae2ea21.tar.gz
Add wiki
-rw-r--r--icu.svnwiki99
1 files changed, 99 insertions, 0 deletions
diff --git a/icu.svnwiki b/icu.svnwiki
new file mode 100644
index 0000000..ff6e74e
--- /dev/null
+++ b/icu.svnwiki
@@ -0,0 +1,99 @@
+[[tags: egg]]
+
+[[toc:]]
+
+== icu
+
+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 str [form])</procedure>
+
+Returns the normalized form of {{str}} to the destination string according to
+{{form}}, which can be 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_forDigit}}. Determines the character representation for a
+specific digit in the specified radix.
+
+<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.