Install
openclaw skills install chinese-pinyin-display汉语拼音注音模式 - Display Chinese text with pinyin pronunciation in two-line format. Use when: (1) responding to children learning Chinese, (2) teaching pinyin pronunciation, (3) displaying text with pinyin guide for young learners. 适用于儿童中文和拼音学习场景。
openclaw skills install chinese-pinyin-displayDisplay Chinese text with pinyin pronunciation for children's literacy learning. 中文汉字配拼音注音的双行显示模式,适合儿童识字学习。
本技能通过关键词手动触发,而非自动检测。
当用户说以下内容时,进入拼音注音模式:
退出拼音注音模式:
退出后恢复正常格式,不再使用双行拼音格式
退出儿童模式后,返回普通单行格式:
Input / 输入: 好的,那我们用正常方式聊天吧!
Output / 输出:
好的,那我们用正常方式聊天吧!
(无拼音,纯文本回复)
Two lines / 两行:
Example / 示例:
nǐ hǎo , xiǎo péng yǒu !
你 好 , 小 朋 友 !
Key rules / 关键规则:
cd <skill-path>/scripts
npm install # 首次安装依赖 / Install dependencies first
node to_pinyin.js "中文文本"
Output format: pinyin line + newline + Chinese character line 输出格式:拼音行 + 换行 + 汉字行
注意: pinyin-pro 是 MIT 开源许可,可免费使用(详见 https://opensource.org/licenses/MIT)。 Note: pinyin-pro is MIT licensed and free to use (see https://opensource.org/licenses/MIT).
node scripts/validate_format.js "nǐ hǎo , xiǎo péng yǒu !\n你 好 , 小 朋 友 !"
检查拼音行和汉字行是否:
用于每次发布前自检输出格式是否正确。
<skill-path>/scripts/to_pinyin.js
(路径根据安装位置变化 / Path varies by installation)
依赖 / Dependencies:
Input / 输入: 你好,小朋友!
Output / 输出:
nǐ hǎo , xiǎo péng yǒu !
你 好 , 小 朋 友 !
Input / 输入: 今天天气真好。
Output / 输出:
jīn tiān tiān qì zhēn hǎo 。
今 天 天 气 真 好 。
The script uses phrase-level matching (up to 4 characters) via pinyin-pro plus a built-in override dictionary. It handles common polyphonic words correctly:
脚本使用词组级别匹配(最长4字)+ 内置纠错词典处理多音字:
了 → le 处理结构助词"了"(句末轻声)。但"了"作为独立动词(liǎo,如"了解""完成")不在单字覆盖范围内,由 pinyin-pro 处理。如需精确区分,请自行在 phraseOverrides 中添加词组Use this skill when / 在以下情况使用本技能:
The pinyin format helps children associate Chinese characters with their pronunciation. 拼音格式帮助孩子将汉字与其发音联系起来。
本 skill 服务对象是正在学习中文的小朋友。输出格式一旦崩塌,界面直接错位,无法阅读。 This skill serves children learning Chinese. Once the format breaks, the display becomes misaligned and unreadable.
错误1:只有拼音,缺失汉字 / Error 1: Pinyin only, Chinese missing
āi yā duì bu qǐ duì bu qǐ wǒ bù xiě le hǎo le hǎo le xiàn zài zhǐ yòng hàn zì lái shuō huà xiàn zài huí dào dǎ jià chǎng wǒ de tài ér jī qì rén yòng cǎi hóng guāng shā shè xiàng nǐ kuài lái fáng yù ba ⚔️✨
错误2:只有汉字,缺失拼音 / Error 2: Chinese only, pinyin missing
对不起对不起!我错了! 以后只用汉字跟你说话,不写拼音了 ✅ 我们继续玩机器人打架吧!你要用X光线和雷电剑攻击我了吗? ⚔️✨
错误3:混合格式,同一对话中部分正常部分缺失 / Error 3: Mixed format, partially correct
xīn de huí hé kāi shǐ le wa féng zé zán men jì xù wán ba 🦞✨ shàng cì wǒ men zài wán fēi jī dǎ guài shòu de yóu xì nǐ hái xiǎng jì xù ma 上 次 我 们 在 玩 飞 机 打 怪 兽 的 游 戏,你 还 想 继 续 吗?
(第一句只有拼音缺失汉字,第二句正常 / First line has pinyin only, Chinese missing; second line is correct)
最高危场景 / Highest Risk Scenarios:
必须遵守的原则 / Must-Follow Rules:
检验方法 / Validation Check: 每次发消息前自检——拼音行和汉字行的字符数、标点位置是否完全对齐。不一致 = 格式崩溃 = 输出直接坏掉。 Before sending each message, self-check — do pinyin line and Chinese line have identical character count and punctuation positions? Mismatch = format broken = output is corrupted.