#!/usr/bin/perl

use CGI;
$q = new CGI;
print $q->header('text/plain');
print "\n\n";

@pre = ('', 'M', 'N', 'i');
@phn = qw( dwa
           ndwe
           thet
           wa
      sha     ka
      din     ga    ne
       tu      ge 
       zwe     thi ni
       in  ka tha 
san go ma
man su thu bu thel ezi
ngu zwel ith hozi god
uk hul nja
);


$count = 100;

while ($count--) {
    $num_syl = int(rand(3) + 1);
#    print "Count: $count, syl: $num_syl\n";
    $syl1 = @pre[int rand @pre];
    print $syl1;
    if (! ($syl1 =~ /^$/)) { 
	$num_syl--;
    }
    $syl2 = @phn[int rand @phn];
    if (! ($syl1 =~ /^[A-Z]/)) { 
	if ($syl2 =~ s/^(.)//) {
	    $foo = $1;
	    $foo =~ tr/a-z/A-Z/;
	    $syl2 = $foo . $syl2;
	}
    }
    print $syl2;
    while ($num_syl--) {
	print @phn[int rand @phn];
    }
    print "\n";
}
