To install the package, run:
go get github.com/go-zoox/pinyin
package main
import (
"context"
"github.com/go-zoox/pinyin"
)
func main() {
fmt.Println(pinyin.String("你好世界"))
// Output: nihaoshijie
fmt.Println(pinyin.Slice("你好世界"))
// Output: [ni hao shi jie]
fmt.Println(pinyin.Abbr("你好世界"))
// Output: nhsj
}
GoZoox is released under the MIT License.