Re: Phonetic Name Generator



In CPP you can use "using namespace std".

Doesn't that defeat the purpose of having namespaces in the first
place?

Also typedef is your friend :)

Yeah, I used it on one of the definitions, but not the other.

It's a great idea and I really appreciate you sharing your code,
but could you maybe upload it somewhere next time (I'm sure there
are lots of free hosting options for sourcecode of opensource apps
and libs) and just link here?

Ahh, sure. I wasn't aware of the rules for that sort of thing here.
Mea culpa. I'll do so in the future.

Be sure also to check out the source code of Stone Soup. I believe
they generate the random names of shopkeepers (and other stuff) with
something similar.

Interesting! I'll have a look, thanks!


Very long post. Too long with all that code. ;)

Again, I apologize.


Besides, I like all approaches that try to use some clean linguistic
concepts for doing language random stuff instead of just meshing
together half-knowledge based on the own experience. ;)

Well, I'm not a linguist at all, so this really is a ham-fisted half-
knowledge attempt. I just did a bit of research and cobbled together
some concepts in a quick-and-dirty fashion.

However, although you have a clear distinction between different
categories, this is not always visible in the results. I think not all
of your examples are pronouncable by english speakers. Depending on
the style of your game this might not be too bad -- but it contradicts
your English-based phonetic approach.

Yes, this is a problem. The reason seems to be that, while I implement
independent probabilities for every phoneme, that's all the rules
there are. There are some special-cases which need specific rules to
produce better results; I added two, in fact. The first looks at the
phoneme string and sees if a "weird" character pairing is at the end
(like 'w' or 'wh') and then it just appends a new vowel (this could
conceivably make the string one longer than its _max_length, but the
probability of that happening seems remote enough that it can be
effectively ignored, at least until I refactor the code). Another rule
counts the number of consecutive consonants then uses an increasing
probability curve to make it more likely that a vowel will be chosen
next. The more consecutive consonants, the greater the chance that a
new vowel will be added. This doesn't quite eliminate cases of no
vowels, but it does seem to improve things.

I also dramatically improved the random number routine so that the
period is much higher. This has given some very nice improvement in
the diversity of strings produced. With these improvements, here are
some examples:

|aU|w|@`|f|er|D|@|z
owweroughairthaz

|e|w|{|U
aywau

|z|b|I|h
sebih

|U|v|u
ufou

|O|d|@`
audder

|j|o|f|@`
yofer

|z|T|u|g
xthoug

|OI|d|V|i|z|p|U|r
oydouexpur

|V|m|i
umee

|p|A|N|n|O|Z|b|u
pangnawsuboo

|W|i|x
whech

|d|E|W|V
dewhu

|j|Ar|n|dZ
yarng

|n|A|m|j|e|tS
namyaych

|S|U|N
tiung

|O|f|W|I
auoughwhei

This seems much better overall.
.



Relevant Pages

  • Re: Coin tossing guessing strategy...
    ... You need a precise string in exactly one order, ... probability distribution for the _difference_ between the number of ... heads and tails. ... After the first four tosses ...
    (sci.math)
  • Re: Coin tossing guessing strategy...
    ... You need a precise string in exactly one order, ... probability distribution for the _difference_ between the number of ... heads and tails. ... After the first four tosses ...
    (sci.math)
  • Re: Coin tossing guessing strategy...
    ... You need a precise string in exactly one order, ... probability distribution for the _difference_ between the number of ... heads and tails. ... After the first four tosses ...
    (sci.math)
  • Re: Coin tossing guessing strategy...
    ... You need a precise string in exactly one order, ... probability distribution for the _difference_ between the number of ... heads and tails. ... After the first four tosses ...
    (sci.math)
  • Re: Coin tossing guessing strategy...
    ... You need a precise string in exactly one order, ... with respect to sequences of n flips, is to note that if some sequence ... In fact, assuming a fair coin, all 10 coin sequences are equally ... probability distribution for the _difference_ between the number of ...
    (sci.math)