Skip to content

Files

Latest commit

 

History

History
44 lines (29 loc) · 778 Bytes

README.md

File metadata and controls

44 lines (29 loc) · 778 Bytes

emotextcligo

Emotext Golang SDK: a client to emotext.

🔑 This is a muli component. You can find the main repository here.

Usage

Install:

go get github.com/murchinroom/emotextcligo

Example:

package main

import (
	"fmt"
	"github.com/murchinroom/emotextcligo"
)

func main() {
    // emotextcligo.EmotextServer = "http://localhost:51061" or set env EMOTEXT_SERVER
    text := "抱歉,今天很开心!"

    res, err := emotextcligo.Query(text)
    if err != nil {
        panic(err)
    }

    // res.Emotions = emotextcligo.Emotions21To7(res.Emotions)

    fmt.Println("Emotions:", res.Emotions)
    fmt.Println("Polarity:", res.Polarity)
}

License

MIT