WikiDiscuss

WikiDiscuss


PEG Morphology Algorithm

posts: 14214

On Sat, Dec 18, 2004 at 08:53:57AM -0500, Pierre Abbat wrote:
> On Saturday 18 December 2004 08:45, Jorge "Llamb?as" wrote:
> > --- Pierre Abbat wrote:
> > > The problem I see with implementing this in PEG is that
> > > valfendi bites off a piece by counting syllables after the
> > > stress, then checks whether, among other things, the hyphens
> > > are in the right place. Is there a way to check one
> > >
> > > PE against the part of a string that matched another PE?
> >
> > Yes, with "&" and "!".
> >
> > exp <- &exp1 exp2
> >
> > will succeed only if exp2 starts with or is the start of exp1
> >
> > exp <- !exp1 exp2
> >
> > will succeed only if exp2 doesn't start with nor is the start of
> > exp1
>
> But how do you check that exp1 and exp2 are identical?

By "identical" I assume you mean "consume exactly the same input".

Within the strict formalism, I'm not sure you can. I will ponder
this. You can add code to do it, but that rather defeats the
purpose (the only place this trick is used in the current grammar is
with zoi, where it is unavoidable).

I suggested a workaround in another mail, however.

-Robin