moniker

package module
v0.0.0-...-3ea787d Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 3 Imported by: 242

README

Moniker: Generate Cute Random Names

Monicker is a tiny Go library for automatically naming things.

$ for i in [ 1 2 3 4 5 ]; do go run _example/namer.go; done
Your name is "eating iguana"
Your name is "old whale"
Your name is "wrinkled lion"
Your name is "wintering skunk"
Your name is "kneeling giraffe"
Your name is "icy hummingbird"
Your name is "wizened guppy"

Library Usage

Easily use Moniker in your code. Here's the complete code behind the tool above:

package main

import (
	"fmt"

	"github.com/technosophos/moniker"
)

func main() {
	n := moniker.New()
	fmt.Printf("Your name is %q\n", n.Name())
}

Since Moniker compiles the name list into the application, there's no requirement that your app has supporting files.

Customizing the Words

Moniker ships with a couple of word lists that were written and approved by a group of giggling school children (and their dad). We built a lighthearted list based on animals and descriptive words (mostly adjectives).

First, we welcome contributions to our list. Note that we currate the list to avoid things that might be offensive. (And if you get an offensive pairing, please open an issue!)

Second, we wanted to make it easy for you to modify or build your own wordlist. The script in _generator can take word lists and convert them to Go code that Moniker understands.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Animals = []string{}/* 242 elements not displayed */

Animals is a generated list of words.

View Source
var Descriptors = []string{}/* 389 elements not displayed */

Descriptors is a generated list of words.

Functions

This section is empty.

Types

type Namer

type Namer interface {
	// Name returns a generated name.
	Name() string
	// NameSep returns a generated name with words separated by the given string.
	NameSep(string) string
}

Namer describes anything capable of generating a name.

func New

func New() Namer

New returns a generic namer using the default word lists.

func NewAlliterator

func NewAlliterator() Namer

NewAlliterator returns a Namer that alliterates.

wonky wombat
racing rabbit
alliterating alligator

FIXME: This isn't working yet.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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