mozillazg / go-pinyin

汉字转拼音
https://godoc.org/github.com/mozillazg/go-pinyin
MIT License
1.6k stars 194 forks source link

add: 增加保留字母和数字的选项 #32

Closed molizz closed 6 years ago

molizz commented 6 years ago

因为业务需要, 增加了一个新的style.

类似:

12Ha«你好吗

这样的字符串Style为FirstLetter时, 将只返回nhm.

增加新的style常量为FirstKeepLetter:

上面的字符串将返回: 12Hanhm

既: 保留文字中的数字, 字母

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-8.2%) to 91.781% when pulling 145a8df5219a02cd734c5832c6a49992bcc13e14 on molizz:master into b950aaffc7bf031ae4b8e7759eaff767b32c3214 on mozillazg:master.