Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
实用工具pinyin目前直接采用源代码定义的拼音风格名作为命令行选项,似乎存在以下问题:
strconv.ToLower()
一下再比较,用户体验也会好一些。Normal
改称Toneless
似乎更精确;哪些风格带有复数s,什么是2什么是3,为什么没有1,用户回忆起来恐怕也得“顿一下”。如果仅作为第三方库给悲催的程序员调用,以上问题(除了代码维护)似乎也无所谓。但既然提供了命令行工具,个人倾向于对用户更温柔些。
在此建议改用基于范例的风格选项,好处是:容易拼写,也容易记忆;用户注意力集中到问题域,不容易写错;隐藏了实现方式,利于代码维护;容易基于现有代码修改,不易改错。
建议采用的范例字是“赵”,好处是:好记(百家姓首位);拼音短;涵盖了现有的全部风格;挺欢乐……
对应如下:
附注标*处的说明:zhào和ào不容易输入,命令行选项就要采取折衷,这是用户唯一需要“硬记”的地方。其中Tone是默认选项,一般不需要指定;必须指定时,也只要记得“4在a前面”(for all?),这也是a4o、ao4的自然外推。