HomeAboutCodePastes
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icu.scm246
1 files changed, 181 insertions, 65 deletions
diff --git a/icu.scm b/icu.scm
index 77a2b5b..dd5c023 100644
--- a/icu.scm
+++ b/icu.scm
@@ -4,7 +4,68 @@
char-decomposition
char-numeric-value
char-category
+ category->integer
+ integer->category
+ category/unassigned
+ category/uppercase-letter
+ category/lowercase-letter
+ category/titlecase-letter
+ category/modifier-letter
+ category/other-letter
+ category/non-spacing-mark
+ category/enclosing-mark
+ category/combining-spacing-mark
+ category/decimal-digit-number
+ category/letter-number
+ category/other-number
+ category/space-separator
+ category/line-separator
+ category/paragraph-separator
+ category/control-char
+ category/format-char
+ category/private-use-char
+ category/surrogate
+ category/dash-punctuation
+ category/start-punctuation
+ category/end-punctuation
+ category/connector-punctuation
+ category/other-punctuation
+ category/math-symbol
+ category/currency-symbol
+ category/modifier-symbol
+ category/other-symbol
+ category/initial-punctuation
+ category/final-punctuation
+ category/char-category-count
+
char-direction
+ direction->integer
+ integer->direction
+ direction/left-to-right
+ direction/right-to-left
+ direction/european-number
+ direction/european-number-separator
+ direction/european-number-terminator
+ direction/arabic-number
+ direction/common-number-separator
+ direction/block-separator
+ direction/segment-separator
+ direction/white-space-neutral
+ direction/other-neutral
+ direction/left-to-right-embedding
+ direction/left-to-right-override
+ direction/right-to-left-arabic
+ direction/right-to-left-embedding
+ direction/right-to-left-override
+ direction/pop-directional-format
+ direction/dir-non-spacing-mark
+ direction/boundary-neutral
+ direction/first-strong-isolate
+ direction/left-to-right-isolate
+ direction/right-to-left-isolate
+ direction/pop-directional-isolate
+ direction/char-direction-count
+
char-combining-class
char-mirror
char-bidi-paired-bracket
@@ -116,77 +177,132 @@
(define-foreign-enum-type (category int)
- (category->int int->category)
- ((unassigned category/unassigned) U_UNASSIGNED)
- ((uppercase-letter category/uppercase-letter) U_UPPERCASE_LETTER)
- ((lowercase-letter category/lowercase-letter) U_LOWERCASE_LETTER)
- ((titlecase-letter category/titlecase-letter) U_TITLECASE_LETTER)
- ((modifier-letter category/modifier-letter) U_MODIFIER_LETTER)
- ((other-letter category/other-letter) U_OTHER_LETTER)
- ((non-spacing-mark category/non-spacing-mark) U_NON_SPACING_MARK)
- ((enclosing-mark category/enclosing-mark) U_ENCLOSING_MARK)
- ((combining-spacing-mark category/combining-spacing-mark) U_COMBINING_SPACING_MARK)
- ((decimal-digit-number category/decimal-digit-number) U_DECIMAL_DIGIT_NUMBER)
- ((letter-number category/letter-number) U_LETTER_NUMBER)
- ((other-number category/other-number) U_OTHER_NUMBER)
- ((space-separator category/space-separator) U_SPACE_SEPARATOR)
- ((line-separator category/line-separator) U_LINE_SEPARATOR)
- ((paragraph-separator category/paragraph-separator) U_PARAGRAPH_SEPARATOR)
- ((control-char category/control-char) U_CONTROL_CHAR)
- ((format-char category/format-char) U_FORMAT_CHAR)
- ((private-use-char category/private-use-char) U_PRIVATE_USE_CHAR)
- ((surrogate category/surrogate) U_SURROGATE)
- ((dash-punctuation category/dash-punctuation) U_DASH_PUNCTUATION)
- ((start-punctuation category/start-punctuation) U_START_PUNCTUATION)
- ((end-punctuation category/end-punctuation) U_END_PUNCTUATION)
- ((connector-punctuation category/connector-punctuation) U_CONNECTOR_PUNCTUATION)
- ((other-punctuation category/other-punctuation) U_OTHER_PUNCTUATION)
- ((math-symbol category/math-symbol) U_MATH_SYMBOL)
- ((currency-symbol category/currency-symbol) U_CURRENCY_SYMBOL)
- ((modifier-symbol category/modifier-symbol) U_MODIFIER_SYMBOL)
- ((other-symbol category/other-symbol) U_OTHER_SYMBOL)
- ((initial-punctuation category/initial-punctuation) U_INITIAL_PUNCTUATION)
- ((final-punctuation category/final-punctuation) U_FINAL_PUNCTUATION)
- ((char-category-count category/char-category-count) U_CHAR_CATEGORY_COUNT))
+ (category->integer integer->category)
+ ((category/unassigned U_UNASSIGNED) U_UNASSIGNED)
+ ((category/uppercase-letter U_UPPERCASE_LETTER) U_UPPERCASE_LETTER)
+ ((category/lowercase-letter U_LOWERCASE_LETTER) U_LOWERCASE_LETTER)
+ ((category/titlecase-letter U_TITLECASE_LETTER) U_TITLECASE_LETTER)
+ ((category/modifier-letter U_MODIFIER_LETTER) U_MODIFIER_LETTER)
+ ((category/other-letter U_OTHER_LETTER) U_OTHER_LETTER)
+ ((category/non-spacing-mark U_NON_SPACING_MARK) U_NON_SPACING_MARK)
+ ((category/enclosing-mark U_ENCLOSING_MARK) U_ENCLOSING_MARK)
+ ((category/combining-spacing-mark U_COMBINING_SPACING_MARK) U_COMBINING_SPACING_MARK)
+ ((category/decimal-digit-number U_DECIMAL_DIGIT_NUMBER) U_DECIMAL_DIGIT_NUMBER)
+ ((category/letter-number U_LETTER_NUMBER) U_LETTER_NUMBER)
+ ((category/other-number U_OTHER_NUMBER) U_OTHER_NUMBER)
+ ((category/space-separator U_SPACE_SEPARATOR) U_SPACE_SEPARATOR)
+ ((category/line-separator U_LINE_SEPARATOR) U_LINE_SEPARATOR)
+ ((category/paragraph-separator U_PARAGRAPH_SEPARATOR) U_PARAGRAPH_SEPARATOR)
+ ((category/control-char U_CONTROL_CHAR) U_CONTROL_CHAR)
+ ((category/format-char U_FORMAT_CHAR) U_FORMAT_CHAR)
+ ((category/private-use-char U_PRIVATE_USE_CHAR) U_PRIVATE_USE_CHAR)
+ ((category/surrogate U_SURROGATE) U_SURROGATE)
+ ((category/dash-punctuation U_DASH_PUNCTUATION) U_DASH_PUNCTUATION)
+ ((category/start-punctuation U_START_PUNCTUATION) U_START_PUNCTUATION)
+ ((category/end-punctuation U_END_PUNCTUATION) U_END_PUNCTUATION)
+ ((category/connector-punctuation U_CONNECTOR_PUNCTUATION) U_CONNECTOR_PUNCTUATION)
+ ((category/other-punctuation U_OTHER_PUNCTUATION) U_OTHER_PUNCTUATION)
+ ((category/math-symbol U_MATH_SYMBOL) U_MATH_SYMBOL)
+ ((category/currency-symbol U_CURRENCY_SYMBOL) U_CURRENCY_SYMBOL)
+ ((category/modifier-symbol U_MODIFIER_SYMBOL) U_MODIFIER_SYMBOL)
+ ((category/other-symbol U_OTHER_SYMBOL) U_OTHER_SYMBOL)
+ ((category/initial-punctuation U_INITIAL_PUNCTUATION) U_INITIAL_PUNCTUATION)
+ ((category/final-punctuation U_FINAL_PUNCTUATION) U_FINAL_PUNCTUATION)
+ ((category/char-category-count U_CHAR_CATEGORY_COUNT) U_CHAR_CATEGORY_COUNT))
+
+ (define category/unassigned U_UNASSIGNED)
+ (define category/uppercase-letter U_UPPERCASE_LETTER)
+ (define category/lowercase-letter U_LOWERCASE_LETTER)
+ (define category/titlecase-letter U_TITLECASE_LETTER)
+ (define category/modifier-letter U_MODIFIER_LETTER)
+ (define category/other-letter U_OTHER_LETTER)
+ (define category/non-spacing-mark U_NON_SPACING_MARK)
+ (define category/enclosing-mark U_ENCLOSING_MARK)
+ (define category/combining-spacing-mark U_COMBINING_SPACING_MARK)
+ (define category/decimal-digit-number U_DECIMAL_DIGIT_NUMBER)
+ (define category/letter-number U_LETTER_NUMBER)
+ (define category/other-number U_OTHER_NUMBER)
+ (define category/space-separator U_SPACE_SEPARATOR)
+ (define category/line-separator U_LINE_SEPARATOR)
+ (define category/paragraph-separator U_PARAGRAPH_SEPARATOR)
+ (define category/control-char U_CONTROL_CHAR)
+ (define category/format-char U_FORMAT_CHAR)
+ (define category/private-use-char U_PRIVATE_USE_CHAR)
+ (define category/surrogate U_SURROGATE)
+ (define category/dash-punctuation U_DASH_PUNCTUATION)
+ (define category/start-punctuation U_START_PUNCTUATION)
+ (define category/end-punctuation U_END_PUNCTUATION)
+ (define category/connector-punctuation U_CONNECTOR_PUNCTUATION)
+ (define category/other-punctuation U_OTHER_PUNCTUATION)
+ (define category/math-symbol U_MATH_SYMBOL)
+ (define category/currency-symbol U_CURRENCY_SYMBOL)
+ (define category/modifier-symbol U_MODIFIER_SYMBOL)
+ (define category/other-symbol U_OTHER_SYMBOL)
+ (define category/initial-punctuation U_INITIAL_PUNCTUATION)
+ (define category/final-punctuation U_FINAL_PUNCTUATION)
+ (define category/char-category-count U_CHAR_CATEGORY_COUNT)
(define (char-category char)
- (let ((result ((foreign-lambda* int ((int32 code))
- "C_return(u_charType(code));")
- (char->integer char))))
- (int->category result)))
+ ((foreign-lambda* int ((int32 code))
+ "C_return(u_charType(code));")
+ (char->integer char)))
(define-foreign-enum-type (direction int)
- (direction->int int->direction)
- ((left-to-right direction/left-to-right ) U_LEFT_TO_RIGHT)
- ((right-to-left direction/right-to-left ) U_RIGHT_TO_LEFT)
- ((european-number direction/european-number ) U_EUROPEAN_NUMBER)
- ((european-number-separator direction/european-number-separator ) U_EUROPEAN_NUMBER_SEPARATOR)
- ((european-number-terminator direction/european-number-terminator) U_EUROPEAN_NUMBER_TERMINATOR)
- ((arabic-number direction/arabic-number ) U_ARABIC_NUMBER)
- ((common-number-separator direction/common-number-separator ) U_COMMON_NUMBER_SEPARATOR)
- ((block-separator direction/block-separator ) U_BLOCK_SEPARATOR)
- ((segment-separator direction/segment-separator ) U_SEGMENT_SEPARATOR)
- ((white-space-neutral direction/white-space-neutral ) U_WHITE_SPACE_NEUTRAL)
- ((other-neutral direction/other-neutral ) U_OTHER_NEUTRAL)
- ((left-to-right-embedding direction/left-to-right-embedding ) U_LEFT_TO_RIGHT_EMBEDDING)
- ((left-to-right-override direction/left-to-right-override ) U_LEFT_TO_RIGHT_OVERRIDE)
- ((right-to-left-arabic direction/right-to-left-arabic ) U_RIGHT_TO_LEFT_ARABIC)
- ((right-to-left-embedding direction/right-to-left-embedding ) U_RIGHT_TO_LEFT_EMBEDDING)
- ((right-to-left-override direction/right-to-left-override ) U_RIGHT_TO_LEFT_OVERRIDE)
- ((pop-directional-format direction/pop-directional-format ) U_POP_DIRECTIONAL_FORMAT)
- ((dir-non-spacing-mark direction/dir-non-spacing-mark ) U_DIR_NON_SPACING_MARK)
- ((boundary-neutral direction/boundary-neutral ) U_BOUNDARY_NEUTRAL)
- ((first-strong-isolate direction/first-strong-isolate ) U_FIRST_STRONG_ISOLATE)
- ((left-to-right-isolate direction/left-to-right-isolate ) U_LEFT_TO_RIGHT_ISOLATE)
- ((right-to-left-isolate direction/right-to-left-isolate ) U_RIGHT_TO_LEFT_ISOLATE)
- ((pop-directional-isolate direction/pop-directional-isolate ) U_POP_DIRECTIONAL_ISOLATE)
- ((char-direction-count direction/char-direction-count ) U_CHAR_DIRECTION_COUNT))
+ (direction->integer integer->direction)
+ ((direction/left-to-right U_LEFT_TO_RIGHT) U_LEFT_TO_RIGHT)
+ ((direction/right-to-left U_RIGHT_TO_LEFT) U_RIGHT_TO_LEFT)
+ ((direction/european-number U_EUROPEAN_NUMBER) U_EUROPEAN_NUMBER)
+ ((direction/european-number-separator U_EUROPEAN_NUMBER_SEPARATOR) U_EUROPEAN_NUMBER_SEPARATOR)
+ ((direction/european-number-terminator U_EUROPEAN_NUMBER_TERMINATOR) U_EUROPEAN_NUMBER_TERMINATOR)
+ ((direction/arabic-number U_ARABIC_NUMBER) U_ARABIC_NUMBER)
+ ((direction/common-number-separator U_COMMON_NUMBER_SEPARATOR) U_COMMON_NUMBER_SEPARATOR)
+ ((direction/block-separator U_BLOCK_SEPARATOR) U_BLOCK_SEPARATOR)
+ ((direction/segment-separator U_SEGMENT_SEPARATOR) U_SEGMENT_SEPARATOR)
+ ((direction/white-space-neutral U_WHITE_SPACE_NEUTRAL) U_WHITE_SPACE_NEUTRAL)
+ ((direction/other-neutral U_OTHER_NEUTRAL) U_OTHER_NEUTRAL)
+ ((direction/left-to-right-embedding U_LEFT_TO_RIGHT_EMBEDDING) U_LEFT_TO_RIGHT_EMBEDDING)
+ ((direction/left-to-right-override U_LEFT_TO_RIGHT_OVERRIDE) U_LEFT_TO_RIGHT_OVERRIDE)
+ ((direction/right-to-left-arabic U_RIGHT_TO_LEFT_ARABIC) U_RIGHT_TO_LEFT_ARABIC)
+ ((direction/right-to-left-embedding U_RIGHT_TO_LEFT_EMBEDDING) U_RIGHT_TO_LEFT_EMBEDDING)
+ ((direction/right-to-left-override U_RIGHT_TO_LEFT_OVERRIDE) U_RIGHT_TO_LEFT_OVERRIDE)
+ ((direction/pop-directional-format U_POP_DIRECTIONAL_FORMAT) U_POP_DIRECTIONAL_FORMAT)
+ ((direction/dir-non-spacing-mark U_DIR_NON_SPACING_MARK) U_DIR_NON_SPACING_MARK)
+ ((direction/boundary-neutral U_BOUNDARY_NEUTRAL) U_BOUNDARY_NEUTRAL)
+ ((direction/first-strong-isolate U_FIRST_STRONG_ISOLATE) U_FIRST_STRONG_ISOLATE)
+ ((direction/left-to-right-isolate U_LEFT_TO_RIGHT_ISOLATE) U_LEFT_TO_RIGHT_ISOLATE)
+ ((direction/right-to-left-isolate U_RIGHT_TO_LEFT_ISOLATE) U_RIGHT_TO_LEFT_ISOLATE)
+ ((direction/pop-directional-isolate U_POP_DIRECTIONAL_ISOLATE) U_POP_DIRECTIONAL_ISOLATE)
+ ((direction/char-direction-count U_CHAR_DIRECTION_COUNT) U_CHAR_DIRECTION_COUNT))
+
+ (define direction/left-to-right U_LEFT_TO_RIGHT)
+ (define direction/right-to-left U_RIGHT_TO_LEFT)
+ (define direction/european-number U_EUROPEAN_NUMBER)
+ (define direction/european-number-separator U_EUROPEAN_NUMBER_SEPARATOR)
+ (define direction/european-number-terminator U_EUROPEAN_NUMBER_TERMINATOR)
+ (define direction/arabic-number U_ARABIC_NUMBER)
+ (define direction/common-number-separator U_COMMON_NUMBER_SEPARATOR)
+ (define direction/block-separator U_BLOCK_SEPARATOR)
+ (define direction/segment-separator U_SEGMENT_SEPARATOR)
+ (define direction/white-space-neutral U_WHITE_SPACE_NEUTRAL)
+ (define direction/other-neutral U_OTHER_NEUTRAL)
+ (define direction/left-to-right-embedding U_LEFT_TO_RIGHT_EMBEDDING)
+ (define direction/left-to-right-override U_LEFT_TO_RIGHT_OVERRIDE)
+ (define direction/right-to-left-arabic U_RIGHT_TO_LEFT_ARABIC)
+ (define direction/right-to-left-embedding U_RIGHT_TO_LEFT_EMBEDDING)
+ (define direction/right-to-left-override U_RIGHT_TO_LEFT_OVERRIDE)
+ (define direction/pop-directional-format U_POP_DIRECTIONAL_FORMAT)
+ (define direction/dir-non-spacing-mark U_DIR_NON_SPACING_MARK)
+ (define direction/boundary-neutral U_BOUNDARY_NEUTRAL)
+ (define direction/first-strong-isolate U_FIRST_STRONG_ISOLATE)
+ (define direction/left-to-right-isolate U_LEFT_TO_RIGHT_ISOLATE)
+ (define direction/right-to-left-isolate U_RIGHT_TO_LEFT_ISOLATE)
+ (define direction/pop-directional-isolate U_POP_DIRECTIONAL_ISOLATE)
+ (define direction/char-direction-count U_CHAR_DIRECTION_COUNT)
(define (char-direction char)
- (let ((result ((foreign-lambda* int ((int32 code))
- "C_return(u_charDirection(code));")
- (char->integer char))))
- (int->direction result)))
+ ((foreign-lambda* int ((int32 code))
+ "C_return(u_charDirection(code));")
+ (char->integer char)))
(define (char-combining-class char)
((foreign-lambda* unsigned-byte ((int32 code))