Browse Source

Add Other_ID_Start support from PropList.txt.

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

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

UCD_PROPERTY_DEPRECATED = 0x0000000000800000ull, /**< @brief Deprecated */ UCD_PROPERTY_DEPRECATED = 0x0000000000800000ull, /**< @brief Deprecated */
UCD_PROPERTY_SOFT_DOTTED = 0x0000000001000000ull, /**< @brief Soft_Dotted */ UCD_PROPERTY_SOFT_DOTTED = 0x0000000001000000ull, /**< @brief Soft_Dotted */
UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION = 0x0000000002000000ull, /**< @brief Logical_Order_Exception */ UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION = 0x0000000002000000ull, /**< @brief Logical_Order_Exception */
UCD_PROPERTY_OTHER_ID_START = 0x0000000004000000ull, /**< @brief Other_ID_Start */
}; };


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.
Deprecated = UCD_PROPERTY_DEPRECATED, /**< @brief Deprecated */ Deprecated = UCD_PROPERTY_DEPRECATED, /**< @brief Deprecated */
Soft_Dotted = UCD_PROPERTY_SOFT_DOTTED, /**< @brief Soft_Dotted */ Soft_Dotted = UCD_PROPERTY_SOFT_DOTTED, /**< @brief Soft_Dotted */
Logical_Order_Exception = UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION, /**< @brief Logical_Order_Exception */ Logical_Order_Exception = UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION, /**< @brief Logical_Order_Exception */
Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */
}; };


/** @brief Return the properties of the specified codepoint. /** @brief Return the properties of the specified codepoint.

+ 6
- 2
src/proplist.c View File

if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC; if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC;
break; break;
case 0x1800: case 0x1800:
if (c >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC;
if (c >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_ID_START;
if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC;
break; break;
case 0x1900: case 0x1900:
if (c >= 0x1FFD && c <= 0x1FFE) return UCD_PROPERTY_DIACRITIC; if (c >= 0x1FFD && c <= 0x1FFE) return UCD_PROPERTY_DIACRITIC;
break; break;
case 0x3000: case 0x3000:
if (c >= 0x309B && c <= 0x309C) return UCD_PROPERTY_DIACRITIC;
if (c >= 0x309B && c <= 0x309C) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_OTHER_ID_START;
break; break;
case 0xA700: case 0xA700:
if (c >= 0xA720 && c <= 0xA721) return UCD_PROPERTY_DIACRITIC; if (c >= 0xA720 && c <= 0xA721) return UCD_PROPERTY_DIACRITIC;
if (c == 0x207B) return UCD_PROPERTY_DASH; if (c == 0x207B) return UCD_PROPERTY_DASH;
if (c == 0x208B) return UCD_PROPERTY_DASH; if (c == 0x208B) return UCD_PROPERTY_DASH;
break; break;
case 0x2100:
if (c == 0x2118) return UCD_PROPERTY_OTHER_ID_START;
break;
case 0x2200: case 0x2200:
if (c == 0x2212) return UCD_PROPERTY_DASH; if (c == 0x2212) return UCD_PROPERTY_DASH;
break; break;
{ {
case 0x2100: case 0x2100:
if (c == 0x2129) return UCD_PROPERTY_OTHER_MATH; if (c == 0x2129) return UCD_PROPERTY_OTHER_MATH;
if (c == 0x212E) return UCD_PROPERTY_OTHER_ID_START;
if (c >= 0x2195 && c <= 0x2199) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x2195 && c <= 0x2199) return UCD_PROPERTY_OTHER_MATH;
if (c >= 0x219C && c <= 0x219F) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x219C && c <= 0x219F) return UCD_PROPERTY_OTHER_MATH;
if (c >= 0x21A1 && c <= 0x21A2) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x21A1 && c <= 0x21A2) return UCD_PROPERTY_OTHER_MATH;

+ 1
- 0
tools/printdata.py View File

props += (2 ** 23) * data.get('Deprecated', 0) props += (2 ** 23) * data.get('Deprecated', 0)
props += (2 ** 24) * data.get('Soft_Dotted', 0) props += (2 ** 24) * data.get('Soft_Dotted', 0)
props += (2 ** 25) * data.get('Logical_Order_Exception', 0) props += (2 ** 25) * data.get('Logical_Order_Exception', 0)
props += (2 ** 26) * data.get('Other_ID_Start', 0)
return props return props


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

Loading…
Cancel
Save