mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 06:12:55 +00:00
Add <noBreak> support from UnicodeData.txt.
This commit is contained in:
@@ -330,6 +330,7 @@ ucd_script ucd_lookup_script(codepoint_t c);
|
||||
typedef enum ucd_property_
|
||||
{
|
||||
UCD_PROPERTY_WHITE_SPACE = 0x0001, /**< @brief White_Space */
|
||||
UCD_PROPERTY_NO_BREAK = 0x0002, /**< @brief <noBreak> */
|
||||
} ucd_property;
|
||||
|
||||
/** @brief Return the properties of the specified codepoint.
|
||||
@@ -790,6 +791,7 @@ namespace ucd
|
||||
enum property
|
||||
{
|
||||
White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */
|
||||
noBreak = UCD_PROPERTY_NO_BREAK, /**< @brief <noBreak> */
|
||||
};
|
||||
|
||||
/** @brief Return the properties of the specified codepoint.
|
||||
|
||||
@@ -36,9 +36,25 @@ ucd_property ucd_properties(codepoint_t c, ucd_category category)
|
||||
return UCD_PROPERTY_WHITE_SPACE;
|
||||
}
|
||||
return 0;
|
||||
case UCD_CATEGORY_Pd:
|
||||
if (c == 0x2011) // NON-BREAKING HYPHEN
|
||||
return UCD_PROPERTY_NO_BREAK;
|
||||
return 0;
|
||||
case UCD_CATEGORY_Po:
|
||||
if (c == 0x0F0C) // TIBETAN MARK DELIMITER TSHEG BSTAR
|
||||
return UCD_PROPERTY_NO_BREAK;
|
||||
return 0;
|
||||
case UCD_CATEGORY_Zl:
|
||||
case UCD_CATEGORY_Zp:
|
||||
return UCD_PROPERTY_WHITE_SPACE;
|
||||
case UCD_CATEGORY_Zs:
|
||||
switch (c)
|
||||
{
|
||||
case 0x00A0: // NO-BREAK SPACE
|
||||
case 0x2007: // FIGURE SPACE
|
||||
case 0x202F: // NARROW NO-BREAK SPACE
|
||||
return UCD_PROPERTY_WHITE_SPACE | UCD_PROPERTY_NO_BREAK;
|
||||
}
|
||||
return UCD_PROPERTY_WHITE_SPACE;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user