Convert pinyin like this: you1 -> yōu
go get -u github.com/mozillazg/stpinyin
Install CLI tool:
$ go get -u github.com/mozillazg/stpinyin/stpinyin
or download from https://github.com/mozillazg/stpinyin/releases
$ stpinyin you1 hang2
yōu háng
API documentation can be found here: https://godoc.org/github.com/mozillazg/stpinyin
package main
import (
"fmt"
"github.com/mozillazg/stpinyin"
)
func main() {
s := "you1"
fmt.Println(stpinyin.Convert(s))
// Output: yōu
}
Under the MIT License.