Skip to content

OpenCC in one executable, converts between Simplified Chinese and Traditional Chinese 简体中文 繁體中文 正體中文 转换 also works in WASM

Notifications You must be signed in to change notification settings

caiguanhao/opencc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencc

Simplified version of gocc and OpenCC.

OpenCC in one executable. You can also use OpenCC in browser. See in-browser Chinese conversion tool.

The config and dictionary Go files are generated from the source of OpenCC version 1.1.0. You can also generate them using go test.

Command Line

go install github.com/caiguanhao/opencc/opencc@latest

Import Package

All

package main

import (
	"fmt"

	"github.com/caiguanhao/opencc"
)

func main() {
	// fmt.Println(opencc.Dictionaries)
	fmt.Println(opencc.Convert("s2twp", `鼠标里面的硅二极管坏了,导致光标分辨率降低。`))
	// 滑鼠裡面的矽二極體壞了,導致游標解析度降低。
}

Specific

package main

import (
	"fmt"

	"github.com/caiguanhao/opencc/configs/tw2sp"
)

func main() {
	fmt.Println(tw2sp.Description)
	// Traditional Chinese (Taiwan standard) to Simplified Chinese (with phrases)
	fmt.Println(tw2sp.Dicts.Convert(`滑鼠裡面的矽二極體壞了,導致游標解析度降低。`))
	// 鼠标里面的硅二极管坏了,导致光标分辨率降低。
}

About

OpenCC in one executable, converts between Simplified Chinese and Traditional Chinese 简体中文 繁體中文 正體中文 转换 also works in WASM

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages