in reply to Re: Natural Language Sentence Production
in thread Natural Language Sentence Production

Er. That probably could have been more clear. Don't generate a long random sentance and then check it, build it up a piece at a time.
while(...) { my @sentence = (); for (1..$random_sentence_length) { do { $next_word = random_word_generator(); } while(not grammar_correct(@sentance, $next_word); push @sentance, $next_word; } print @sentance; }