mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-02 22:52:29 +00:00
Support mapping a General Category to a General Category Group.
This commit is contained in:
+7
-2
@@ -2981,9 +2981,9 @@ ucd::category ucd::lookup_category(codepoint_t c)
|
|||||||
return Ii; // Invalid Unicode Codepoint
|
return Ii; // Invalid Unicode Codepoint
|
||||||
}
|
}
|
||||||
|
|
||||||
ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
ucd::category_group ucd::lookup_category_group(category c)
|
||||||
{
|
{
|
||||||
switch (lookup_category(c))
|
switch (c)
|
||||||
{
|
{
|
||||||
case Cc: case Cf: case Cn: case Co: case Cs:
|
case Cc: case Cf: case Cn: case Co: case Cs:
|
||||||
return C;
|
return C;
|
||||||
@@ -3003,3 +3003,8 @@ ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
|||||||
return I;
|
return I;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
||||||
|
{
|
||||||
|
return lookup_category_group(lookup_category(c));
|
||||||
|
}
|
||||||
|
|||||||
@@ -96,6 +96,13 @@ namespace ucd
|
|||||||
Zs, /**< @brief Space Separator */
|
Zs, /**< @brief Space Separator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @brief Lookup the General Category Group for a General Category.
|
||||||
|
*
|
||||||
|
* @param c The General Category to lookup.
|
||||||
|
* @return The General Category Group of the General Category.
|
||||||
|
*/
|
||||||
|
category_group lookup_category_group(category c);
|
||||||
|
|
||||||
/** @brief Lookup the General Category Group for a Unicode codepoint.
|
/** @brief Lookup the General Category Group for a Unicode codepoint.
|
||||||
*
|
*
|
||||||
* @param c The Unicode codepoint to lookup.
|
* @param c The Unicode codepoint to lookup.
|
||||||
|
|||||||
+7
-2
@@ -173,9 +173,9 @@ using namespace ucd;
|
|||||||
sys.stdout.write('}\n')
|
sys.stdout.write('}\n')
|
||||||
|
|
||||||
sys.stdout.write("""
|
sys.stdout.write("""
|
||||||
ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
ucd::category_group ucd::lookup_category_group(category c)
|
||||||
{
|
{
|
||||||
switch (lookup_category(c))
|
switch (c)
|
||||||
{
|
{
|
||||||
case Cc: case Cf: case Cn: case Co: case Cs:
|
case Cc: case Cf: case Cn: case Co: case Cs:
|
||||||
return C;
|
return C;
|
||||||
@@ -195,4 +195,9 @@ ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
|||||||
return I;
|
return I;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ucd::category_group ucd::lookup_category_group(codepoint_t c)
|
||||||
|
{
|
||||||
|
return lookup_category_group(lookup_category(c));
|
||||||
|
}
|
||||||
""")
|
""")
|
||||||
|
|||||||
Reference in New Issue
Block a user