Create a random word generator for a new language?

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 3452 Views - Last Post: 13 February 2012 - 09:10 AM Rate Topic: -----

#1 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Create a random word generator for a new language?

Posted 18 January 2012 - 04:59 PM

So, I'm creating a new language. I have all the characters written out, I just need to start forming the words. I need a program that will create random words, using English letters, but they can't be too random. For example, I don't use the letter c, if two vowels are together they have to be ii, ey, ei, aa, uu, or oo, and the words can't be too long. I also want some letters to pop up more frequently than others (optional). I don't want any repeating words either. Eventually, I would also like the program to match the new words with English words (that I will provide). In the end, I imagine a large list of 1000 words for my new language and their English translations. I hope this isn't too demanding, but I don't know where to start and I don't feel like making up 1000 words on my own, nor do I have the time. If someone could give me some tips on how I can start, or if someone's willing to start it for me, that'd be great. Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Create a random word generator for a new language?

#2 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: Create a random word generator for a new language?

Posted 18 January 2012 - 06:03 PM

I'd take those rules and generate the words combinatorially - start with the first "part" of the word, select from your available options (if there's no restriction on the first letter, just grab one randomly). From then, move on, generating random selection keeping your restrictions in mind.
Was This Post Helpful? 0
  • +
  • -

#3 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: Create a random word generator for a new language?

Posted 18 January 2012 - 07:12 PM

I would have 2 sequences. 1 sequence filled with vowel phonemes the other with consonants phonemes and vowels phonemes(you can repeat certain phonemes if you want them to show up more). first you pick a random vowel phoneme then you pick a random consonant/vowel phoneme add it on to the front or back(randomly decide between the 2 or none at all) then possibly add another to the other side. this ensures that each syllable has a vowel sound and the some have consonants; this *should* ensure more pronounceable syllables.

randomly generate a number of syllables you want for a word then generate that many random syllables. the effect *should* be a more or less pronounceable word.

I found this which has a complete list of phonemes and huge list of syllables.

edit:
also, have you thought about composing your words from syllables instead? that way every single word would be pronounceable for sure.

This post has been edited by ishkabible: 18 January 2012 - 07:32 PM

Was This Post Helpful? 1
  • +
  • -

#4 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 18 January 2012 - 08:27 PM

View Postishkabible, on 18 January 2012 - 07:12 PM, said:

I would have 2 sequences. 1 sequence filled with vowel phonemes the other with consonants phonemes and vowels phonemes(you can repeat certain phonemes if you want them to show up more). first you pick a random vowel phoneme then you pick a random consonant/vowel phoneme add it on to the front or back(randomly decide between the 2 or none at all) then possibly add another to the other side. this ensures that each syllable has a vowel sound and the some have consonants; this *should* ensure more pronounceable syllables.

randomly generate a number of syllables you want for a word then generate that many random syllables. the effect *should* be a more or less pronounceable word.

I found this which has a complete list of phonemes and huge list of syllables.

edit:
also, have you thought about composing your words from syllables instead? that way every single word would be pronounceable for sure.


Yeah, actually that's how I made the first few words of my language, so that sounds like a great idea. What language do you recommend using?
Was This Post Helpful? 0
  • +
  • -

#5 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: Create a random word generator for a new language?

Posted 19 January 2012 - 07:49 AM

Python, Ruby, Lua, Javascript - something high level.
Was This Post Helpful? 1
  • +
  • -

#6 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 19 January 2012 - 05:23 PM

I'm most comfortable with Javascript, so I think I'll use that. Thanks for the advice!
Was This Post Helpful? 0
  • +
  • -

#7 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 19 January 2012 - 08:58 PM

With Javascript, are there any shortcuts or any easy ways of randomizing the results? I'm also having trouble figuring out how I can place the letters where they would fit best. Sorry, I don't have a ton of experience with Javascript. An example would be great, and I should be able to figure out the rest from that.

And I need to know how to make sure none of the syllables (and eventually words) repeat themselves throughout the final product.
Was This Post Helpful? 0
  • +
  • -

#8 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: Create a random word generator for a new language?

Posted 20 January 2012 - 07:46 AM

Just do it in the language you are most comfortable with.

As I explained I would have pre-made arrays of phonemes or syllables(or store them in a file and read them in at run time) then select random indexes from this array.
Was This Post Helpful? 0
  • +
  • -

#9 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7649
  • View blog
  • Posts: 12,905
  • Joined: 19-March 11

Re: Create a random word generator for a new language?

Posted 20 January 2012 - 10:19 AM

This is not such a trivial problem, actually, for any phonology worth discussing. The random-concatenation procedure will probably come up with some legitimate words, but they will not reflect any particular phonology, and most of them will likely be unpronounceable.

