Skip to content

Commit 5a34b90

Browse files
committed
Save the semgrex rules for EN, ZH, ES to git - will be useful for tracking changes or just so other people can see the rules
1 parent 60c685e commit 5a34b90

File tree

107 files changed

+1708
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1708
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# appos is a very finicky edge
2+
#{ner:ORGANIZATION}=entity >/appos/ {ner:ORGANIZATION}=slot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ner:/ORGANIZATION/}=entity >appos ( {} >/compound|flat|nn|amod/ {ner:/CITY|LOCATION/}=slot )
2+
{ner:/ORGANIZATION/}=entity >/amod/ ({word:/based|registered|headquartered/} >/obl/ {ner:/CITY/}=slot)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{ner:/ORGANIZATION/}=entity >appos ( {} >/compound|flat|nn|amod/ {ner:/COUNTRY|LOCATION/}=slot )
2+
{ner:/ORGANIZATION/}=entity >appos ( {} >/compound|flat|nn|amod/ {ner:/NATIONALITY|LOCATION/}=slot )
3+
{ner:/ORGANIZATION/}=entity >/amod/ ({word:/based|registered|headquartered/} >/obl/ {ner:/COUNTRY|NATIONALITY/}=slot)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ner:ORGANIZATION}=entity >/appos|conj.*/ ( {lemma:/parent|owner/} >/(nmod:|obl:|prep_)of/ {ner:ORGANIZATION}=slot )
2+
{ner:ORGANIZATION}=entity >/amod/ ({word:/owned|backed|controlled/} >/obl/ {ner:ORGANIZATION}=slot)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{tag:/NN.?/} >/.subj.*/ {ner:ORGANIZATION}=entity >/appos|conj.*/ ( {tag:/NN.*/} >/amod|nn|compound|flat/ {ner:IDEOLOGY}=slot )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{lemma:/(sell|transfer)/}=entity >nsubj {ner:ORGANIZATION}=entity >obj {lemma:share} >/(nmod:|obl:|prep_)to/ {ner:/(ORGANIZATION|LOCATION|CITY|STATE_OR_PROVINCE|COUNTRY)/}=slot
2+
{lemma:/(purchase|buy|retain)/} >nsubj {ner:/(ORGANIZATION|CITY|STATE_OR_PROVINCE|COUNTRY|PERSON)/}=slot >obj {lemma:/(stake|share)/} >/(nmod|obl)*/ {ner:ORGANIZATION}=entity
3+
{lemma:invest} >nsubj {ner:/(ORGANIZATION|CITY|STATE_OR_PROVINCE|COUNTRY|PERSON)/}=slot >obj {} >/(nmod|obl):in/ {ner:ORGANIZATION}=entity
4+
{lemma:acquire} >nsubj {ner:/(ORGANIZATION|CITY|STATE_OR_PROVINCE|COUNTRY|PERSON)/}=slot >obj {} >/.*/ {ner:ORGANIZATION}=entity
5+
{lemma:get} >nsubj {ner:/(ORGANIZATION|CITY|STATE_OR_PROVINCE|COUNTRY|PERSON)/}=slot >obj {lemma:stake} >/.*/ {ner:ORGANIZATION}=entity
6+
{lemma:transfer} >nsubj {ner:/(ORGANIZATION|CITY|STATE_OR_PROVINCE|COUNTRY|PERSON)/}=slot >obj {lemma:stake} >/(nmod|obl):in/ {ner:ORGANIZATION}=entity
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ner:/ORGANIZATION/}=entity >appos ( {} >/compound|flat|nn|amod/ {ner:/STATE_OR_PROVINCE|LOCATION/}=slot )
2+
{ner:/ORGANIZATION/}=entity >/amod/ ({word:/based|registered|headquartered/} >/obl/ {ner:/STATE_OR_PROVINCE/}=slot)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{lemma:/buy|sell|acquire|own/} >/.subj.*/ {ner:ORGANIZATION}=entity >/(i?)obj/ {ner:ORGANIZATION}=slot
2+
{lemma:/buy|sell|acquire|own/} >/.subj.*/ {ner:ORGANIZATION}=entity >/(i?)obj/ ( {} >/appos/ {ner:ORGANIZATION}=slot )
3+
{lemma:/buy|sell|acquire|own/} >/.subj.*/ {ner:ORGANIZATION}=slot >/(prep_|nmod:|obl:)(by|to)/ {ner:ORGANIZATION}=entity
4+
{lemma:/buy|sell|acquire|own/} >/.subj.*/ {ner:ORGANIZATION}=entity >/(i?)obj/ ( {lemma:/stake|interest|share/} >/(prep_|nmod:|obl:)in/ {ner:ORGANIZATION}=slot )
5+
{ner:ORGANIZATION}=entity >/appos|conj.*/ ( {lemma:/part|subsidiary|unit|division|branch|wing/} >/(prep_|nmod:|obl:)of/ {ner:ORGANIZATION}=slot )
6+
# {ner:ORGANIZATION}=slot >/nmod:poss/ {ner:ORGANIZATION}=entity
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
macro TOPTITLE = lemma:/[eE]xecutive|[cC]hairman|[pP]resident|[cC]hief|[hH]ead|[gG]eneral|[cC][eE][oO]|[oO]fficer|[lL]eader|[vV]ice|[kK]ing|[pP]rince|[mM]anager|[mM]inister|[aA]dviser|[bB]oss|[cC]hair|[aA]mbassador|[sS]tar|[gG]overnor|[iI]nvestor|[rR]epresentative|[dD]ean|[cC]ommissioner|[cC]ommander|[mM]idfielder|[sS]peaker|[Rr]esearcher|[eE]ditor|[Cc]hancellor|[fF]ellow|[lL]eadership|[dD]iplomat|[aA]ssociate|[sS]triker|[pP]ilot|[cC]aptain|[bB]anker|[mM]ayor|[pP]remier|[pP]roducer|[aA]rchitect|[dD]esigner|[mM]ajor|[aA]dvisor|[pP]resident|[sS]enator|[sS]pecialist|[fF]aculty|[cC]hairwoman|[mM]ediator|[pP]rosecutor|[eE]ntrepreneur|[cC]reator|[sS]uperstar|[cC]ommentator|[pP]rincipal|[oO]perative|[bB]usinessman|[pP]eacekeeper|[iI]nvestigator|[cC]oordinator|[kK]night|[lL]awmaker|[jJ]ustice|[pP]ublisher|[pP]laymaker|[mM]oderator|[nN]egotiator|[Dd]irector|[Jj]ustice/
2+
3+
{ner:PERSON}=slot >/nn|compound|flat|amod|appos/ ( {${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity )
4+
{ner:PERSON}=slot >/nn|compound|flat|amod|appos/ ( {${TOPTITLE}} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity ) )
5+
{${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot
6+
{${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ ( {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot )
7+
( {${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity ) >/nsubj.*/ {ner:PERSON}=slot >cop {}
8+
{tag:/VB.*/} >nsubj {ner:PERSON}=slot >/(prep_|nmod:|obl:)as/ ( {${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity )
9+
{}=slot >/acl:relcl/ ({tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)as/ ( {${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity ) )
10+
{${TOPTITLE}} >/nmod:poss/ {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot
11+
{ner:PERSON}=slot >appos ( {${TOPTITLE}} >/(nmod:|obl:)(poss|of|at)/ {ner:ORGANIZATION}=entity )
12+
{${TOPTITLE}} >/(prep_|nmod:|obl:)(of|at|poss)/ {ner:ORGANIZATION}=entity >/nn|compound|flat|amod|appos/ {ner:PERSON}=slot
13+
# Variants with things that aren't titles, but are good for employee relationships
14+
{ner:PERSON}=slot >/nn|compound|flat|amod|appos/ ( {lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity )
15+
{lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity >/nn|compound|flat|amod|appos/ {ner:PERSON}=slot
16+
{lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot
17+
{lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ ( {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot )
18+
( {lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity ) >/nsubj.*/ {ner:PERSON}=slot >cop {}
19+
{tag:/VB.*/} >nsubj {ner:PERSON}=slot >/(prep_|nmod:|obl:)as/ ( {lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity )
20+
{}=slot >/acl:relcl/ ({tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)as/ ( {lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|at)/ {ner:ORGANIZATION}=entity ) )
21+
{ner:ORGANIZATION}=entity >/nmod:poss/ ( {lemma:/speaker|head|chief/} >/appos/ {ner:PERSON}=slot )
22+
# SLOT's firm, ENTITY
23+
{lemma:/firm|company|business|association|corporation|organization|society/} >/nmod:poss/ {ner:PERSON}=slot >/appos/ {ner:ORGANIZATION}=entity
24+
# TITLE of ORG, ENTITY / ORG 's TITLE, ENTITY
25+
{${TOPTITLE}} >/(prep_|nmod:|obl:)(of|poss)/ {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot
26+
{lemma:/speaker|head|chief/} >/(prep_|nmod:|obl:)(of|poss)/ {ner:ORGANIZATION}=entity >/appos/ {ner:PERSON}=slot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Joe died of X
2+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(at)/ {ner:NUMBER}=slot
3+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(at)/ ( {lemma:/age/} >nummod {ner:NUMBER}=slot )
4+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(at)/ {ner:NUMBER}=slot)
5+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(at)/ ({lemma:/age/} >nummod {ner:NUMBER}=slot ))
6+
# X, who rel Y
7+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(at)/ {ner:NUMBER}=slot)
8+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(at)/ {ner:NUMBER}=slot))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# appos is a very finicky edge
2+
# {ner:PERSON}=entity >/appos/ {ner:PERSON}=slot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Joe died of X
2+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(of|from|after)/ {ner:CAUSE_OF_DEATH}=slot
3+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(of|from|after)/ {ner:CAUSE_OF_DEATH}=slot)
4+
# X, who rel Y
5+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(of|from|after)/ {ner:CAUSE_OF_DEATH}=slot)
6+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(of|from|after)/ {ner:CAUSE_OF_DEATH}=slot))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{lemma:/charge|convict|indict|accuse/} >nsubj {}=entity >/(prep_|nmod:|obl:)(of|with)/ {ner:/CRIMINAL_CHARGE/}=slot
2+
{lemma:/charge|convict|indict|accuse/} >nsubj {}=entity >/(prep_|nmod:|obl:)(of|with)/ ( {ner:/CRIMINAL_CHARGE/} >/conj:and/ {ner:/CRIMINAL_CHARGE/}=slot )
3+
{lemma:/plead/} >nsubj {}=entity >obj {} >/(prep_|nmod:|obl:)(of|to)/ {ner:/CRIMINAL_CHARGE/}
4+
{lemma:/face/} >nsubj {}=entity >obj {ner:/CRIMINAL_CHARGE/}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# His son, Joe
2+
# (Stanford dependencies; conj is fixing common parse errors)
3+
{ner:PERSON}=entity >/poss/ ( {lemma:/son|daughter|child/} >/appos|conj.*/ {ner:PERSON}=slot )
4+
# (Universal dependencies; conj is fixing common parse errors)
5+
{lemma:/son|daughter|child/} >/;mod:poss/ {ner:PERSON}=entity >/appos|conj.*/ {ner:PERSON}=slot
6+
{ner:PERSON}=entity >/poss/ ( {lemma:/son|daughter|child/} >/appos|conj.*/ {ner:PERSON}=slot )
7+
# Among ENTITY's sons are SLOT.
8+
{lemma:/be/} >/(prep_|nmod:|obl:).*/ ( {lemma:/son|daughter|child/} >/nmod:poss/ {ner:PERSON}=entity ) >/.subj/ {ner:PERSON}=slot
9+
# SLOT, son of ENTITY
10+
{ner:PERSON}=slot >/appos|conj.*/ ( {lemma:/son|daughter|child/} >/(prep_|nmod:|obl:)of/ {ner:PERSON}=entity )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#John lives in Stanford
2+
{lemma:/raise|live|reside|grow/;tag:/VB.*/} >/nsubj.*/ {}=entity [ >/(prep_|nmod:|obl:)in/ {ner:CITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:CITY}=slot ]
3+
#John was born in Kansas but lives in Stanford
4+
{} >/nsubj.*/ {}=entity >/conj.*/ ({lemma:/raise|live|reside|grow/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:CITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:CITY}=slot ] )
5+
#John, who lives in Stanford, met me today.
6+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:CITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:CITY}=slot])
7+
# X, who rel Y
8+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} >/nsubj.*/ {lemma:who} [ >/(prep_|nmod:|obl:)in/ {ner:CITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:CITY}=slot ])
9+
{}=entity >/rcmod|acl:relcl/ ({lemma:who} >rcmod ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:CITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:CITY}=slot]))
10+
# "John, of Stanford" -- consistently marked wrong by annotators?
11+
{}=entity >/(prep_|nmod:|obl:)of/ {ner:CITY}=slot
12+
#Canada-based John
13+
{ner:PERSON}=entity >/amod/ ( {word:/based|raised/} >/obl/ {ner:/CITY/}=slot )
14+
{ner:PERSON}=entity >/compound/ ( {ner:TITLE} >/compound/ {ner:/CITY/}=slot )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#example: Obama was born in Hawaii.
2+
{lemma:bear;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(at|in)/ {ner:/CITY|LOCATION/}=slot
3+
# X, who rel Y
4+
{}=entity >/acl:relcl/ ({lemma:bear;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(at|in)/ {ner:/CITY|LOCATION/}=slot)
5+
#Canada-born John
6+
{ner:PERSON}=entity >/amod/ ( {word:/born/} >/obl/ {ner:/CITY/}=slot )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#example: Joe died in Hawaii.
2+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ {ner:/CITY|LOCATION/}=slot
3+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ ( {} >/compound|flat|nn|amod/ {ner:/CITY|LOCATION/}=slot )
4+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/CITY|LOCATION/}=slot)
5+
# X, who rel Y
6+
{}=entity >/acl:relcl/ ({lemma:die;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(in|at)/ {ner:/CITY|LOCATION/}=slot)
7+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/CITY|LOCATION/}=slot))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#John lives in Stanford
2+
{lemma:/raise|live|reside|grow/;tag:/VB.*/} >/nsubj.*/ {}=entity [ >/(prep_|nmod:|obl:)in/ {ner:COUNTRY}=slot | >/(prep_|nmod:|obl:)at/ {ner:COUNTRY}=slot ]
3+
#John was born in Kansas but lives in Stanford
4+
{} >/nsubj.*/ {}=entity >/conj.*/ ({lemma:/raise|live|reside|grow/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:COUNTRY}=slot | >/(prep_|nmod:|obl:)at/ {ner:COUNTRY}=slot ] )
5+
#John, who lives in Stanford, met me today.
6+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:COUNTRY}=slot | >/(prep_|nmod:|obl:)at/ {ner:COUNTRY}=slot])
7+
# X, who rel Y
8+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} >/nsubj.*/ {lemma:who} [ >/(prep_|nmod:|obl:)in/ {ner:COUNTRY}=slot | >/(prep_|nmod:|obl:)at/ {ner:COUNTRY}=slot ])
9+
{}=entity >/rcmod|acl:relcl/ ({lemma:who} >rcmod ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:COUNTRY}=slot | >/(prep_|nmod:|obl:)at/ {ner:COUNTRY}=slot]))
10+
# "John, of Stanford" -- consistently marked wrong by annotators?
11+
{}=entity >/(prep_|nmod:|obl:)of/ {ner:COUNTRY}=slot
12+
#John lives in Stanford
13+
{lemma:/raise|live|reside|grow/;tag:/VB.*/} >/nsubj.*/ {}=entity [ >/(prep_|nmod:|obl:)in/ {ner:NATIONALITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:NATIONALITY}=slot ]
14+
#John was born in Kansas but lives in Stanford
15+
{} >/nsubj.*/ {}=entity >/conj.*/ ({lemma:/raise|live|reside|grow/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:NATIONALITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:NATIONALITY}=slot ] )
16+
#John, who lives in Stanford, met me today.
17+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:NATIONALITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:NATIONALITY}=slot])
18+
# X, who rel Y
19+
{}=entity >/rcmod|acl:relcl/ ({lemma:/raise|live|reside/;tag:/VB.*/} >/nsubj.*/ {lemma:who} [ >/(prep_|nmod:|obl:)in/ {ner:NATIONALITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:NATIONALITY}=slot ])
20+
{}=entity >/rcmod|acl:relcl/ ({lemma:who} >rcmod ({lemma:/raise|live|reside/;tag:/VB.*/} [ >/(prep_|nmod:|obl:)in/ {ner:NATIONALITY}=slot | >/(prep_|nmod:|obl:)at/ {ner:NATIONALITY}=slot]))
21+
# "John, of Stanford" -- consistently marked wrong by annotators?
22+
{}=entity >/(prep_|nmod:|obl:)of/ {ner:NATIONALITY}=slot
23+
#Canada-based John
24+
{ner:PERSON}=entity >/amod/ ( {word:/based|raised/} >/obl/ {ner:/COUNTRY|NATIONALITY/}=slot )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#example: Obama was born in Hawaii.
2+
{lemma:bear;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(at|in)/ {ner:/COUNTRY|LOCATION/}=slot
3+
# X, who rel Y
4+
{}=entity >/acl:relcl/ ({lemma:bear;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(at|in)/ {ner:/COUNTRY|LOCATION/}=slot)
5+
#example: Obama was born in Hawaii.
6+
{lemma:bear;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(at|in)/ {ner:/NATIONALITY|LOCATION/}=slot
7+
# X, who rel Y
8+
{}=entity >/acl:relcl/ ({lemma:bear;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(at|in)/ {ner:/NATIONALITY|LOCATION/}=slot)
9+
#Canada-born John
10+
{ner:PERSON}=entity >/amod/ ( {word:/born/} >/obl/ {ner:/COUNTRY|NATIONALITY/}=slot )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#example: Joe died in Hawaii.
2+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ {ner:/COUNTRY|LOCATION/}=slot
3+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ ( {} >/compound|flat|nn|amod/ {ner:/COUNTRY|LOCATION/}=slot )
4+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/COUNTRY|LOCATION/}=slot)
5+
# X, who rel Y
6+
{}=entity >/acl:relcl/ ({lemma:die;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(in|at)/ {ner:/COUNTRY|LOCATION/}=slot)
7+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/COUNTRY|LOCATION/}=slot))
8+
#example: Joe died in Hawaii.
9+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ {ner:/NATIONALITY|LOCATION/}=slot
10+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:)(in|at)/ ( {} >/compound|flat|nn|amod/ {ner:/NATIONALITY|LOCATION/}=slot )
11+
{lemma:die} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/NATIONALITY|LOCATION/}=slot)
12+
# X, who rel Y
13+
{}=entity >/acl:relcl/ ({lemma:die;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(in|at)/ {ner:/NATIONALITY|LOCATION/}=slot)
14+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(in|at)/ {ner:/NATIONALITY|LOCATION/}=slot))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Joe died of X
2+
{lemma:/bear/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot
3+
{lemma:/bear/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot)
4+
# X, who rel Y
5+
{}=entity >/acl:relcl/ ({lemma:/bear/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot)
6+
{}=entity >/acl:relcl/ ({lemma:/bear/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Joe died of X
2+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot
3+
{lemma:/die/;tag:/VB.*/} >nsubj {}=entity >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot)
4+
# X, who rel Y
5+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot)
6+
{}=entity >/acl:relcl/ ({lemma:/die/;tag:/VB.*/} >nsubj {lemma:who} >/(prep_|nmod:|obl:).*/ ({} >/(prep_|nmod:|obl:)(on|in)|(nmod:|obl:)tmod/ {ner:/DATE|TIME/}=slot))

0 commit comments

Comments
 (0)