From f8fef903d535fa9ceb2677ab0c7dacc7692ea0f3 Mon Sep 17 00:00:00 2001 From: Julian Graham
Date: Thu, 24 Dec 2009 00:25:19 -0500 Subject: [PATCH] Support for Unicode general categories * libguile/chars.c, libguile/chars.h (scm_char_general_category): New function. * test-suite/tests/chars.test: Unit tests for `char-general-category'. * doc/ref/api-data.texi (Characters): Documentation for `char-general-category'. --- doc/ref/api-data.texi | 91 +++++++++++++++++++++++++++++++++++++++++++ libguile/chars.c | 20 +++++++++ libguile/chars.h | 1 + test-suite/tests/chars.test | 7 +++- 4 files changed, 118 insertions(+), 1 deletions(-) diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 6721b12..df5db48 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -1875,6 +1875,97 @@ Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}. @end deffn address@hidden {Scheme Procedure} char-general-category chr address@hidden {C Function} scm_char_general_category (chr) +Return a symbol giving the one- or two-letter name of the Unicode +general category assigned to @var{chr} or @code{#f} if no named category +is assigned. The following table provides a list of category names +along with their meanings. + address@hidden @columnfractions .1 .4 .1 .4 address@hidden L + @tab Letter + @tab Pf + @tab Final quote punctuation address@hidden Lu + @tab Uppercase letter + @tab Po + @tab Other punctuation address@hidden Ll + @tab Lowercase letter + @tab S + @tab Symbol address@hidden Lt + @tab Titlecase letter + @tab Sm + @tab Math symbol address@hidden Lm + @tab Modifier letter + @tab Sc + @tab Currency symbol address@hidden Lo + @tab Other letter + @tab Sk + @tab Modifier symbol address@hidden M + @tab Mark + @tab So + @tab Other synbol address@hidden Mn + @tab Non-spacing mark + @tab Z + @tab Separator address@hidden Mc + @tab Combining spacing mark + @tab Zs + @tab Space separator address@hidden Me + @tab Enclosing mark + @tab Zl + @tab Line separator address@hidden N + @tab Number + @tab Zp + @tab Paragraph separator address@hidden Nd + @tab Decimal digit number + @tab C + @tab Other address@hidden Nl + @tab Letter number + @tab Cc + @tab Control address@hidden No + @tab Other number + @tab Cf + @tab Format address@hidden P + @tab Punctuation + @tab Cs + @tab Surrogate address@hidden Pc + @tab Connector punctuation + @tab Co + @tab Private use address@hidden Pd + @tab Dash punctuation + @tab Cn + @tab Unassigned address@hidden Ps + @tab Open punctuation + @tab + @tab address@hidden Pe + @tab Close punctuation + @tab + @tab address@hidden Pi + @tab Initial quote punctuation + @tab + @tab address@hidden multitable address@hidden deffn + @rnindex char->integer @deffn {Scheme Procedure} char->integer chr @deffnx {C Function} scm_char_to_integer (chr) diff --git a/libguile/chars.c b/libguile/chars.c index 1c4d106..36cb08d 100644 --- a/libguile/chars.c +++ b/libguile/chars.c @@ -25,6 +25,7 @@ #include