conlang

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package conlang provides methods and tools for procedurally generating constructed languages. It makes use of the language package for underlying structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNounToWordList

func AddNounToWordList(lang language.Language, langCategory Category, word string) (map[string]string, error)

AddNounToWordList adds a new noun to an existing word list for a language

func GenerateNameList

func GenerateNameList(numberOfNames int, langCategory Category, nameType string) ([]string, error)

GenerateNameList generates a list of names appropriate for the language

func GenerateWordList

func GenerateWordList(langCategory Category) (map[string]string, error)

GenerateWordList creates a word list for a language

func IsInWordList

func IsInWordList(word string, wordList map[string]string) bool

IsInWordList checks to see if a given word is in a word list

func RandomGenderedName

func RandomGenderedName(langCategory Category, gender string) (string, error)

RandomGenderedName generates a random gendered first name

func RandomName

func RandomName(langCategory Category) (string, error)

RandomName generates a random name using the language

Types

type Category

type Category struct {
	Descriptors      []string
	WordLength       int
	UsesApostrophes  bool
	Initiators       []string
	Connectors       []string
	Finishers        []string
	MasculineEndings []string
	FeminineEndings  []string
}

Category is a style of constructed language

func Generate

func Generate() (language.Language, Category, error)

Generate creates a random language

type Mutation

type Mutation struct {
	From string
	To   string
}

Mutation is a word mutation

type WordType

type WordType struct {
	Name         string
	MaxSyllables int
	Prefix       string
	Suffix       string
	WordList     []string
}

WordType is a type of word. This is used as rules to construct words.

Jump to

Keyboard shortcuts

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