Skip to content

mozillazg/stpinyin

Repository files navigation

stpinyin

Build Status Coverage Status Go Report Card GoDoc

Convert pinyin like this: you1 -> yōu

Installation

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

Documentation

API documentation can be found here: https://godoc.org/github.com/mozillazg/stpinyin

Usage

package main

import (
	"fmt"

	"github.com/mozillazg/stpinyin"
)

func main() {
	s := "you1"
	fmt.Println(stpinyin.Convert(s))
	// Output: yōu
}

License

Under the MIT License.