ccst

package module
v0.0.0-...-f5a8644 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: MIT Imports: 1 Imported by: 5

README

cc-jianfan

MIT License GoDoc Go Report Card travis Status

TOC

中文简繁互转
Chinese-Character Jian<=>Fan converter

API

> jianfan_test.go
package ccst_test

import (
	"fmt"

	ccst "github.com/go-cc/cc-jianfan"
)

// for standalone test, change package to main and the next func def to,
// func main() {
func Example_output() {
	sj := "看书学习。\n名著:《红楼梦》〖清〗曹雪芹 著、高鹗 续/『人民文学』出版社/1996—9月30日/59.70【元】,《三国演义》〖明〗罗贯中。"

	sf := ccst.S2T(sj)
	fmt.Println(sf)
	// Output:
	//   not here!
	fmt.Println(ccst.T2S(sf))
	sj = ccst.T2S("增補臺灣標準IT詞彙。")
	fmt.Println(sj)
	fmt.Println(ccst.S2T(sj))

	// Output:
	// 看書學習。
	// 名著:《紅樓夢》〖清〗曹雪芹 著、高鶚 續/『人民文學』齣版社/1996—9月30日/59.70【元】,《三國演義》〖明〗羅貫中。
	// 看书学习。
	// 名著:《红楼梦》〖清〗曹雪芹 著、高鹗 续/『人民文学』出版社/1996—9月30日/59.70【元】,《三国演义》〖明〗罗贯中。
	// 增补台湾标准IT词汇。
	// 增補臺灣標準IT詞匯。
}

All patches welcome.

Credits

Documentation

Overview

Package ccst provides Conversion between Simplified and Traditional Chinese-Characters.

This is a simple implementation of Chinese one-to-one conversion. If you need more advanced converter, please visit OpenCC https://github.com/BYVoid/OpenCC

Package ccst - Chinese-Characters Simplified <=> Traditional

Example (Output)

for standalone test, change package to main and the next func def to, func main() {

package main

import (
	"fmt"

	ccst "github.com/go-cc/cc-jianfan"
)

func main() {
	sj := "看书学习。\n名著:《红楼梦》〖清〗曹雪芹 著、高鹗 续/『人民文学』出版社/1996—9月30日/59.70【元】,《三国演义》〖明〗罗贯中。"

	sf := ccst.S2T(sj)
	fmt.Println(sf)
	
Output:

看書學習。
名著:《紅樓夢》〖清〗曹雪芹 著、高鶚 續/『人民文學』齣版社/1996—9月30日/59.70【元】,《三國演義》〖明〗羅貫中。
看书学习。
名著:《红楼梦》〖清〗曹雪芹 著、高鹗 续/『人民文学』出版社/1996—9月30日/59.70【元】,《三国演义》〖明〗罗贯中。
增补台湾标准IT词汇。
增補臺灣標準IT詞匯。

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func S2T

func S2T(s string) string

S2T converts Simplified Chinese to Traditional Chinese

func STDump

func STDump()

STDump dumps Simplified to Traditional Chinese dict

func T2S

func T2S(s string) string

T2S converts Traditional Chinese to Simplified Chinese

func TSDump

func TSDump()

TSDump dumps Traditional to Simplified Chinese dict

Types

This section is empty.

Jump to

Keyboard shortcuts

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