From c62c14ffa34457f378cc55264dbe295c17e3c1f3 Mon Sep 17 00:00:00 2001 From: evilchili Date: Sun, 17 Dec 2023 14:05:17 -0800 Subject: [PATCH] adding druidic names --- language/languages/druidic/base.py | 6 ------ language/languages/druidic/names.py | 33 +++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/language/languages/druidic/base.py b/language/languages/druidic/base.py index 5e406f8..2ba72fb 100644 --- a/language/languages/druidic/base.py +++ b/language/languages/druidic/base.py @@ -2,12 +2,6 @@ from language import types from .rules import rules -# surexit tutbulc filius liuit hagener tutri dierchi tir telih haioid ilau elcu -# filius gelhig haluidt iuguret amgucant pel amtanndi ho diued diprotant gener -# tutri o guir imguodant ir degion guragon tagc rodesit elcu guetig equs tres -# uache, tres uache nouidligi namin ir ni be cas igridu dimedichat guetig hit -# did braut grefiat guetig nis minn tutbulc hai cenetl in ois oisau - consonants = types.WeightedSet( ("b", 0.2), ("c", 0.8), diff --git a/language/languages/druidic/names.py b/language/languages/druidic/names.py index 78cd9dd..31a5005 100644 --- a/language/languages/druidic/names.py +++ b/language/languages/druidic/names.py @@ -4,7 +4,36 @@ from language.languages.druidic import Language Name = types.NameGenerator( language=Language, templates=types.NameSet( - (types.NameTemplate("name,surname"), 1.0), + (types.NameTemplate("name"), 1.0), ), ) -NobleName = Name + + +class DruidicNameGenerator(types.NameGenerator): + def __init__(self): + super().__init__( + language=Language, + templates=types.NameSet( + (types.NameTemplate("name"), 1.0), + ), + ) + self.language.minimum_grapheme_count = 2 + + +class NobleDruidicNameGenerator(types.NameGenerator): + def __init__(self): + super().__init__( + language=Language, + templates=types.NameSet( + (types.NameTemplate("name"), 1.0), + ), + ) + self.language.minimum_grapheme_count = 2 + self.suffixes = types.equal_weights(["as", "es", "is", "os", "us"], 1.0, blank=False) + + def get_name(self) -> str: + return super().get_name() + self.suffixes.random() + + +Name = DruidicNameGenerator() +NobleName = NobleDruidicNameGenerator()