wordscount

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

wordscount

字数统计库&工具

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoSpace

func AutoSpace(str string) string

AutoSpace 自动给中英文之间加上空格

func GetBuffer

func GetBuffer() (buf *bytes.Buffer)

GetBuffer returns a buffer from the pool.

func PutBuffer

func PutBuffer(buf *bytes.Buffer)

PutBuffer returns a buffer to the pool. The buffer is reset before it is put back into circulation.

func StripHTML

func StripHTML(s string) string

StripHTML accepts a string, strips out all HTML tags and returns it.

Types

type Counter

type Counter struct {
	Total     int // 总字数 = Words + Puncts
	Words     int // 只包含字符数
	Puncts    int // 标点数
	Links     int // 链接数
	Pics      int // 图片数
	CodeLines int // 代码行数
}

func (*Counter) Stat

func (wc *Counter) Stat(str string)

Directories

Path Synopsis
cmd
wordscount command

Jump to

Keyboard shortcuts

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