Related articles |
---|
need help with using a grammar to construct a sentence from a group of plantz@fgm.com (Glen Plantz) (1998-04-13) |
Re: need help with using a grammar to construct a sentence from a grou kelley@iguana.ruralnet.net (1998-04-18) |
Re: need help with using a grammar to construct a sentence from a grou resslere@erols.com (resslere) (1998-04-21) |
Re: need help with using a grammar to construct a sentence from a grou donham@linex.com (Jake Donham) (1998-04-27) |
Re: need help with using a grammar to construct a sentence from a grou js10@doc.ic.ac.uk (1998-05-04) |
Re: need help with using a grammar to construct a sentence from a grou schairer@dfki.de (Axel Schairer) (1998-05-04) |
From: | Axel Schairer <schairer@dfki.de> |
Newsgroups: | comp.compilers |
Date: | 4 May 1998 22:55:45 -0400 |
Organization: | DFKI - German Research Center for Artificial Intelligence |
References: | 98-04-049 98-04-075 |
Keywords: | parse, testing |
kelley@iguana.ruralnet.net (Kevin Kelley) writes:
> Say that a language is a set of productions; a production is a mapping
> from a nonterminal to a rule (vector of 0 or more term/nonterm).
> Then, start with the top production, and repeat substituting rules for
> nonterminals, randomly (or based on some preference criteria)
> selecting the rule to use from the set of rules for a given lhs, until
> you've got no nonterminals left.
[snip]
A simple sentence generator is discussed in Chapter 2 of P. Norvig:
Paradigms of Artificial Intelligence Programming, Case Studies in
Common Lisp, Morgan Kaufmann, 1992. There is also a simple
implementation in CL. You might even find the code on the book home
page at: http://www.norvig.com/paip.html
Hope this helps, Axel
--
=== Axel Schairer, htt p:/ /w ww.d fki .de/~s chairer/ ===
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.