Browse Source

Add Radical support from PropList.txt.

master
Reece H. Dunn 8 years ago
parent
commit
5b9300b042
3 changed files with 8 additions and 0 deletions
  1. 2
    0
      src/include/ucd/ucd.h
  2. 5
    0
      src/proplist.c
  3. 1
    0
      tools/printdata.py

+ 2
- 0
src/include/ucd/ucd.h View File

UCD_PROPERTY_OTHER_GRAPHEME_EXTEND = 0x00020000, /**< @brief Other_Grapheme_Extend */ UCD_PROPERTY_OTHER_GRAPHEME_EXTEND = 0x00020000, /**< @brief Other_Grapheme_Extend */
UCD_PROPERTY_IDS_BINARY_OPERATOR = 0x00040000, /**< @brief IDS_Binary_Operator */ UCD_PROPERTY_IDS_BINARY_OPERATOR = 0x00040000, /**< @brief IDS_Binary_Operator */
UCD_PROPERTY_IDS_TRINARY_OPERATOR = 0x00080000, /**< @brief IDS_Trinary_Operator */ UCD_PROPERTY_IDS_TRINARY_OPERATOR = 0x00080000, /**< @brief IDS_Trinary_Operator */
UCD_PROPERTY_RADICAL = 0x00100000, /**< @brief Radical */
} ucd_property; } ucd_property;


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.
Other_Grapheme_Extend = UCD_PROPERTY_OTHER_GRAPHEME_EXTEND, /**< @brief Other_Grapheme_Extend */ 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_Binary_Operator = UCD_PROPERTY_IDS_BINARY_OPERATOR, /**< @brief IDS_Binary_Operator */
IDS_Trinary_Operator = UCD_PROPERTY_IDS_TRINARY_OPERATOR, /**< @brief IDS_Trinary_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. /** @brief Return the properties of the specified codepoint.

+ 5
- 0
src/proplist.c View File

if (c >= 0x2660 && c <= 0x2663) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x2660 && c <= 0x2663) return UCD_PROPERTY_OTHER_MATH;
if (c >= 0x266D && c <= 0x266E) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x266D && c <= 0x266E) return UCD_PROPERTY_OTHER_MATH;
break; break;
case 0x2E00:
if (c >= 0x2E80 && c <= 0x2E99) return UCD_PROPERTY_RADICAL;
if (c >= 0x2E9B && c <= 0x2EF3) return UCD_PROPERTY_RADICAL;
break;
case 0x2F00: case 0x2F00:
if (c >= 0x2F00 && c <= 0x2FD5) return UCD_PROPERTY_RADICAL;
if (c >= 0x2FF0 && c <= 0x2FF1) return UCD_PROPERTY_IDS_BINARY_OPERATOR; if (c >= 0x2FF0 && c <= 0x2FF1) return UCD_PROPERTY_IDS_BINARY_OPERATOR;
if (c >= 0x2FF2 && c <= 0x2FF3) return UCD_PROPERTY_IDS_TRINARY_OPERATOR; if (c >= 0x2FF2 && c <= 0x2FF3) return UCD_PROPERTY_IDS_TRINARY_OPERATOR;
if (c >= 0x2FF4 && c <= 0x2FFB) return UCD_PROPERTY_IDS_BINARY_OPERATOR; if (c >= 0x2FF4 && c <= 0x2FFB) return UCD_PROPERTY_IDS_BINARY_OPERATOR;

+ 1
- 0
tools/printdata.py View File

props += (2 ** 17) * data.get('Other_Grapheme_Extend', 0) props += (2 ** 17) * data.get('Other_Grapheme_Extend', 0)
props += (2 ** 18) * data.get('IDS_Binary_Operator', 0) props += (2 ** 18) * data.get('IDS_Binary_Operator', 0)
props += (2 ** 19) * data.get('IDS_Trinary_Operator', 0) props += (2 ** 19) * data.get('IDS_Trinary_Operator', 0)
props += (2 ** 20) * data.get('Radical', 0)
return props return props


if __name__ == '__main__': if __name__ == '__main__':

Loading…
Cancel
Save