mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-14 17:47:19 +00:00
Add Other_Uppercase support from PropList.txt.
This commit is contained in:
@@ -345,6 +345,7 @@ typedef enum ucd_property_
|
||||
UCD_PROPERTY_DIACRITIC = 0x00002000, /**< @brief Diacritic PropList */
|
||||
UCD_PROPERTY_EXTENDER = 0x00004000, /**< @brief Extender PropList */
|
||||
UCD_PROPERTY_OTHER_LOWERCASE = 0x00008000, /**< @brief Other_Lowercase PropList */
|
||||
UCD_PROPERTY_OTHER_UPPERCASE = 0x00010000, /**< @brief Other_Uppercase PropList */
|
||||
} ucd_property;
|
||||
|
||||
/** @brief Return the properties of the specified codepoint.
|
||||
@@ -820,6 +821,7 @@ namespace ucd
|
||||
Diacritic = UCD_PROPERTY_DIACRITIC, /**< @brief Diacritic PropList */
|
||||
Extender = UCD_PROPERTY_EXTENDER, /**< @brief Extender PropList */
|
||||
Other_Lowercase = UCD_PROPERTY_OTHER_LOWERCASE, /**< @brief Other_Lowercase PropList */
|
||||
Other_Uppercase = UCD_PROPERTY_OTHER_UPPERCASE, /**< @brief Other_Uppercase PropList */
|
||||
};
|
||||
|
||||
/** @brief Return the properties of the specified codepoint.
|
||||
|
||||
+5
-4
@@ -999,6 +999,7 @@ static int properties_Nl(codepoint_t c)
|
||||
switch (c & 0xFFFFFF00)
|
||||
{
|
||||
case 0x2100:
|
||||
if (c >= 0x2160 && c <= 0x216F) return UCD_PROPERTY_OTHER_UPPERCASE;
|
||||
if (c >= 0x2170 && c <= 0x217F) return UCD_PROPERTY_OTHER_LOWERCASE;
|
||||
break;
|
||||
case 0x3000:
|
||||
@@ -1469,7 +1470,7 @@ static int properties_So(codepoint_t c)
|
||||
if (c == 0x23E2) return UCD_PROPERTY_OTHER_MATH;
|
||||
break;
|
||||
case 0x2400:
|
||||
if (c >= 0x24B6 && c <= 0x24CF) return UCD_PROPERTY_OTHER_ALPHABETIC;
|
||||
if (c >= 0x24B6 && c <= 0x24CF) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE;
|
||||
if (c >= 0x24D0 && c <= 0x24E9) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_LOWERCASE;
|
||||
break;
|
||||
case 0x2500:
|
||||
@@ -1491,9 +1492,9 @@ static int properties_So(codepoint_t c)
|
||||
if (c >= 0x266D && c <= 0x266E) return UCD_PROPERTY_OTHER_MATH;
|
||||
break;
|
||||
case 0x01F100:
|
||||
if (c >= 0x01F130 && c <= 0x01F149) return UCD_PROPERTY_OTHER_ALPHABETIC;
|
||||
if (c >= 0x01F150 && c <= 0x01F169) return UCD_PROPERTY_OTHER_ALPHABETIC;
|
||||
if (c >= 0x01F170 && c <= 0x01F189) return UCD_PROPERTY_OTHER_ALPHABETIC;
|
||||
if (c >= 0x01F130 && c <= 0x01F149) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE;
|
||||
if (c >= 0x01F150 && c <= 0x01F169) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE;
|
||||
if (c >= 0x01F170 && c <= 0x01F189) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -137,6 +137,7 @@ def properties(data):
|
||||
props += 8192 * data.get('Diacritic', 0)
|
||||
props += 16384 * data.get('Extender', 0)
|
||||
props += 32768 * data.get('Other_Lowercase', 0)
|
||||
props += 65536 * data.get('Other_Uppercase', 0)
|
||||
return props
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user