Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vcaesar committed Jun 6, 2020
1 parent 65acaf0 commit 06b7c8e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,42 @@ API documentation can be found here:


## Usage
```go
package main

import (
"fmt"

"github.com/go-ego/gse"

"github.com/go-ego/gpy"
"github.com/go-ego/gpy/phrase"
)

var test = `西雅图都会区; 长夜漫漫, winter is coming!`

func main() {
args := gpy.Args{
Style: gpy.Tone,
Heteronym: true}

py := gpy.Pinyin(test, args)
fmt.Println("gpy:", py)

s := gpy.ToString(py)
fmt.Println("gpy string:", s)

phrase.LoadGseDict()
go func() {
fmt.Println("gpy phrase1:", phrase.Paragraph(test))
}()
fmt.Println("gpy phrase2:", phrase.Paragraph(test))

seg := gse.New("zh, dict.txt")
phrase.DictAdd["都会区"] = "dū huì qū"
fmt.Println("gpy phrase:", phrase.Paragraph(test, seg))
}
```

```go
package main
Expand Down

0 comments on commit 06b7c8e

Please sign in to comment.