gocc

package
v0.0.0-...-d8cc314 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gocc is a golang port of OpenCC(Open Chinese Convert 開放中文轉換)

Index

Constants

This section is empty.

Variables

View Source
var (
	// Dir is the parent dir for config and dictionary
	Dir = flag.String("dir", defaultDir(), "dict dir")
)

Functions

func S2t

func S2t(in string) (out string)

Types

type Group

type Group struct {
	Files []string
	Dicts []*da.Dict
}

Group holds a sequence of dicts

func (*Group) String

func (g *Group) String() string

type OpenCC

type OpenCC struct {
	Conversion  string
	Description string
	DictChains  []*Group
}

OpenCC contains the converter

func New

func New(conversion string) (*OpenCC, error)

New construct an instance of OpenCC.

Supported conversions: s2t, t2s, s2tw, tw2s, s2hk, hk2s, s2twp, tw2sp, t2tw, t2hk

func (*OpenCC) Convert

func (cc *OpenCC) Convert(in string) (string, error)

Convert string from Simplified Chinese to Traditional Chinese or vice versa

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL