主题
拼音转换
基于 pinyin-pro 将任意汉字文本转为拼音,支持声调、首字母、声母、韵母多种模式。
汉字转拼音
- 方法:
GET - 路径:
/api/web/chinese/pinyin
请求参数 (Query)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
text | string | 是 | 待转换汉字文本 |
tone | string | 否 | 1带声调 / 0不带声调,默认 1 |
pattern | string | 否 | full完整 / first首字母 / initial声母 / final韵母,默认 full |
请求示例
bash
GET /api/web/chinese/pinyin?text=你好世界&tone=1&pattern=full响应示例
json
{
"text": "你好世界",
"pinyin": "nǐ hǎo shì jiè"
}GET在线测试
