haikunator

package module
v0.0.0-...-4e414e6 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2015 License: MIT Imports: 4 Imported by: 6

README

haikunator Build Status

Golang port of haikunator

Installation

go get github.com/taion809/haikunator

Example

package main

import (
	"fmt"
	"github.com/taion809/haikunator"
)

func main() {
	var haiku string

	h := haikunator.NewHaikunator()

	// Default haiku
	haiku = h.Haikunate()
	fmt.Println("Default: ", haiku) // => "long-smoke-5866"

	// Token range
	haiku = h.TokenHaikunate(100000)
	fmt.Println("With Token: ", haiku) // => "aged-pond-74896"

	// Don't include token
	haiku = h.DelimHaikunate("-")
	fmt.Println("With Delim: ", haiku) // => "wandering-water"

	// Use different delim without a token
	haiku = h.DelimHaikunate(".")
	fmt.Println("With Delim: ", haiku) // => "wandering.water"
	
	// Change token range and delimiter
	haiku = h.TokenDelimHaikunate(100000, ".")
	fmt.Println("With Token and Delim: ", haiku) // => "holy.pine.60124"

	// No token and space delimiter
	haiku = h.TokenDelimHaikunate(0, " ")
	fmt.Println("With Token and Delim: ", haiku) // => "holy pine"
}

Documentation

Godoc can be found here.

Other Languages

Haikunator is also available in other languages. Check them out:

License

This project is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Haikunator

type Haikunator struct {
	// contains filtered or unexported fields
}

func NewHaikunator

func NewHaikunator() Haikunator

func (*Haikunator) DelimHaikunate

func (h *Haikunator) DelimHaikunate(delim string) string

func (*Haikunator) Haikunate

func (h *Haikunator) Haikunate() string

func (*Haikunator) TokenDelimHaikunate

func (h *Haikunator) TokenDelimHaikunate(token int64, delim string) string

func (*Haikunator) TokenHaikunate

func (h *Haikunator) TokenHaikunate(token int64) string

Jump to

Keyboard shortcuts

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