Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Natural Language Sentence Production

by Anonymous Monk
on Sep 22, 2005 at 21:25 UTC ( [id://494307]=note: print w/replies, xml ) Need Help??


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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://494307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-28 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found