amir-zeldes/DepEdit

Value of $1 is sticky across rule applications

Closed this issue · 1 comments

Script:

; move PROPN dependents under NOUN (basic, enhanced)
upos=/PROPN/;upos=/NOUN/&func=/flat/;func!=/flat/	#1>#2;#1>#3	#2>#3
upos=/PROPN/;upos=/NOUN/&func=/flat/;func!=/flat/&edep=/(.*)/	#1>#2;#1~#3	#2~#3;#3:edep=$1;#1~#3;#3:edep=OLDA$1
; change external basic head, change flat to compound
upos=/PROPN/&func=/(.*)/;upos=/NOUN/&func=/flat/;lemma=/.*/	#1>#2;#3>#1	#3>#2;#2:func=$1;#2>#1;#1:func=compound

Input:

# sent_id = weblog-juancole.com_juancole_20040604210986_ENG_20040604_210986-0022
# text = The bungling of post-war Iraq by the Bush administration created a weak and failed state.
1	The	the	DET	DT	Definite=Def|PronType=Art	2	det	2:det	_
2	bungling	bungling	NOUN	NN	Number=Sing	10	nsubj	10:nsubj	_
3	of	of	ADP	IN	_	5	case	5:case	_
4	post-war	post-war	ADJ	JJ	Degree=Pos	5	amod	5:amod	_
5	Iraq	Iraq	PROPN	NNP	Number=Sing	2	nmod	2:nmod:of	_
6	by	by	ADP	IN	_	8	case	8:case	_
7	the	the	DET	DT	Definite=Def|PronType=Art	8	det	8:det	_
8	Bush	Bush	PROPN	NNP	Number=Sing	2	nmod	2:nmod:by	_
9	administration	administration	NOUN	NN	Number=Sing	8	flat	8:flat	_
10	created	create	VERB	VBD	Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin	0	root	0:root	_
11	a	a	DET	DT	Definite=Ind|PronType=Art	15	det	15:det	_
12	weak	weak	ADJ	JJ	Degree=Pos	15	amod	15:amod	_
13	and	and	CCONJ	CC	_	14	cc	14:cc	_
14	failed	fail	VERB	VBN	Tense=Past|VerbForm=Part|Voice=Pass	12	conj	12:conj:and|15:amod	_
15	state	state	NOUN	NN	Number=Sing	10	obj	10:obj	SpaceAfter=No
16	.	.	PUNCT	.	_	10	punct	10:punct	_

Result:

6	by	by	ADP	IN	_	9	case	8:OLDAcase|9:case	_
7	the	the	DET	DT	Definite=Def|PronType=Art	9	det	8:OLDAcase|9:case	_
8	Bush	Bush	PROPN	NNP	Number=Sing	9	compound	2:nmod:by	_
9	administration	administration	NOUN	NN	Number=Sing	2	nmod	8:flat	_

Expected—det for node 7 edeps:

6	by	by	ADP	IN	_	9	case	8:OLDAcase|9:case	_
7	the	the	DET	DT	Definite=Def|PronType=Art	9	det	8:OLDAdet|9:det	_
8	Bush	Bush	PROPN	NNP	Number=Sing	9	compound	2:nmod:by	_
9	administration	administration	NOUN	NN	Number=Sing	2	nmod	8:flat	_

It seems the case value of $1 from the 2nd rule applied to node 6 is repeated on node 7.

Thanks for reporting, I think I found the issue. Will fix.