WikiDiscuss

WikiDiscuss


PEG Morphology Algorithm

On Fri, Dec 17, 2004 at 09:08:02PM -0500, Pierre Abbat wrote:
> I think the defining document for the morphology should be the
> algorithm, not the PEG code. (The algorithm is in the valfendi
> tarball and needs editing for clarity.)

No. No. No.

That is unacceptable.

Totally unacceptable.

The English description of the morphology is a cute toy. Not a
formalism. It needs to die. Quickly. The sooner the better. The
world will be a better place the instant every extant copy is
expunged.

> In an algorithm, and in the C code that implements the algorithm,
> one can make a copy of a string, modify it in some way, run a test
> on it, make another copy, modify it in a different way, and run
> another test. This is not so easy to do in PEG. Thus making the
> parser simultaneously check that all the y's in a lujvo are valid
> and that the stress is in the right place given where the commas are
> makes it a lot bigger than checking each one separately.
>
> I'm talking without much knowledge of PEG, so if there is a way to
> do two or three tests without multiplying complexity, please let me
> know.

Parsing Expression Grammars are just another formalism like Context
Free Grammars. Once the grammar is written, there won't be any reason
to write your own morphology parser. You'll take a parser generator
for the desired language, and you'll run it on the grammar. It will
produce code you don't have to test.

If you're considering writing your own parsing code to duplicate the
effect of what is described by the grammar, well, you can entertain
yourself however you please. But don't ask the rest of us to suffer
for it.

--
Jay Kominek <jkominek@miranda.org>