I think you'll have to write a little "grammar" to do this, but it's going to be more difficult than you think, assuming you want to generate all and only the legitimate sequences in the language under a certain length. (where the length will actually be syllables, not characters)

In English, you'd have to think about things in roughly this order:

a syllable can be as simple as V (hi·lar·i·ous) and as complex as CCCVCCCCC (strengths). A complex syllable is not built by simple concatenation: *strenthgs would not be a legitimate word in any language I can imagine.

Clearly you don't want to do the combinatorics on this, and random generation will produce a lot of useless dross.

We notice without too much more thought that some symbols combine readily where others do not, and that the big difficulties will be presented by the consonants. 'q' appears almost universally with a following 'u', 't' is often followed by 'h', 'b' is sometimes followed by 'l' and 'z' cannot appear between two 'k's. So we'd like to break down consonants into certain types. Immediately we have a snag in English, because different sounds can be represented by the same symbol. (It's less of a problem that difference symbols can represent the same sound) I hope your alphabet is more phonetic than English! (take a look at Finnish for this, they keep things nice and simple, at that level... the syntax is a bear, though)
Although they are simpler, there are of course a few issues with vowels - do you count "ou" in "hilarious" as one V or two? Again, a more phonetic alphabet would save us a lot of headaches, but I'll suggest just eliminating complex vowel combinations instead.

So as it turns out the English orthography presents a lot of problems, but it's not all of the problems. So if we simplify the orthography to something more reasonable, we still have to deal with the fact that a consonant cluster can be as complex as [r][n][t][s] - this is a possible ending for a syllable, since we could have a word ending in it. ("How many burgers did they need?" "One rare, two medium, and three burnts"). However, if it's in medial position, you'll find that the syllable breaks at the t-s boundary. (nonce forms like "torntsistic" naturally break tornt-sistic and not *tornts-istic). This means your generator will have to be aware of where in the word you are. The sequence -ntsp- cannot appear in a word-final position, but it's fine when the syllable breaks it into =Vnt-spV-.


By now we're starting to get a little nervous, so we look at the literature, and we find that syllable structure of English has been the subject of intense study for the last fifty years or so, and before, so we're right to be nervous. This is actually hard stuff.

So, maybe just randomly generating characters (and manually pruning out the impossible ones) is the easiest way, after all - but that's a boring answer! You can probably solve this problem for your language if you do a few things to make your life easier. First, make sure your alphabet is a one-to-one mapping of sounds to symbols. Second, disallow complex vowel combinations. (you can make rules for strong and weak vowels based on meter later, those won't affect this problem, I think) Third, start out with monosyllabic words. If you want polysyllables, that's a lot more difficult.

Lastly, if you haven't done any work with formal grammars, it might be good to take a look at them before you dive into this.

Have fun!

This post has been edited by jon.kiparsky: 20 January 2012 - 10:19 AM

Was This Post Helpful? 1
  • +
  • -

#10 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: Create a random word generator for a new language?

Posted 20 January 2012 - 12:28 PM

You might find my letter combinations snippets in haskell or python useful for this. They currently generate random words based on the English alphabet but you could easily modify to include phonemes and your own alphabet.
Was This Post Helpful? 0
  • +
  • -

#11 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: Create a random word generator for a new language?

Posted 20 January 2012 - 01:26 PM

@jon: I believe that Benjamin Franklin wrote a phonetic alphabet. Also, I meant to suggest to only use a finite set of phonemes and to use those as the alphabet(the ones shown in the link).
Was This Post Helpful? 0
  • +
  • -

#12 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 21 January 2012 - 03:37 PM

It sounds like I'm going to end up typing most of the word combonations in the program itself...
Was This Post Helpful? 0
  • +
  • -

#13 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 21 January 2012 - 11:50 PM

Nevermind. I made a list of all possible consonant clusters that can appear before and after the vowel sound in each syllable because every syllable has exactly one vowel sound in it with consonants before and/or after it (or with none at all). After that, my plan is to set all possible consonent clusters before the vowel (CBV), consonent clusters after the vowel (CAV), and each vowel sound (V) and put them in the equations "CBV + V + CAV", "CBV + V", and "V + CAV". Sound like a good plan? Also, I still need to know how to make sure my different syllables won't repeat throughout the final document. Thanks again! You guys have been a great help.
Was This Post Helpful? 0
  • +
  • -

#14 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 22 January 2012 - 12:15 PM

