github.com/fardog/flippant/mwords/assets

Go library for retrieving random words from a provided word list.


License
MIT
Install
go get github.com/fardog/flippant/mwords/assets

Documentation

flippant

Go library for retrieving random words from a provided word list.

Install

$ go get github.com/fardog/flippant

Example

package mypkg

import (
    "fmt"
    "github.com/fardog/flippant"
)

func main() {
    words := []string{"some", "words", "go", "in", "here", "yah"}
    g := flippant.NewGenerator(words)

    dest := make([]string, 2)
    g.Words(dest)

    fmt.Println(dest) // ["go", "here"]

    dest = make([]string, 3)
    g.BoundedUniqueWords(dest, 2, 3)

    fmt.Println(dest) // ["in", "yah", "go"]
}

Default Wordlist

There is no default wordlist in the standard flippant package, but you can use the mwords package, which is just flippant with a high quality default wordlist. See that package for further details.

Other Languages

flippant follows a tradition of creating random-word libraries to try out new languages. You can find similar libraries for the following:

License

MIT