Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!EU.net!sun4nl!freya.let.rug.nl!vannoord
From: vannoord@let.rug.nl (Gertjan van Noord)
Subject: Re: DCG parsing
Sender: news@let.rug.nl (News system at let.rug.nl)
Message-ID: <1994Nov12.123437.24741@let.rug.nl>
Date: Sat, 12 Nov 1994 12:34:37 GMT
References: <1994Nov8.185049.29988@seas.smu.edu> <PEREIRA.94Nov10220856@alta.research.att.com> <1994Nov12.000510.17371@seas.smu.edu>
Nntp-Posting-Host: tyr.let.rug.nl
Organization: Faculteit der Letteren, Rijksuniversiteit Groningen, NL
Lines: 105

In article <1994Nov12.000510.17371@seas.smu.edu> pedersen@seas.smu.edu (Ted Pedersen) writes:
>> I dodn't understand your reasoning. As stated, the problem is
>> symmetric, there is no reason why unknown words would be harder to
>> treat left-to-right than right-to-left. It may happen for a particular
>> grammar there are more constraints on unknown words from the left than
>> from the right. However, whether this will matter depends on your
>> particular way of handling unknown words. When I did something of that
>> kind for a fairly large English grammar, I didn't encounter the
>> problem you are worrying about.
>
>My thinking goes like this...Suppose you are parsing a 10 word
>sentence left to right and the second word is unknown. Suppose further
>that this word could be one of four different classes (noun, verb,
>adjective, adverb for instance). Then it would seem like one possible
>way of deciding the class of this unknown word would be to parse the
>sentenceassuming that each of the four classes is correct and see what
>happens. This means you would be parsing the rest of the sentence (8
>words) 4 different times.  
>
>So if you parse this same sentence right to left the unknown word will
>be second to the last. You assume all of the four potential classes
>are correct and parse to see what happens. Except in this case the
>rest of the sentence is only 1 word. It seems like it should be
>faster...If not, what's the flaw in my reasoning (I'm quick to concede
>that there could be...)

well, as Fernando is saying `the problem is symmetric'. In your example:
what if the 9th word is unknown.

Anyway your example doesn't seem to make much sense anyway if you
assume you use a reasonable parser that does not use backtracking to
search the searchspace.

>
>> If you really want to do right-to-left DCG parsing, the simplest way
>> is to take a standard DCG->Prolog translator and modify it in the
>> appropriate way. It's a pretty straightforward exercise.
>> --
>> Fernando Pereira

yes, in fact in last years class on NLP in Prolog this was an exercise
after the course was two weeks old .. (some students had problems, I admit).

>
>I guess that's what my original query was asking. I'm not such a great
>Prolog programmer so it didn't seem quite so obvious. All I could
>think of was reverse the sentence and reverse the grammar rules...and
>that just doesn't seem too slick...

that's a possibility. What's wrong with it?

If you're really interested in bidirectional parsing, you might find
the following references interesting.


@inproceedings{kay-hd,
   author    = {Martin Kay},
   title     = {Head driven Parsing},
   booktitle = {Proceedings of Workshop on Parsing Technologies},
   year      = {1989},
   address   = {Pittsburg}
}
@inproceedings{bouma-gertjan,
   author    = {Gosse Bouma and Gertjan van Noord},
   title     = {Head-driven Parsing for Lexicalist Grammars: Experimental Result
s},
   booktitle = eacl93,
   year      = {1993},
   address   = {Utrecht}
}         
@inproceedings{sikkel,
   author    = {Klaas Sikkel and Rieks op den Akker},
   title     = {Head-corner chart parsing},
   booktitle = {Proceedings Computer Science in the Netherlands (CSN '92)},
   year      = {1992},
   address   = {Utrecht}
}


@inproceedings{sikkel-durbuy,
   author    = {Klaas Sikkel and Rieks op den Akker},
   title     = {Predictive Head-Corner Chart Parsing},
   booktitle = {IWPT 3, Third International Workshop on Parsing Technologies},
   year      = {1993},
   address   = {Tilburg/Durbuy},
   pages     = {267-276}
}
                  
And a paper by Giorgio Satta and Markjan Nederhof at last year's ACL.

There are also a couple of papers on bidirectional parsing for TAGs,
Head Grammars, etc.


>
>Regards
>Ted
>---
>* Ted Pedersen                                  pedersen@seas.smu.edu * 
>* Department of Computer Science and Engineering,                     *
>* Southern Methodist University, Dallas, TX 75275      (214) 768-2126 *
>
>


