SETPARENT and MAP in one rule?

8 views
Skip to first unread message

Paul Meurer

unread,
May 30, 2023, 5:38:55 AM5/30/23
to constrain...@googlegroups.com, Paul Meurer
Hi,

I am building dependency analyses from scratch in my CG3 grammar, using SETPARENT and MAP.

Often I find myself establishing a parent relation, and using MAP to put a label on it right afterwards, by basically repeating the constraints from the SETPARENT rule (with the obvious adaptations).

So I would find a rule that would do both operations in one very useful, something like

SETPARENT V + Rel
MAP >IOBJ
IF (NEGATE p (*))
TO (1* VERB + IO:3SgNH BARRIER CLB) ;

Perhaps I am missing something here?

Regards,
Paul Meurer

Tino Didriksen

unread,
May 30, 2023, 5:44:49 AM5/30/23
to constrain...@googlegroups.com, Paul Meurer
One of the papers for the NoDaLiDa CG workshop last week was the implementation of WITH to do exactly that (and more): https://visl.sdu.dk/pdf/CG-workshop2023_paper_3.pdf + https://visl.sdu.dk/cg3/chunked/rules.html#with

So your rules could be rewritten to something like:

WITH NOPARENT V + Rel IF (1* VERB + IO:3SgNH BARRIER CLB) {
   MAP >IOBJ (*) ;
   SETPARENT (*) TO (jC1 (*)) ;
};

-- Tino Didriksen

Paul Meurer

unread,
May 30, 2023, 5:59:22 AM5/30/23
to Tino Didriksen, Paul Meurer, constrain...@googlegroups.com
Oh, thanks, this is excellent! This will make my grammar much more readable.

- Paul Meurer

Am 30. 05. 23 um 11:44 schrieb Tino Didriksen <ma...@tinodidriksen.com>:

Paul Meurer

unread,
Jun 3, 2023, 3:20:16 PM6/3/23
to Tino Didriksen, Paul Meurer, constrain...@googlegroups.com
I have now tried the WITH construction (with vislcg3 freshly compiled from the newest git source), and I am wondering whether the NOPARENT flag has any effect.

Using NOPARENT:

WITH NOPARENT LastName IF (-1 Anthr + MF) {
   MAP >NAMEMOD (*) ;
   SETPARENT (*) TO (jC1 (*)) ;
};

the WITH rule and the SETPARENT subrule is triggered several times, as I can see in the trace output.

When I change it to

WITH LastName IF (-1 Anthr + MF) (NEGATE p (*)) {
   MAP >NAMEMOD (*) ;
   SETPARENT (*) TO (jC1 (*)) ;
};

it is rune only once, which is the expected behaviour for the first version also, I guess.

-- Paul Meurer


Am 30. 05. 23 um 11:44 schrieb Tino Didriksen <ma...@tinodidriksen.com>:

Reply all
Reply to author
Forward
0 new messages