Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 491 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 491 Bytes

go-opencc

opencc wrapper for Golang

Install

Run 'go get github.com/azhao1981/go-opencc'

Example

package main

import "fmt"
import "github.com/azhao1981/go-opencc"

const (
	input = "中国鼠标软件打印机"
	config_s2t = "/usr/share/opencc/s2t.json"
	config_t2s = "/usr/share/opencc/t2s.json"
)

func main() {
	fmt.Println("Test Converter class:")
	c := opencc.NewConverter(config_s2t)
	defer c.Close()
	output := c.Convert(input)
	fmt.Println(output)
}