Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Ron Savage
Couldn't OP just use: lexeme default = latm => 1# Active the Longest Acceptable Token Match option. -- You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Ruslan Shvedov
On Thu, Sep 4, 2014 at 6:24 AM, Andrew Dunbar wrote: > Do we know if that's ambiguous? > Yes, only one alternative is listed. > Don't we have to run it through Marpa::R2::ASF to know? > We test for ambiguity by calling ambiguous() on the recognizer (example

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Ruslan Shvedov
On Thu, Sep 4, 2014 at 8:00 AM, Jeffrey Kegler < jeffreykeg...@jeffreykegler.com> wrote: > Perhaps if we differentiate between "closed" and "open" spans -- "closed" > ending in a consonant and "open" ending in a vowel. > > All ::= Span > Span ::= Closed_Span | Open_Span > Closed_Span ::= Abbrevia

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Jeffrey Kegler
Perhaps if we differentiate between "closed" and "open" spans -- "closed" ending in a consonant and "open" ending in a vowel. All ::= Span Span ::= Closed_Span | Open_Span Closed_Span ::= Abbreviation Closed_Span :: Closed_Syllable Closed_Span ::= Span Closed_Syllable Closed_Span ::= Closed_Span

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Andrew Dunbar
Yes I'm vague on Data::Dumper and I don't know much about the workings of Marpa. I added on the example code for Marpa::R2::ASF so I can compare it with my real code. It doesn't seem to be ambiguous now but I actually can't see what's different about it. I'm not sure whether I simplified it too

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Jeffrey Kegler
What rns did (as I read it) was list all the results of $slr->value(). The parse is unambiguous if and only if there is exactly one, which seems to be the case here. (You've been away from Perl, so Data::Dumper may now be hard to read, but you can confirm this for yourself by adding a line be

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Andrew Dunbar
Do we know if that's ambiguous? Don't we have to run it through Marpa::R2::ASF to know? On Wednesday, 3 September 2014 20:10:42 UTC+10, rns wrote: > > Can you please look at this gist > ? The result is in the > comment below it. This might be

Re: Produce a syntax tree

2014-09-03 Thread Ed Avis
Jeffrey Kegler writes: >specify > >    :default ::= action => [name,values] > >as your only action, and Marpa will build the syntax tree. Yes, I think that's exactly what I want to do. Now I will look into converting my Parse::RecDescent grammar into Marpa language, and converting the tree st

Re: How can I handle this kind of ambiguity?

2014-09-03 Thread Ruslan Shvedov
Can you please look at this gist ? The result is in the comment below it. This might be a solution provided that I've got the right idea. On Wed, Sep 3, 2014 at 11:44 AM, Andrew Dunbar wrote: > I've come back to Perl after a long absence jus

How can I handle this kind of ambiguity?

2014-09-03 Thread Andrew Dunbar
I've come back to Perl after a long absence just to play with Marpa because it looks like the most full featured Earley parser in any of the programming languages I know. I'm interested in Earley specifically because it can handle ambiguity and can produce a parse forest. I'm using it to inves