Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/siongui/gojianfan

Traditional and Simplified Chinese Conversion in Go
https://github.com/siongui/gojianfan

chinese-translation converter demo go gopherjs online-services simplified-chinese traditional-chinese

Last synced: about 21 hours ago
JSON representation

Traditional and Simplified Chinese Conversion in Go

Awesome Lists containing this project

README

        

====================================================
Traditional and Simplified Chinese Conversion in Go_
====================================================

.. image:: https://img.shields.io/badge/Language-Go-blue.svg
:target: https://golang.org/

.. image:: https://godoc.org/github.com/siongui/gojianfan?status.svg
:target: https://godoc.org/github.com/siongui/gojianfan

.. image:: https://github.com/siongui/gojianfan/workflows/ci/badge.svg
:target: https://github.com/siongui/gojianfan/blob/master/.github/workflows/ci.yml

.. image:: https://goreportcard.com/badge/github.com/siongui/gojianfan
:target: https://goreportcard.com/report/github.com/siongui/gojianfan

.. image:: https://img.shields.io/badge/license-Unlicense-blue.svg
:target: https://raw.githubusercontent.com/siongui/gojianfan/master/UNLICENSE

.. image:: https://img.shields.io/twitter/url/https/github.com/siongui/gojianfan.svg?style=social
:target: https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D

Convert Traditional Chinese to/from Simplified Chinese in Go_.
This implementation is based on `python-jianfan`_, and is very primitive.
If you need advanced converter, visit OpenCC_ project, or pure Go implementation
of OpenCC [13]_.

Install
+++++++

.. code-block:: bash

$ go get -u github.com/siongui/gojianfan

Usage
+++++

.. code-block:: go

package main

import (
"fmt"
"github.com/siongui/gojianfan"
)

func main() {
// Traditional Chinese to Simplified Chinese
fmt.Println(gojianfan.T2S("橋頭"))

// Simplified Chinese to Traditional Chinese
fmt.Println(gojianfan.S2T("桥头"))
}

Tested on:

- `Go 1.17.1`_

UNLICENSE
+++++++++

Released in public domain. See UNLICENSE_.

References
++++++++++

.. [1] `Jianfan - A python library for translation between traditional and simplified chinese `_
.. [2] | `golang two way map - Google search `_
| `golang map - Google search `_
.. [3] | `golang unicode - Google search `_
| `Strings, bytes, runes and characters in Go - The Go Blog `_
| `[Golang] Iterate Over UTF-8 Strings (non-ASCII strings) `_
.. [4] | `golang const string - Google search `_
.. [5] | `golang package init - Google search `_
.. [6] `開放中文轉換 Open Chinese Convert (OpenCC) `_
(`source code `__,
`online doc `__)
.. [7] `stevenyao/go-opencc · GitHub `_
(OpenCC wrapper for Golang, |godoc1|)
.. [8] `[Golang] Converter for Traditional and Simplified Chinese `_
.. [9] `godoctricks - GoDoc `_
.. [10] | `responsive textarea - Google search `_
| `responsive textarea - DuckDuckGo search `_
| `responsive textarea - Ecosia search `_
| `responsive textarea - Bing search `_
| `responsive textarea - Yahoo search `_
| `responsive textarea - Baidu search `_
| `responsive textarea - Yandex search `_
.. [11] `Go Report Card | Go project code quality report cards `_
.. [12] `Shields.io: Quality metadata badges for open source projects `_
.. [13] | `GitHub - liuzl/gocc: Golang version OpenCC 繁簡轉換 `_
| `GitHub - sgoby/opencc: 基于OpenCC中文简繁体转换的golang开发包 `_

.. _Go: https://golang.org/
.. _python-jianfan: https://code.google.com/archive/p/python-jianfan/
.. _OpenCC: https://github.com/BYVoid/OpenCC
.. _Go 1.17.1: https://golang.org/dl/
.. _UNLICENSE: https://unlicense.org/

.. |godoc1| image:: https://godoc.org/github.com/stevenyao/go-opencc?status.png
:target: https://godoc.org/github.com/stevenyao/go-opencc