https://github.com/xuender/go-py
go pinyin 中文转拼音,多音字识别
https://github.com/xuender/go-py
go golang golang-library golib pinyin
Last synced: 29 days ago
JSON representation
go pinyin 中文转拼音,多音字识别
- Host: GitHub
- URL: https://github.com/xuender/go-py
- Owner: xuender
- License: mit
- Created: 2022-04-13T05:28:06.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T14:50:51.000Z (about 2 years ago)
- Last Synced: 2025-03-31T10:42:34.788Z (2 months ago)
- Topics: go, golang, golang-library, golib, pinyin
- Language: Go
- Homepage:
- Size: 1.09 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# go-py
[](https://github.com/xuender/go-py/actions)
[](https://codecov.io/gh/xuender/go-py)
[](https://goreportcard.com/report/github.com/xuender/go-py)
[](https://pkg.go.dev/github.com/xuender/go-py)
[](https://gitter.im/xuender-go-py/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://github.com/xuender/go-py/blob/main/LICENSE)
[](https://github.com/xuender/go-py/issues)
[](https://github.com/xuender/go-py/stargazers)中文转拼音.
## use
```shell
go get github.com/xuender/go-py
``````go
package mainimport (
"fmt""github.com/xuender/go-py"
)func main(){
fmt.Println(py.Pinyin("阿弥陀佛"))
fmt.Println(py.Pinyin("阿弥陀佛", py.Tone))
fmt.Println(py.Pinyin("阿弥陀佛", py.NoTone))
fmt.Println(py.Pinyin("阿弥陀佛", py.Init))
fmt.Println(py.Initials("阿弥陀佛"))// output:
// [a1 mi2 tuo2 fu2]
// [ā mí tuó fú]
// [a mi tuo fu]
// [a m t f]
// amtf
}
```## cmd
```shell
py --help
```### install
```shell
go install github.com/xuender/go-py/cmd/py@latest
```### examples
```shell
py 阿弥陀佛
py -i -s= 阿弥陀佛
py -t -h -hs=\; 阿弥陀佛
py -n 阿弥陀佛
```