List Info

Thread: Re: GLR ambiguity




Re: GLR ambiguity
country flaguser name
United States
2007-06-16 01:15:23
> On 14 Jun 2007, at 12:48, Alessandro Di Marco wrote:
> I was trying to create a GLR grammar for natural
languages
> ...when I stuck on the
> following s/r ambiguity.

> text:
> 	  /* empty */
> 	| text sentence
> 	;
>
> sentence:
> 	  WORD EOL
> 	| DOUBLEQ WORD EOL
> 	| DOUBLEQ WORD EOL DOUBLEQ
> 	;
> 

GLR does not resolve grammar conflicts statically.  Bison
will
continue to report conflicts, and these reports really don't
tell you
much.  Since natural languages ARE ambiguous, what you must
use GLR
for is to gather the possible interpretations.  That is the
purpose of
%merge, which allows you, on encountering two different
parses of the
same phrase, to collect the interpretations (syntax trees,
or
whatever semantic values you are using) and return this
collection
(represented however you choose) as the value of the
ambiguous
construct.  %merge also allows you to reject some
interpretations on
context-sensitive grounds.  When I say "allows
you" I don't mean that
it provides specific facilities to do any of this, but
rather that it
gives a parser structure that allows YOU to write the
necessary actions.

Paul Hilfinger





_______________________________________________
help-bisongnu.org http
://lists.gnu.org/mailman/listinfo/help-bison

Re: GLR ambiguity
country flaguser name
Sweden
2007-06-16 16:10:12
On 16 Jun 2007, at 08:15, Paul Hilfinger wrote:

>
>> On 14 Jun 2007, at 12:48, Alessandro Di Marco
wrote:
>> I was trying to create a GLR grammar for natural
languages
>> ...when I stuck on the
>> following s/r ambiguity.
>
>> text:
>> 	  /* empty */
>> 	| text sentence
>> 	;
>>
>> sentence:
>> 	  WORD EOL
>> 	| DOUBLEQ WORD EOL
>> 	| DOUBLEQ WORD EOL DOUBLEQ
>> 	;

> GLR does not resolve grammar conflicts statically. 
Bison will
> continue to report conflicts, and these reports really
don't tell you
> much.  Since natural languages ARE ambiguous, what you
must use GLR
> for is to gather the possible interpretations.  That is
the purpose of
> %merge, which allows you, on encountering two different
parses of the
> same phrase, to collect the interpretations (syntax
trees, or
> whatever semantic values you are using) and return this
collection
> (represented however you choose) as the value of the
ambiguous
> construct.  %merge also allows you to reject some
interpretations on
> context-sensitive grounds.  When I say "allows
you" I don't mean that
> it provides specific facilities to do any of this, but
rather that it
> gives a parser structure that allows YOU to write the
necessary  
> actions.

We did not get to know how much of actual language process
that was  
intended - perhaps the intent was only to filter out
quotations?!

But it would sure be interesting if somebody took up the
quest of  
doing a natural language grammar. There is, in fact, a
Flex/Bison  
grammar for the constructed language lojban, which is made
not not be  
ambiguous:
   http://www.lojban.org/tiki/tiki-index.php?page=Ho
me+Page&bl
It might give inputs on how to do it for natural languages.

   Hans Aberg




_______________________________________________
help-bisongnu.org http
://lists.gnu.org/mailman/listinfo/help-bison

Re: GLR ambiguity
country flaguser name
Italy
2007-06-18 06:55:30
Hans Aberg <habergmath.su.se> writes:

   On 16 Jun 2007, at 08:15, Paul Hilfinger wrote:

   >
   >> On 14 Jun 2007, at 12:48, Alessandro Di Marco
wrote:
   >> I was trying to create a GLR grammar for natural
languages
   >> ...when I stuck on the
   >> following s/r ambiguity.
   >
   >> text:
   >> 	  /* empty */
   >> 	| text sentence
   >> 	;
   >>
   >> sentence:
   >> 	  WORD EOL
   >> 	| DOUBLEQ WORD EOL
   >> 	| DOUBLEQ WORD EOL DOUBLEQ
   >> 	;

   > GLR does not resolve grammar conflicts statically. 
Bison will
   > continue to report conflicts, and these reports
really don't tell you
   > much.  Since natural languages ARE ambiguous, what
you must use GLR
   > for is to gather the possible interpretations.  That
is the purpose of
   > %merge, which allows you, on encountering two
different parses of the
   > same phrase, to collect the interpretations (syntax
trees, or
   > whatever semantic values you are using) and return
this collection
   > (represented however you choose) as the value of the
ambiguous
   > construct.  %merge also allows you to reject some
interpretations on
   > context-sensitive grounds.  When I say "allows
you" I don't mean that
   > it provides specific facilities to do any of this,
but rather that it
   > gives a parser structure that allows YOU to write
the necessary  actions.

   We did not get to know how much of actual language
process that was  intended -
   perhaps the intent was only to filter out quotations?!

Well, IMO it would be a good starting point... (did you know
that the ladies'
market is managed by the Kowloon neighborhoods' people? 

   But it would sure be interesting if somebody took up the
quest of  doing a
   natural language grammar. There is, in fact, a Flex/Bison
 grammar for the
   constructed language lojban, which is made not not be 
ambiguous:
     http://www.lojban.org/tiki/tiki-index.php?page=Ho
me+Page&bl
   It might give inputs on how to do it for natural
languages.

Thanx!

Bye,
Alessandro

-- 
War is much too serious a matter to be entrusted to the
military. - Georges
Clemenceau



_______________________________________________
help-bisongnu.org http
://lists.gnu.org/mailman/listinfo/help-bison

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )