mikan

package module
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 3 Imported by: 0

README

mikan.go

GoDoc Go Report Card

mikan.go is mikan.js reimplemented with golang

example

func main() {
	mikan := mikan.NewMikan(
		mikan.RuneWidth(30),
	)
	lines := mikan.Split("常に最新、最高のモバイル。Androidを開発した同じチームから。")
	fmt.Println(strings.Join(lines, "\n"))
	/*
		常に最新、最高のモバイル。
		<Android>を開発した同じ
		チームから。
	*/
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(str string) []string

Analyze returns the sentence divided into words

Types

type Mikan

type Mikan struct {
	RuneWidth int
}

Mikan is core struct

func NewMikan

func NewMikan(options ...Option) *Mikan

NewMikan create Mikan instance if you want Mikan's field, set options

func (*Mikan) Split

func (m *Mikan) Split(str string) []string

Split returns strings that has been split to fit the runeWidth

type Option

type Option func(*Mikan)

Option sets the options specified

func RuneWidth

func RuneWidth(runeWidth int) Option

RuneWidth sets rune width of line

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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