[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] questions about peg grammar
On Fri, Oct 29, 2010 at 4:40 PM, .alyn.post.
<alyn.post@lodockikumazvati.org> wrote:
> On Fri, Oct 29, 2010 at 03:36:09PM -0400, Luke Bergen wrote:
>> Ok, so I'm trying to get a feel for how the peg grammar handles lujvo so
>> that I can make my parser be as close to the real deal as possible (i.e.
>> not a sloppy hack). I have a question though. I think the relevant section
>> that I want to understand is the following, correct?
>> ;-----------------------------------------------------------------------------------------------------------------------------------------
>> lujvo <- !gismu !fuhivla !cmavo initial-rafsi* brivla-core
>> brivla-core <- fuhivla / gismu / CVV-final-rafsi / stressed-initial-rafsi
>> short-final-rafsi
>> stressed-initial-rafsi <- stressed-extended-rafsi / stressed-y-rafsi /
>> stressed-y-less-rafsi
>> initial-rafsi <- extended-rafsi / y-rafsi / !any-extended-rafsi
>> y-less-rafsi
>> any-extended-rafsi <- fuhivla / extended-rafsi / stressed-extended-rafsi
>> ;-----------------------------------------------------------------------------------------------------------------------------------------
>> Now, I may be reading this incorrectly, but wouldn't this mean that an
>> initial rafsi followed by a fuhivla would be considered a lujvo? i.e.
>> {bracidrspageti}?
>>
>
> This is a bit tricky.
>
> Look at the early part of the lujvo definition, and you can see
> there is a predicate-not operation saying "it can't have a fuhivla"
> (That is the !fuhivla).
That's right.
> So when the brivla-core matches, even through brivla-core is capable
> of having a fuhivla, it won't ever have one in this case, because
> the earlier predicate-not operation in the lujvo nonterminal won't let
> one be there.
That's not exactly right, however.
The !fu'uvla only says that a fu'ivla can't immediately follow. And
yes, that's why "bracidrspageti" is not a lujvo, because it (the whole
thing) will match the fu'ivla rule. "bracidrspageti" is a valid
fu'ivla.
But "bracidyspageti" for example will be accepted as a lujvo. It is
"initial-rafsi initial-rafsi fu'ivla", which matches the lujvo rule
because it does not begin with something that matches the gismu, the
fu'ivla or the cmavo rules.
The PEG grammar accepts lujvo made of fu'ivla. In particular every
fu'ivla works as the final rafsi of a lujvo, but it must always be
preceded by a rafsi that ends in "y".
mu'o mi'e xorxes
--
You received this message because you are subscribed to the Google Groups "lojban" group.
To post to this group, send email to lojban@googlegroups.com.
To unsubscribe from this group, send email to lojban+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lojban?hl=en.