Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyDict = errors.New("empty dictionary")
Functions ¶
func GetPathToDefaultDict ¶
func GetPathToDefaultDict() string
GetPathToDefaultDict with 370_000+ words.
Types ¶
type Dictionary ¶
type Dictionary []string
Dictionary to select random words.
func LoadDictFromFile ¶
func LoadDictFromFile(name string) (Dictionary, error)
LoadDictFromFile load dictionary from file. 1 line - 1 word, skip empty lines.
type GenerateRandom ¶
type GenerateRandom interface { // Word random word. Word() string // WordList of random words. WordList(n int) []string // Str get random string of n length. Str(n int) string }
GenerateRandom a random word/string generator.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates random words using a saved dictionary.
func NewWithDict ¶
NewWithDict create a word generator using custom dictionary. dictionary - text file, 1 line = 1 word in dictionary.
Click to show internal directories.
Click to hide internal directories.