Git Product home page Git Product logo

wubi's Introduction

简介

汉字转五笔编码,五笔编码转汉字,支持自定义码表,默认集成了86版、98版、新世纪版本码表。

使用示例

import "github.com/gopherlib/wubi"

以下代码使用86版五笔作为示例,其它98版、新世纪版使用方法类似。

86版汉字转五笔码

c := wubi.New86()
codes := c.GetCode('在')
fmt.Println(codes) 

// [d dhf dhfd]

86版多个汉字转五笔码

c := wubi.New86()
codes := c.GetCodes("干一行,爱一行,一行行,行行行,一行不行,行行不行")
fmt.Println(codes) 

// [[fggh] [g ggl ggll] [tf tfhh] [,] [ep epd epdc] [g ggl ggll] [tf tfhh] [,] [g ggl ggll] [tf tfhh] [tf tfhh] [,] [tf tfhh] [tf tfhh] [tf tfhh] [,] [g ggl ggll] [tf tfhh] [i gi gii] [tf tfhh] [,] [tf tfhh] [tf tfhh] [i gi gii] [tf tfhh]]

86版五笔码转汉字

c := wubi.New86()
chars := c.GetChar("d")
fmt.Println(chars) 

// [在 石]

86版多个五笔码转汉字

c := wubi.New86()
chars := c.GetChars([]string{"d", "r"})
fmt.Println(chars) 

// [[在 石] [白 的]]

wubi's People

Contributors

mingming-cn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.