• 此项目
    • 正在载入...
  • 登录

allied-creation / allied-creation-manufacture · 文件

转到一个项目

GitLab

  • 转到群组
  • 项目
  • 活动
  • 文件
  • 提交
  • 管道 0
  • 构建 0
  • 图表
  • 里程碑
  • 问题 0
  • 合并请求 0
  • 成员
  • 标记
  • 维基
  • 派生
  • 网络
  • 创建新的问题
  • allied-creation-manufacture
  • pkg
  • infrastructure
  • utils
  • converter
  • pinyin.go
  • refactor: 计划管理、工位
    640efe02
    yangfu 在
    2022-02-11 13:45:54 +0800
    提交 浏览目录 »
pinyin.go 305 字节
原文件 审查 历史 永久链接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
package converter

import (
	"github.com/mozillazg/go-pinyin"
	"strings"
)

func ToPinYin(hans string, sep string) string {
	a := pinyin.NewArgs()
	tmp := pinyin.Pinyin(hans, a)
	result := make([]string, 0)
	for i := range tmp {
		result = append(result, tmp[i]...)
	}
	return strings.Join(result, sep)
}