Documentation ¶
Overview ¶
Package language provides structures and methods for dealing with languages, whether fictional or otherwise, in fantasy worlds.
Index ¶
- func Conjugate(lang Language, root string, tense string) string
- type ConjugationRules
- type Language
- func (language Language) Describe() string
- func (language Language) NewWord() (string, error)
- func (language Language) RandomFamilyName() (string, error)
- func (language Language) RandomFemaleFirstName() (string, error)
- func (language Language) RandomMaleFirstName() (string, error)
- func (language Language) RandomNameList(numberOfNames int, nameType string) ([]string, error)
- func (language Language) RandomTownName() (string, error)
- func (language Language) RosettaStone() string
- func (language Language) Simplify() SimplifiedLanguage
- func (language Language) TranslatePhrase(phrase string) string
- func (language Language) TranslateWord(word string) string
- type SimplifiedLanguage
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConjugationRules ¶
type ConjugationRules struct { SimplePresent string `json:"simple_present"` SimplePast string `json:"simple_past"` SimpleFuture string `json:"simple_future"` PresentContinuous string `json:"present_continuous"` PastContinuous string `json:"past_continuous"` FutureContinuous string `json:"future_continuous"` PresentPerfect string `json:"present_perfect"` PastPerfect string `json:"past_perfect"` FuturePerfect string `json:"future_perfect"` PresentPerfectContinuous string `json:"present_perfect_continuous"` PastPerfectContinuous string `json:"past_perfect_continuous"` FuturePerfectContinuous string `json:"future_perfect_continuous"` }
ConjugationRules is a set of templates to be applied to a word depending on its tense
type Language ¶
type Language struct { Name string `json:"name"` Adjective string `json:"adjective"` Descriptors []string `json:"descriptors"` Description string `json:"description"` SamplePhrase string `json:"sample_phrase"` SamplePhraseTranslation string `json:"sample_phrase_translation"` WritingSystem writing.System `json:"writing_system"` WordList map[string]string `json:"word_list"` FemaleFirstNames []string `json:"female_first_names"` MaleFirstNames []string `json:"male_first_names"` FamilyNames []string `json:"family_names"` TownNames []string `json:"town_names"` VerbConjugationRules ConjugationRules `json:"conjugation_rules"` IsTonal bool `json:"is_tonal"` NewWordPrefixes []string `json:"new_word_prefixes"` NewWordSuffixes []string `json:"new_word_suffixes"` }
Language is a spoken language
func PremadeCommon ¶
PremadeCommon returns the Common language
func (Language) RandomFamilyName ¶
RandomFamilyName returns a random male first name
func (Language) RandomFemaleFirstName ¶
RandomFemaleFirstName returns a random female first name
func (Language) RandomMaleFirstName ¶
RandomMaleFirstName returns a random male first name
func (Language) RandomNameList ¶
RandomNameList returns a list of N unique names of the given type
func (Language) RandomTownName ¶
RandomTownName returns a random male first name
func (Language) RosettaStone ¶
RosettaStone generates a version of a common phrase in the language
func (Language) Simplify ¶
func (language Language) Simplify() SimplifiedLanguage
Simplify creates a simplified version of a language for display
func (Language) TranslatePhrase ¶
TranslatePhrase parses a phrase and returns the translated version
func (Language) TranslateWord ¶
TranslateWord returns the translated version of the word
type SimplifiedLanguage ¶
type SimplifiedLanguage struct { Name string `json:"name"` Description string `json:"description"` Phrase string `json:"phrase"` Translation string `json:"translation"` WordList map[string]string `json:"word_list"` }
SimplifiedLanguage is a simplified version of Language meant for display