initial import

This commit is contained in:
evilchili
2023-11-24 08:48:03 -05:00
commit 45f4d6e401
66 changed files with 3601 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
### Draconic
The tongue of dragons and the Dragonborn. It is punctuated by low, gutteral
grunts denoted by an apostrophe ('), the particular inflections of which can
change the meaning of an utterance dramatically. When shouting, a speaker of
Draconic should accentuate these grunts with spurts of flame, acid, ice, and so
on.
The high form is reserved for the names of nobility -- that is, dragons -- who
typically choose an appelation for themselves in the common tongue, the better
to spread the terror of their name.
*Sey'so'jsii ysuut 'sei'gk gf'seiv 'se'su'rx 'se'yv hsi', sahsei' k'si'saa' f'si''see?*
**Draconic Names:**
* V'Sei'Sey'a
* Sir''Seytza
* 'Soh'Suutus
**Noble (Dragon) Names:**
* Seytthix the Willful
* Saseezex the Enervated
* Sahkzis the Miserly
+7
View File
@@ -0,0 +1,7 @@
"""
Draconic
"""
from .base import Language
from .names import Name, NobleName
__all__ = [Language, Name, NobleName]
+47
View File
@@ -0,0 +1,47 @@
from language import types
from .rules import rules
vowels = types.equal_weights(
["sa", "saa", "sah", "se", "see", "sei", "sey", "si", "sii", "sir", "so", "su", "suu"], 1.0, blank=False
)
consonants = types.WeightedSet(
("d", 1.0),
("f", 0.5),
("g", 0.5),
("h", 1.0),
("j", 1.0),
("k", 1.0),
("l", 0.3),
("n", 0.3),
("r", 0.2),
("t", 1.0),
("v", 1.0),
("x", 1.0),
("y", 1.0),
("z", 1.0),
)
class DraconicLanguage(types.Language):
stops = types.equal_weights(["'"], 1.0)
def get_grapheme_vowel(self) -> str:
return self.stops.random() + self.vowels.random() + self.stops.random()
Language = DraconicLanguage(
name="draconic",
vowels=vowels,
consonants=consonants,
prefixes=None,
suffixes=None,
syllables=types.SyllableSet(
(types.Syllable(template="consonant|vowel") * 2, 0.2),
(types.Syllable(template="consonant|vowel") * 3, 1.0),
(types.Syllable(template="consonant|vowel") * 4, 1.0),
),
rules=rules,
minimum_grapheme_count=2,
)
+88
View File
@@ -0,0 +1,88 @@
from language import defaults, types
from language.languages.draconic import Language
# dragon_titles = types.equal_weights([
# ], 1.0)
class DraconicNameGenerator(types.NameGenerator):
def __init__(self):
super().__init__(
language=Language,
templates=types.NameSet(
(types.NameTemplate("name"), 1.0),
(types.NameTemplate("adjective,name"), 1.0),
),
adjectives=defaults.adjectives,
)
self.language.minimum_grapheme_count = 2
self.suffixes = types.equal_weights(["us", "ius", "eus", "a", "an", "is"], 1.0, blank=False)
def get_name(self) -> str:
return super().get_name() + self.suffixes.random()
class NobleDraconicNameGenerator(types.NameGenerator):
def __init__(self):
super().__init__(
language=Language,
templates=types.NameSet(
(types.NameTemplate("surname,the,title"), 1.0),
),
# titles=dragon_titles,
syllables=types.SyllableSet(
(types.Syllable(template="consonant|vowel") * 2, 1.0),
),
)
self.language.minimum_grapheme_count = 2
self.suffixes = types.equal_weights(
[
"thus",
"thux",
"thas",
"thax",
"this",
"thix",
"thes",
"thex",
"xus",
"xux",
"xas",
"xax",
"xis",
"xix",
"xes",
"xex",
"ssus",
"ssux",
"ssas",
"ssax",
"ssis",
"ssix",
"sses",
"ssex",
"zus",
"zux",
"zas",
"zax",
"zis",
"zix",
"zes",
"zex",
],
1.0,
blank=False,
)
def get_title(self) -> str:
p = ""
while not p:
p = defaults.personality.random()
return p
def get_surname(self) -> str:
return super().get_name().replace("'", "").title() + self.suffixes.random()
Name = DraconicNameGenerator()
NobleName = NobleDraconicNameGenerator()
+7
View File
@@ -0,0 +1,7 @@
import logging
from language.rules import default_rules
logger = logging.getLogger("draconic-rules")
rules = default_rules