Otirinch imerufulawe abosifoust epule blopuw dricoune plurume efoufum aruf aboble esterovevomort strocipe wofor.
Introduction
Introduction
I was thinking about the structure of words, and had the thought that what if I generated words just by alternating between consonant and vowel clusters? It seemed to me that in English some consonant clusters, such as “fl”, were usually only found at the beginning of words, and some consonant clusters, such as “lm”, tend to be found at the end. What if I made a ridiculously simple “random word” generator by just putting consonant and vowel clusters together based on if they tend found in the beginning, middle, end, or some combination of those things? And if I just picked clusters that seem common in English.
At the end of this page there’s an interactive demonstration where one can generate ones own random “words” in this manner.
I must say that I did just basically just in my head went through every pair of letter clusters and tried to think if they are used very often in English, and if so where. Then I tried adding a third letter to the clusters I though of. Surely using some actual statistics the digital dictionary built in to the Wolfram Language for instance would be another probably cleaner way to do this. But For now this is what I have, and it does make some fun sounding made-up words in my opinion. And every once in a while it does come up with real English words so that’s fun.
At the end of this page there’s an interactive demonstration where one can generate ones own random “words” in this manner.
I must say that I did just basically just in my head went through every pair of letter clusters and tried to think if they are used very often in English, and if so where. Then I tried adding a third letter to the clusters I though of. Surely using some actual statistics the digital dictionary built in to the Wolfram Language for instance would be another probably cleaner way to do this. But For now this is what I have, and it does make some fun sounding made-up words in my opinion. And every once in a while it does come up with real English words so that’s fun.
Code
Code
In[]:=
randomAllIntegers[init_Integer:1,f_:(#+1&)]:=NestWhile[f,init,RandomInteger[]1&]
In[]:=
any={{"e"},{"b","d","f","l","m","n","p","r","s","st","t","w"}};
In[]:=
beginningOnly={{},{"bl","br","ch","cl","cr","dr","fl","fr","gl","gr","h","j","pl","pr","qu","sc","shr","sl","sn","sp","str","thr","tr","z"}};
In[]:=
middleOnly={{"ou"},{}};
In[]:=
endOnly={{},{"ble","ck","nch","ng","nt","rn","rt","rk","sk","tch","ve"}};
In[]:=
notBeginning={{},{"x"}};
In[]:=
notMiddle={{},{"g","sh","th","y"}};
In[]:=
notEnd={{"a","i","o","u"},{"c","v"}};
In[]:=
$vowelSelector=1;
In[]:=
$consonantSelector=2;
In[]:=
partP={{___String},{___String}};
In[]:=
randomWord[any:partP,beginningOnly:partP,middleOnly:partP,endOnly:partP,notBeginning:partP,notMiddle:partP,notEnd:partP][minClusters_Integer:2,n_Integer:1]:=Table[With[{middleCount=randomAllIntegers[0],beginnings={any,beginningOnly,notMiddle,notEnd},middles={any,middleOnly,notBeginning,notEnd},ends={any,endOnly,notBeginning,notMiddle}},StringJoin[MapThread[RandomChoice[#1[[#2]]]&,{Join[{Catenate/@Transpose[beginnings]},Table[Catenate/@Transpose[middles],middleCount],{Catenate/@Transpose[ends]}],Catenate[ConstantArray[RandomSample[{$vowelSelector,$consonantSelector}],1+Ceiling[middleCount/2]]][[;;middleCount+2]]}]]],n]
In[]:=
myRandomWords[minClusters_:2]:=StringRiffle[randomWord[any,beginningOnly,middleOnly,endOnly,notBeginning,notMiddle,notEnd][minClusters,100]," "]/;2<=minClusters<=7
Output
Output
In[]:=
Manipulate[words,{{minClusters,4,"Minimum Clusters"},3,7,1,Appearance->"Open"},{{words,{},""},Function@Button["New Words",words=myRandomWords[minClusters]]},Initialization(words=myRandomWords[4]),SaveDefinitionsTrue]
Out[]=
Note: Ignore these error messages. It seems to be an issue on the cloud only, not sure why.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Simple made-up word generator
by Eric Parfitt
Wolfram Community, STAFF PICKS, March 27, 2025
https://community.wolfram.com/groups/-/m/t/3433688
by Eric Parfitt
Wolfram Community, STAFF PICKS, March 27, 2025
https://community.wolfram.com/groups/-/m/t/3433688

