Substitute with mixed set

8 views
Skip to first unread message

Kevin Donnelly

unread,
Jan 20, 2017, 10:45:43 AM1/20/17
to constrain...@googlegroups.com
I have two rules:
substitute (tagX LOC) (tagX LOC tagY) (tagX LOC);
substitute (tagX TEMP) (tagX TEMP tagY) (tagX TEMP);

Is there any way of conflating these in one rule?

I wondered about creating a set:
CLASSTAGS = LOC TEMP;
and using that in the rules, but I can't see that this would work, because the substitute locations and the thing being substituted both contain actual tags as well as what would be a set.

Is the assumption that this can't be done correct?

--
Pob hwyl / Best wishes

Kevin Donnelly
kevindonnelly.org.uk
cymraeg.org.uk

Tino Didriksen

unread,
Jan 20, 2017, 10:58:47 AM1/20/17
to Constraint Grammar, ke...@dotmon.com
Replied inline...


On Friday, 20 January 2017 16:45:43 UTC+1, Kevin Donnelly wrote:
I have two rules:
substitute (tagX LOC) (tagX LOC tagY) (tagX LOC);
substitute (tagX TEMP) (tagX TEMP tagY) (tagX TEMP);

Is there any way of conflating these in one rule?

I wondered about creating a set:
CLASSTAGS = LOC TEMP;
and using that in the rules, but I can't see that this would work, because the substitute locations and the thing being substituted both contain actual tags as well as what would be a set.

Is the assumption that this can't be done correct?


The order could be what sinks it, but maybe...

CLASSTAGS = LOC TEMP ;
substitute (tagX) + $$CLASSTAGS (tagX) + $$CLASSTAGS + (tagY) (tagX) + $$CLASSTAGS ;

-- Tino Didriksen

Kevin Donnelly

unread,
Jan 20, 2017, 12:09:16 PM1/20/17
to constrain...@googlegroups.com
----- Original Message -----
From: "Tino Didriksen" <Tino.Di...@gmail.com>
The order could be what sinks it, but maybe...
CLASSTAGS = LOC TEMP ;
substitute (tagX) + $$CLASSTAGS (tagX) + $$CLASSTAGS + (tagY) (tagX) + $$CLASSTAGS ;
-----

OMG! This actually works! Amazing - thanks!
Reply all
Reply to author
Forward
0 new messages