Ok, so I've got this, but when I press Start, nothing happens. What's wrong with it?
<html>
<head>
<script type="text/javascript">
var x=1;
var y=0;
var z=0;
function cons(x,y,z)
{ //all variables set. cbv=x=1-48, v=y=0-13, cav=z=0-70
var cbv = new Array(48);
cbv[1] = "b";
cbv[2] = "bl";
cbv[3] = "br";
cbv[4] = "d";
cbv[5] = "dr";
cbv[6] = "dw";
cbv[7] = "f";
cbv[8] = "fr";
cbv[9] = "fl";
cbv[10] = "g";
cbv[11] = "gr";
cbv[12] = "gl";
cbv[13] = "gw";
cbv[14] = "h";
cbv[15] = "j";
cbv[16] = "k";
cbv[17] = "kl";
cbv[18] = "kr";
cbv[19] = "l";
cbv[20] = "m";
cbv[21] = "n";
cbv[22] = "p";
cbv[23] = "pl";
cbv[24] = "pr";
cbv[25] = "qu";
cbv[26] = "r";
cbv[27] = "s";
cbv[28] = "sh";
cbv[29] = "shr";
cbv[30] = "sk";
cbv[31] = "skr";
cbv[32] = "sl";
cbv[33] = "sm";
cbv[34] = "sn";
cbv[35] = "sp";
cbv[36] = "spr";
cbv[37] = "squ";
cbv[38] = "sr";
cbv[39] = "st";
cbv[40] = "str";
cbv[41] = "sw";
cbv[42] = "t";
cbv[43] = "tr";
cbv[44] = "th";
cbv[45] = "v";
cbv[46] = "w";
cbv[47] = "y";
cbv[48] = "z";

var cav = new Array(71);
cav[0] = "b";
cav[1] = "bs";
cav[2] = "d";
cav[3] = "ds";
cav[5] = "f";
cav[6] = "fs";
cav[7] = "ft";
cav[8] = "fth";
cav[9] = "g";
cav[10] = "gs";
cav[11] = "j";
cav[12] = "k";
cav[13] = "ks";
cav[14] = "l";
cav[15] = "ld";
cav[16] = "lds";
cav[17] = "lf";
cav[18] = "lfs";
cav[19] = "lfth";
cav[20] = "lfths";
cav[21] = "lk";
cav[22] = "lks";
cav[23] = "ll";
cav[24] = "lls";
cav[25] = "lm";
cav[26] = "lms";
cav[27] = "ln";
cav[28] = "lns";
cav[29] = "lp";
cav[30] = "lps";
cav[31] = "ls";
cav[32] = "lt";
cav[33] = "lts";
cav[34] = "m";
cav[35] = "ms";
cav[36] = "mp";
cav[37] = "mps";
cav[38] = "n";
cav[39] = "nd";
cav[40] = "nds";
cav[41] = "ng";
cav[42] = "ngs";
cav[43] = "ngth";
cav[44] = "ngths";
cav[45] = "p";
cav[46] = "ps";
cav[47] = "pt";
cav[48] = "pts";
cav[49] = "r";
cav[50] = "rb";
cav[51] = "rbs";
cav[52] = "rd";
cav[53] = "rds";
cav[54] = "s";
cav[55] = "sh";
cav[56] = "sk";
cav[57] = "sks";
cav[58] = "sp";
cav[59] = "sps";
cav[60] = "st";
cav[61] = "sts";
cav[62] = "t";
cav[63] = "ts";
cav[64] = "th";
cav[65] = "v";
cav[66] = "vs";
cav[67] = "w";
cav[68] = "ws";
cav[69] = "x";
cav[70] = "z";

var v = new Array(14);
v[0] = "a";
v[1] = "aa";
v[2] = "ah";
v[3] = "e";
v[4] = "ei";
v[5] = "ey";
v[6] = "i";
v[7] = "ii";
v[8] = "ir";
v[9] = "o";
v[10] = "oo";
v[11] = "u";
v[12] = "ur";
v[13] = "uu";

for (x=1;x<cbv.length;x++;y=0;z=0)
{if (y==70)
	{
	document.write(cbv[x] + v[y] + cav[z] + "<br />");
	(x=1;y=0;z++);
	}
else if (x==48)	
	{
	document.write(cbv[x] + v[y] + cav[z] + "<br />");
	(x=1;y++);
	}
else
	{
	document.write(cbv[x] + v[y] + cav[z] + "<br />");
	(x++);
	}
}
</script>

</head>
<body>
<input type="button" value="Start" onclick="cons()" />
</body>
</html>



Edit: I changed "v" to "vow" if that helps any.
Was This Post Helpful? 0
  • +
  • -

#15 Radi0actvChickn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-January 12

Re: Create a random word generator for a new language?

Posted 22 January 2012 - 09:01 PM

Ok, it's something wrong with the x, y, and z in
document.write(cbv[x] + v[y] + cav[z] + "<br />");
but I don't know how else to write this.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2