WikiDiscuss

WikiDiscuss


PEG Morphology Algorithm

On Saturday 18 December 2004 18:52, Robin Lee Powell wrote:
> On Sat, Dec 18, 2004 at 08:13:24AM -0500, Pierre Abbat wrote:
> > Is a C program sufficiently unambiguous?
>
> Absolutely not. It's not a formalism, it's a piece of code.

Is there a formalism that I can translate valfendi into?

The problem appears to be that you and I think differently. When I wrote
valfendi, I separated, as well as I could, the operation of splitting a
stream of phonemes into words from the operation of determining whether those
words are valid. This is easier for me to understand. To do that, I have to
find the string that matches one regular expression (or parsing expression or
whatever) at the beginning of the remaining text, then check whether that
string, no more and no less, matches another expression. For instance, if the
text is /dAmymlongEnavau/, the first expression matches /dAmymlongEna/, which
the second does not match, although it does match /dAmymlo/. I could write a
PEG with two expressions, called lex-brivla and valid-brivla, and then write
"brivla <- &lex-brivla valid-brivla", but that would match /dAmymlongEnavau/
and consume /dAmymlo/, even though lex-brivla matched /dAmymlongEna/. Trying
to do both checks at once is confusing to me, though you seem to understand
it.

So, is there something sufficiently programming-language-like that I can check
that it's doing the same as valfendi, and sufficiently formal that you can
check that it's doing the same as the PEG?

phma
--
My monthly periods happen once per year.
-Les Perles de la médecine