-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mozillazg/develop
v0.4.0
- Loading branch information
Showing
6 changed files
with
304 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
// Package pinyin : 汉语拼音转换工具 | ||
// | ||
// Usage | ||
// | ||
// package main | ||
// | ||
// import ( | ||
// "fmt" | ||
// "github.com/mozillazg/go-pinyin" | ||
// ) | ||
// | ||
// func main() { | ||
// hans := "中国人" | ||
// a := pinyin.NewArgs() | ||
// // 默认输出 [[zhong] [guo] [ren]] | ||
// fmt.Println(pinyin.Pinyin(hans, a)) | ||
// | ||
// // 包含声调 [[zhōng] [guó] [rén]] | ||
// a.Style = pinyin.Tone | ||
// fmt.Println(pinyin.Pinyin(hans, a)) | ||
// | ||
// // 声调用数字表示 [[zho1ng] [guo2] [re2n]] | ||
// a.Style = pinyin.Tone2 | ||
// fmt.Println(pinyin.Pinyin(hans, a)) | ||
// | ||
// // 开启多音字模式 [[zhong zhong] [guo] [ren]] | ||
// a = pinyin.NewArgs() | ||
// a.Heteronym = true | ||
// fmt.Println(pinyin.Pinyin(hans, a)) | ||
// // [[zho1ng zho4ng] [guo2] [re2n]] | ||
// a.Style = pinyin.Tone2 | ||
// fmt.Println(pinyin.Pinyin(hans, a)) | ||
// } | ||
// | ||
package pinyin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.