dnd-name-generator/language/languages/elvish/base.py

130 lines
2.2 KiB
Python
Raw Normal View History

2023-11-24 05:48:03 -08:00
from language import types
from .rules import rules
vowels = types.WeightedSet(
("a", 1.0),
("e", 1.0),
("i", 0.3),
("o", 0.8),
("u", 0.7),
("y", 0.3),
("j", 0.05),
("ä", 0.1),
("ë", 0.1),
("ö", 0.1),
("ü", 0.1),
)
consonants = types.WeightedSet(
("b", 0.5),
("c", 0.3),
("d", 0.3),
("f", 0.4),
("g", 0.3),
("h", 0.5),
("k", 0.05),
("l", 1.0),
("m", 1.0),
("n", 1.0),
("p", 0.5),
("r", 1.0),
("s", 1.0),
("t", 0.7),
("v", 0.3),
("w", 0.2),
("y", 0.3),
) + types.equal_weights(
[
"ch",
"cl",
"cr",
"cw",
"cy",
"dh",
"dj",
"dr",
"dw",
"dy",
"fl",
"fn",
"fr",
"fw",
"fy",
"gl",
"ll",
"ly",
"ml",
"mw",
"my",
"ny",
"rh",
"ry",
"sh",
"sl",
"sm",
"sn",
"st",
"sv",
"sw",
"sy",
"th",
"tr",
"tw",
"ty",
"vy",
"wh",
"wr",
"wy",
"yh",
]
)
suffixes = types.equal_weights(
[
"a",
"i",
"e",
"t",
"s",
"m",
"n",
"l",
"r",
"d",
"a",
"th",
"ss",
"ieth",
"ies",
"ier",
"ien",
"iath",
"ias",
"iar",
"ian",
"ioth",
"ios",
"ior",
"ion",
],
weight=1.0,
)
Language = types.Language(
name="elvish",
vowels=vowels,
consonants=consonants,
prefixes=None,
suffixes=suffixes,
syllables=types.SyllableSet(
(types.Syllable(template="vowel|consonant") * 3, 0.4),
(types.Syllable(template="vowel|consonant") * 3, 0.5),
(types.Syllable(template="vowel|consonant") * 4, 1.0),
(types.Syllable(template="vowel|consonant") * 5, 0.5),
(types.Syllable(template="vowel|consonant") * 6, 0.1),
(types.Syllable(template="vowel|consonant") * 7, 0.1),
),
rules=rules,
minimum_grapheme_count=3,
)