Your task is to generate a nonsense word that is reasonably pronounceable with the specified number of 'syllables'. Each time the program is run possibly results in a different nonsense word.
Pronounceability
A pronounceable word is made up of syllables, which are in turn made up of a vowel group that is possibly sandwiched between two consonant groups. Not all sounds are pronounceable in all positions, and since this depends on the language, we'll use patterns understandable to English speakers
Starting consonant groups:
b c d f g h j k l m n p r s t v w y z bl br ch cl cr dr fl fr gh gl gn gr kn ph pl pr qu sc sh sk sl sm sn sp st th tr wh wr sch scr shm shr squ str thr
Vowel Groups:
a e i o u ae ai ao au ea ee ei eu ia ie io oa oe oi oo ou ue ui
Ending Consonant groups:
b c d f g l m n p r s t x z bt ch ck ct ft gh gn lb ld lf lk ll lm ln lp lt mb mn mp nk ng nt ph pt rb rc rd rf rg rk rl rm rn rp rt rv rz sh sk sp ss st zz lch lsh lth rch rsh rst rth sch tch
Combining Syllables
Both starting and ending consonant groups are optional in general, however you cannot place a syllable ending with a vowel immediately before one starting with a vowel.
Disclaimer
In the interest of simplicity, certain English words can't actually be generated this way, such as vacuum, xylophone, mnemonic, pterodactyl, beautiful, blah, they, wow, and most plurals.
Overview
Possible syllable patterns using this key:
(SC) = starting consonant; (V) = vowel group; (EC) = ending consonant
For one syllable:
- (SC)(V)(EC)
- (V)(EC)
- (SC)(V)
- (V)
With two syllables:
- (SC)(V)(EC)(SC)(V)(EC)
- (SC)(V)(EC)(SC)(V)
- (SC)(V)(EC)(V)(EC)
(SC)(V)(EC)(V)
(SC)(V)(SC)(V)(EC)
(SC)(V)(SC)(V)
(V)(EC)(SC)(V)(EC)
- (V)(EC)(SC)(V)
- (V)(EC)(V)(EC)
(V)(EC)(V)
(V)(SC)(V)(EC)
- (V)(SC)(V)
... and so on
Examples
1 syllable
- charst
- tigh
- shriegn
- eess
- shue
- oo
- cheezz
2 syllables
- jazzcrap
- whylprog
- eating
- umba
- ola
- have
- ingsoc
- greespheurz
- bleuspoo
3 syllables
- brokiompic
- squirdshlicker
- capital
- opengtrass
- doublethink
- bigbrother
- phoebliaptmoo
- skolfblauquent
4 syllables
- strawishoepick
- patchworkzombie
- prearneajoomie
- slephotoschou
- doubleplusgood
Coding
Input: an integer for the number of syllables to generate
Output: a (probably) nonsense word that many syllables long
Rules
- Some form of (psuedo)randomness is required. All combinations of syllables should be (theoretically) possible to generate, though the distribution does not have to be uniform.
- You may assume that your generator is aperiodic, so it doesn't have to be mathematically possible to generate every possible word (It might not have a long enough period in reality) and you don't need to provide any sort of proof that your generator can, in fact, produce every possible word.
- Your generator must actually be able to produce at least 255 distinct values, so you can't just return 4 every time the generator is called.
- What's ultimately important is that you somehow include all the above letter groups in your code, that each letter group has a nonzero probability of being picked, and each syllable pattern has a nonzero probability of occurring (if provided with true randomness).
- You must support up to 16 syllable words
- In addition to the rules on combining syllables, the output word must not have:
- 3 consecutive vowels (
a
e
i
o
u
; this can happen forqu
words) - 3 consecutive matching consonants
- 3 consecutive vowels (
Good luck!
Note that this is distinct from Generate a pronounceable word for a few reasons:
- Variable number of syllables specified by input rather than a strict 10-letter requirement.
- This challenge adds non-exhaustive letter groups that must be (cleverly) encoded and allows for more variants of syllables, so code can't just be copied from the other challenge
- Squirdshlicker. Need I say more?
I also forgot to dupe check, but it turns out this brings enough new to the table that it doesn't matter. After all, there are hundreds of quine variant challenges.