Skip to content

请支持Abbr转换原文中有符号想保留的情况 #7

@hongnod

Description

@hongnod

如“京沪广(沧州-济南)” 转换为JHG(CZ-JN)
github.com/mozillazg/go-pinyin 中可以通过如下方法实现:
```
args := pinyin.NewArgs()
args.Style = pinyin.FirstLetter // 只获取拼音首字母
args.Fallback = func(r rune, a pinyin.Args) []string {
return []string{string(r)}
}
pinyinSlice := pinyin.Pinyin(chinese, args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions