I'm thinking of coding a name generator in LPC that people can use when connecting. After finding and reading the history of
http://www.rinkworks.com/namegen/, I think I have a good idea of where to start: syllables and rules for putting them together.
Perhaps like this:
string *vowels = ({
"a", "e", "i", "o", "u", "y",
});
string *consonants = ({
"b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
"n", "p", "q", "r", "s", "t", "v", "w", "x", "z",
"ya", "ye", "yi", "yo", "yu",
});
mapping syllable_rules = ([
"bla" : ([
"before" : ({ "C", "i", "u" }),
"after" : ({ "V", "b", "l", "r" })
]),
"hor" : ([
"before" : ({ "a", "d", "k", "n" }),
"after" : ({ "V", "s", "t", "c" }),
]),
]);
int is_vowel(string c) { return member_array(c, consonants) == -1; }
Basically, grab a random syllable, then grab another random one to add to the end, check if the new one fits the "after" rule of the first one, and if the first one fits the "before" rule of the new one, and if so, put them together. Random name length, biased toward medium, with a maximum. C stands for any consonant and V for any vowel.
What I'm looking for is anyone who's done this sort of thing before and any advice they might have. This basically falls into the realm of language parsing, with which I have very little experience. Will I be fiddling with the rules and adding new syllables until the day I die?? Or is it possible to get a fairly good generator without devoting months of my life??