- or download this
$trans[int(rand($#trans + 1))]
- or download this
sub pick
{
...
return $aref->[int(rand(scalar(@$aref)))];
}
- or download this
my %parts = (
det =>
...
properNoun =>
[qw{Alpesh Ann China Beijing}], # proper noun
...
- or download this
$parts{adj}->[1]
- or download this
pick($parts{adj});
- or download this
sub createNP{
my(@adjp);
...
{
$randnum = int(rand(2)+1);
if ($randnum == 1)
- or download this
sub createNP{
...
{
my $innerRN = int(rand(2)+1);
if ($innerRN == 1)
- or download this
$np[$counter] = $pluralNoun[int(rand($#pluralNoun + 1))];
- or download this
push(@np , $pluralNoun[int(rand($#pluralNoun + 1))])