From e875bbfc673a20b4f899f6cbe5d2311d21eda89b Mon Sep 17 00:00:00 2001 From: evilchili Date: Sun, 17 Dec 2023 14:28:43 -0800 Subject: [PATCH] adding glottal stops to druidic --- language/languages/druidic/base.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/language/languages/druidic/base.py b/language/languages/druidic/base.py index 2ba72fb..ef4c7cb 100644 --- a/language/languages/druidic/base.py +++ b/language/languages/druidic/base.py @@ -28,6 +28,14 @@ vowels = types.WeightedSet( ("u", 1.0) ) +glottal_stops = types.WeightedSet( + ("'a", 0.4), + ("'e", 0.25), + ("'i", 0.5), + ("'o", 0.25), + ("'u", 0.5) +) + suffixes = types.equal_weights( [ "t", @@ -43,7 +51,14 @@ suffixes = types.equal_weights( blank=True, ) -Language = types.Language( + +class DruidicLanguage(types.Language): + + def get_grapheme_glottal_stop(self) -> str: + return glottal_stops.random() + + +Language = DruidicLanguage( name="druidic", vowels=vowels, consonants=consonants, @@ -55,6 +70,7 @@ Language = types.Language( (types.Syllable(template="consonant|vowel,vowel"), 0.33), (types.Syllable(template="consonant|vowel,vowel,consonant|vowel"), 1.0), (types.Syllable(template="consonant,vowel,vowel,consonant,vowel"), 1.0), + (types.Syllable(template="consonant,vowel,glottal_stop,consonant,vowel"), 0.5), ), rules=rules, minimum_grapheme_count=1,