mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-04 14:33:31 +00:00
isupper: include the Other_Uppercase characters.
This commit is contained in:
+16
-2
@@ -175,8 +175,22 @@ int ucd_isspace(codepoint_t c)
|
||||
|
||||
int ucd_isupper(codepoint_t c)
|
||||
{
|
||||
return ucd_lookup_category(c) == UCD_CATEGORY_Lu
|
||||
|| ucd_tolower(c) != c;
|
||||
switch (ucd_lookup_category(c))
|
||||
{
|
||||
case UCD_CATEGORY_Lu:
|
||||
return 1;
|
||||
case UCD_CATEGORY_Lt:
|
||||
return ucd_tolower(c) != c;
|
||||
case UCD_CATEGORY_Nl:
|
||||
return (c >= 0x002160 && c <= 0x00216F); // Other_Uppercase
|
||||
case UCD_CATEGORY_So:
|
||||
return (c >= 0x0024B6 && c <= 0x0024CF) // Other_Uppercase
|
||||
|| (c >= 0x01F130 && c <= 0x01F149) // Other_Uppercase
|
||||
|| (c >= 0x01F150 && c <= 0x01F169) // Other_Uppercase
|
||||
|| (c >= 0x01F170 && c <= 0x01F189); // Other_Uppercase
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int ucd_isxdigit(codepoint_t c)
|
||||
|
||||
+4
-2
@@ -100,9 +100,11 @@ def isalpha(data):
|
||||
return 0
|
||||
|
||||
def isupper(data):
|
||||
if data.get('LowerCase', null) != null:
|
||||
if data.get('GeneralCategory', 'Cn') == 'Lu':
|
||||
return 1
|
||||
elif data.get('GeneralCategory', 'Cn') == 'Lu':
|
||||
elif data.get('Other_Uppercase', 0):
|
||||
return 1
|
||||
elif data.get('LowerCase', null) != null: # Some Lt characters have lowercase forms.
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user