Your task is to create a program/function to replicate this word generator.
Details
Your program/function take two input. One input is the categories
. The other input is the syllable types
.
Categories
categories
will consist of classes of letters.
For example, V=aeiou
means that the letters a
, e
, i
, o
, and u
will be classified under the category V
.
- Each category will have a 1-letter name in UPPERCASE.
- The letters it contains will all be in lowercase.
Syllable types
For example CV
would mean that the syllable will consist of a letter in category C
and then a letter in category V
.
For example, if C=bcd
and V=ae
, then the syllable can be ba
, be
, ca
, ce
, da
, or de
.
Your task
Your task is to generate 100 random words, each with a random length of 1-5 syllables, each chosen randomly in the syllable types, with the letter in each category chosen also randomly.
Specs
- Any reasonable input/output format. I don't care how you input the list.
- All inputs will be valid.
Scoring
This is code-golf. Shortest solution in bytes wins.
Testcase
input1 input2 output
"C=st;V=aeiou" "CV/CVC" tasiti tese tossi tesis titi sese saset su sosastesisat sisosis sissa sata to sisas sese satetot sisuta tatote sa tetsesuti sossut ti seso tese tostutsasussi tutiset sasates tasa ta sa satso tastitta tetti sesita setetat tatsi tisetot sassu sessiso satessase sas ses totasta si tetsit titse sase totas sa ta sasesa tasa sostat sesi sissa tato tos tate sustosussatta sustas sassatote tesas sutat tatetatossos testisot tatta tissisisa sasese sesatus tito sisa satas sasisi so sasatustu sosses tetsa tese sestit sestu tisot sutastot sesu tet sotte sisute setotitsesi tita