From 5b9300b0423c11342517907cd7c66d29720e74f3 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 14 Apr 2017 17:57:18 +0100 Subject: [PATCH] Add Radical support from PropList.txt. --- src/include/ucd/ucd.h | 2 ++ src/proplist.c | 5 +++++ tools/printdata.py | 1 + 3 files changed, 8 insertions(+) diff --git a/src/include/ucd/ucd.h b/src/include/ucd/ucd.h index cd130a5b..883ae809 100644 --- a/src/include/ucd/ucd.h +++ b/src/include/ucd/ucd.h @@ -349,6 +349,7 @@ typedef enum ucd_property_ UCD_PROPERTY_OTHER_GRAPHEME_EXTEND = 0x00020000, /**< @brief Other_Grapheme_Extend */ UCD_PROPERTY_IDS_BINARY_OPERATOR = 0x00040000, /**< @brief IDS_Binary_Operator */ UCD_PROPERTY_IDS_TRINARY_OPERATOR = 0x00080000, /**< @brief IDS_Trinary_Operator */ + UCD_PROPERTY_RADICAL = 0x00100000, /**< @brief Radical */ } ucd_property; /** @brief Return the properties of the specified codepoint. @@ -828,6 +829,7 @@ namespace ucd Other_Grapheme_Extend = UCD_PROPERTY_OTHER_GRAPHEME_EXTEND, /**< @brief Other_Grapheme_Extend */ IDS_Binary_Operator = UCD_PROPERTY_IDS_BINARY_OPERATOR, /**< @brief IDS_Binary_Operator */ IDS_Trinary_Operator = UCD_PROPERTY_IDS_TRINARY_OPERATOR, /**< @brief IDS_Trinary_Operator */ + Radical = UCD_PROPERTY_RADICAL, /**< @brief Radical */ }; /** @brief Return the properties of the specified codepoint. diff --git a/src/proplist.c b/src/proplist.c index 02493bfa..da8b4943 100644 --- a/src/proplist.c +++ b/src/proplist.c @@ -1514,7 +1514,12 @@ static int properties_So(codepoint_t c) if (c >= 0x2660 && c <= 0x2663) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x266D && c <= 0x266E) return UCD_PROPERTY_OTHER_MATH; break; + case 0x2E00: + if (c >= 0x2E80 && c <= 0x2E99) return UCD_PROPERTY_RADICAL; + if (c >= 0x2E9B && c <= 0x2EF3) return UCD_PROPERTY_RADICAL; + break; case 0x2F00: + if (c >= 0x2F00 && c <= 0x2FD5) return UCD_PROPERTY_RADICAL; if (c >= 0x2FF0 && c <= 0x2FF1) return UCD_PROPERTY_IDS_BINARY_OPERATOR; if (c >= 0x2FF2 && c <= 0x2FF3) return UCD_PROPERTY_IDS_TRINARY_OPERATOR; if (c >= 0x2FF4 && c <= 0x2FFB) return UCD_PROPERTY_IDS_BINARY_OPERATOR; diff --git a/tools/printdata.py b/tools/printdata.py index 2a2c3add..903c1020 100755 --- a/tools/printdata.py +++ b/tools/printdata.py @@ -141,6 +141,7 @@ def properties(data): props += (2 ** 17) * data.get('Other_Grapheme_Extend', 0) props += (2 ** 18) * data.get('IDS_Binary_Operator', 0) props += (2 ** 19) * data.get('IDS_Trinary_Operator', 0) + props += (2 ** 20) * data.get('Radical', 0) return props if __name__ == '__main__':