GithubHelp home page GithubHelp logo

00mjk / pangu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinta/pangu

0.0 0.0 0.0 40 KB

Paranoid text spacing in Go (Golang)

Home Page: https://godoc.org/github.com/vinta/pangu

License: MIT License

Go 100.00%

pangu's Introduction

pangu.go

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).

Installation

To install the package, pangu, for using in your Go programs:

$ go get -u github.com/vinta/pangu

To install the command-line tool, pangu-axe:

$ go get -u github.com/vinta/pangu/pangu-axe

Usage

Package

package main

import (
    "fmt"
    "github.com/vinta/pangu"
)

func main() {
    s := pangu.SpacingText("當你凝視著bug,bug也凝視著你")
    fmt.Println(s)
    // Output:
    // 當你凝視著 bug,bug 也凝視著你
}

Command-line Interface

$ pangu-axe text "與PM戰鬥的人,應當小心自己不要成為PM"
與 PM 戰鬥的人,應當小心自己不要成為 PM

$ pangu-axe file 銀河便車指南.txt
$ pangu-axe file 宇宙盡頭的餐廳.txt -o 宇宙盡頭的餐廳(好讀版).txt
$ pangu-axe file 生命、宇宙及萬事萬物.txt 再見,謝謝你的魚.txt 基本無害.txt

Documentation

Have a question? Ask it on the GitHub issues!

pangu's People

Contributors

vinta 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.