|
PinYin * | pinYin_new (const char *pinYin_str) |
| New a PinYin instance. More...
|
|
guint | pinYin_get_tone (const PinYin *pinYin) |
| Return the explicit-specified tone of PinYin. More...
|
|
guint | pinYin_strip_tone (PinYin *pinYin) |
| Strip the tone mark of PinYin and return explicit-specified the tone Id. More...
|
|
void | pinYin_add_tone (PinYin *pinYin, guint tone, gboolean useTrailNumber) |
| Add the tone mark to pinYin. More...
|
|
PinYin * | pinYin_convert_accent_format (const PinYin *pinYin, PinYin_Accent_Format toFormat, gboolean useTrailNumber) |
| Convert a PinYin to new accent formatReturn a newly allocated PinYin instance which contains the converted content. More...
|
|
ZhuYin * | pinYin_to_zhuYin (const PinYin *pinYin, ZhuYin_ToneMark_Format toFormat) |
| PinYin to ZhuYin. More...
|
|
ZhuYin * | zhuYin_new (const char *zhuYin_str) |
| New a ZhuYin instance. More...
|
|
guint | zhuYin_get_tone (const ZhuYin *zhuYin) |
| Return the explicit-specified tone of ZhuYin. More...
|
|
guint | zhuYin_strip_tone (ZhuYin *zhuYin) |
| Strip the tone mark of ZhuYin and return explicit-specified the tone Id. More...
|
|
void | zhuYin_add_tone (ZhuYin *zhuYin, guint tone, ZhuYin_ToneMark_Format toFormat) |
| Add the tone mark to zhuYin. More...
|
|
ZhuYin * | zhuYin_convert_toneMark_format (const ZhuYin *zhuYin, ZhuYin_ToneMark_Format toFormat) |
| Convert zhuyin to another tone mark format. More...
|
|
PinYin * | zhuYin_to_pinYin (const ZhuYin *zhuYin, PinYin_Accent_Format toFormat, gboolean useTrailNumber) |
| ZhuYin to PinYin. More...
|
|
ZhuYin_Symbol | zhuYin_Symbol_from_id (ZhuYin_Symbol_Id id) |
| Return the ZhuYin symbol by its Id. More...
|
|
ZhuYin_Symbol_Id | zhuYin_Symbol_get_id (ZhuYin_Symbol zSym) |
| Return the Id of a ZhuYin symbol. More...
|
|
gboolean | zhuYin_Symbol_is_initial (ZhuYin_Symbol zSym) |
| Whether the zhuYin symbol is an initial. More...
|
|
gboolean | zhuYin_Symbol_is_medial (ZhuYin_Symbol zSym) |
| Whether the zhuYin symbol is an medial. More...
|
|
gboolean | zhuYin_Symbol_is_final (ZhuYin_Symbol zSym) |
| Whether the zhuYin symbol is an final. More...
|
|
gboolean | zhuYin_Symbol_is_tone (ZhuYin_Symbol zSym) |
| Whether the zhuYin symbol is either a toneMark or number which indicates the tone. More...
|
|
guint | zhuYin_Symbol_to_toneMark_id (ZhuYin_Symbol zSym) |
| Return the tone id of given tone mark. More...
|
|
ZhuYin_Symbol | zhuYin_Symbol_from_toneMark_id (guint toneMark_id) |
| Return the tone mark of given tone id. More...
|
|
void | pinYin_convert_accent_format_scalar_func (sqlite3_context *context, int argc, sqlite3_value **argv) |
| PinYin convert accent format scalar function for SQL command call. More...
|
|
void | pinYin_to_zhuYin_scalar_func (sqlite3_context *context, int argc, sqlite3_value **argv) |
| PinYin to ZhuYin converting scalar function for SQL command call. More...
|
|
void | zhuYin_convert_toneMark_format_scalar_func (sqlite3_context *context, int argc, sqlite3_value **argv) |
| ZhuYin convert accent format scalar function for SQL command call. More...
|
|
void | zhuYin_to_pinYin_scalar_func (sqlite3_context *context, int argc, sqlite3_value **argv) |
| ZhuYin to PinYin converting scalar function for SQL command call. More...
|
|
This header file lists the functions for PinYin and ZhuYin processing, such as conversion between HanYu pinyin conversion C functions, and corresponding SQL scalar functions.
PinYin is displayed and stored as uppercase, which is same with kMandarin in Unihan.
Note that this header is included in Unihan.h, so no need to includes it explicitly if Unihan.h is also included.
There are two PinYin symbols with accents, diaeresis U (Ü,ㄩ), and circumflex E (Ê,ㄝ) . As the their pronunciations are different from U and E.
In Romanization of Chinese (ISO 7098:1991), under certain circumstances, accents can be omitted, such as JÜ -> JU , QÜ ->QU. This is adopted in PRC education system. Use PINYIN_ACCENT_ORIGINAL for this purpose.
Unihan project does not have circumflex E (Ê), the other is same with ISO 7098. Use PINYIN_ACCENT_UNIHAN for Unihan project.
Because Ü is not on most of the keyboards, there are various ways to represent Ü. For example, CEDICT use U: (PINYIN_ACCENT_TRAILING); while most of Chinese input method use V as substitute (PINYIN_ACCENT_INPUT_METHOD).
In English documents such as passport, the accent are usually ignores, use PINYIN_ACCENT_NONE for this purpose.
Preserving accents unconditionally makes conversion and education easier, use PINYIN_ACCENT_ALWAYS for this purpose.
Note that this enumeration is not for the pinyin tone mark. See pinYin_convert_accent_format() pinyin tone mark handling.
- See also
- pinYin_convert_accent_format()
Enumerator |
---|
PINYIN_ACCENT_ALWAYS |
Ü is always represented as Ü, Ê is always represented as Ê.
|
PINYIN_ACCENT_ORIGINAL |
MOE CN standard ISO 7098:1991.
|
PINYIN_ACCENT_UNIHAN |
Ü is represented as Ü, Ê is represented as E.
|
PINYIN_ACCENT_TRAILING |
Ü is represented as U:, Ê is represented as E.
|
PINYIN_ACCENT_INPUT_METHOD |
Ü is represented as V, Ê is represented as E.
|
PINYIN_ACCENT_NONE |
Ü is represented as U, Ê is represented as E.
|
Originally, the neutral (fifth) tone mark of zhuyin is put in the front, while the first tone mark is omitted. Use ZHUYIN_TONEMARK_ORIGINAL for this.
However, for Zhuyin based input method, the neutral is put in the back. Use ZHUYIN_TONEMARK_INPUT_METHOD for this.
If preserving tonemark is desireable, then use ZHUYIN_TONEMARK_ALWAYS, in which the first tone is not omitted, otherwise is same with ZHUYIN_TONEMARK_INPUT_METHOD.
If numerical tone mark is desired, use ZHUYIN_TONEMARK_NUMERICAL.
- See also
- zhuYin_convert_toneMark_format()
Enumerator |
---|
ZHUYIN_TONEMARK_ALWAYS |
Neutral (fifth) tone mark is put in the end, while the first tone mark is kept.
|
ZHUYIN_TONEMARK_ORIGINAL |
Neutral (fifth) tone mark is put in the front, while the first tone mark is omitted.
|
ZHUYIN_TONEMARK_INPUT_METHOD |
Neutral (fifth) tone mark is put in the front, while the first tone mark is omitted.
|
ZHUYIN_TONEMARK_NUMERICAL |
Tone mark are represented as numerical, in the end of Zhuyin.
|
void pinYin_add_tone |
( |
PinYin * |
pinYin, |
|
|
guint |
tone, |
|
|
gboolean |
useTrailNumber |
|
) |
| |
This function add tone mark to zhuYin, existing tone will be removed before adding new tone. If tone is 0, then existing tone will be removed, but no new tone will be added.
The result will be stored in pinYin, so backup it with strdup() or g_strdup() to keep the original.
- Parameters
-
pinYin | the pinYin instance to be processed. |
tone | the tone to be added. |
useTrailNumber | TRUE trailing number is preferred, FALSE to use traditional tonemark. |
guint pinYin_get_tone |
( |
const PinYin * |
pinYin | ) |
|
This function finds and returns the explicit-specified tone of pinYin. Thus 0 will be returned if pinYin does not have any explicit-specified tone.
This function acts this way in order to accommodate the SQL LIKE query such as ... WHERE kMandarin LIKE 'KE'
.
Sometimes, 5th tone mark is omitted, please convert the value 0 to 5 if this is the case.
- Parameters
-
pinYin | the pinYin instance to be stripped. |
- Returns
- the tone id from 1 to 5 if the tone is explicit-specified, 0 otherwise.
- See also
- pinYin_strip_tone()
guint zhuYin_get_tone |
( |
const ZhuYin * |
zhuYin | ) |
|
This function finds and returns the explicit-specified tone of zhuYin. Thus 0 will be returned if zhuYin does not have any explicit-specified tone.
This function acts this way in order to accommodate the SQL LIKE query such as ... WHERE zhuYin LIKE 'ㄊㄧㄢ'
.
Sometimes, 1th tone mark is omitted, please convert the value 0 to 1 if this is the case.
- Parameters
-
zhuYin | the zhuYin instance to be stripped. |
- Returns
- the tone id from 1 to 5 if the tone is explicit-specified, 0 otherwise.
- See also
- zhuYin_strip_tone()