smain, daar ook whq
alpino2agensmatch (w:word) where 'heid' in w._cp or 'loos' in w._cp and length(w._cp) > 1 return w.sentid as sid, w.word, w.lemma
on_gevallen_verzekering → ongeval_verzekeringdier_genees_middel → dier_genezen_middel / dier_genezing_middel ??staat_burger_schap → staat_burgerschap ??linker_rups_band → links_rups_band ??her_uit_geven → her_uitgeven / her_uitgegeven ??Let op die extra voorwaarde r2[0].rel = 'whd'. Anders krijg je in
Alpino Treebank ook vooral als vorfeld in de zin Wat is begrip en
vooral , wat is politiek ? (sentence-ID: 2875).
match (x:nw)
where x.sentid + ' ' + x.id in (
select sid
from (
match (n:node)-[r:rel*0..1{rel:'body'}]->(nn:node)-[:rel{rel:'hd'}]->(fin:word)
where ( n.cat = 'smain' and length(r) = 0 )
or ( n.cat = 'whq' and length(r) = 1 and nn.cat = 'sv1' )
match (n)-[r2:rel*1..{primary:true}]->(topic:nw)-[rel:rel*0..1]->(htopic:nw)
where ( n.cat = 'smain' or r2[0].rel = 'whd' )
and ( ( htopic.lemma is not null
and htopic.begin < fin.begin
and ( length(rel) = 0
or rel[0].rel in ['hd','cmp','crd']
)
)
or
( topic.begin < fin.begin
and
topic.end <= fin.begin
)
)
return topic.sentid + ' ' + topic.id as sid, n.id as nid
except
match (n:node)-[r:rel*0..1{rel:'body'}]->(nn:node)-[:rel{rel:'hd'}]->(fin:word)
where ( n.cat = 'smain' and length(r) = 0 )
or ( n.cat = 'whq' and length(r) = 1 and nn.cat = 'sv1' )
match (n)-[r2:rel*1..{primary:true}]->(topic:nw)-[rel:rel*0..1]->(htopic:nw)
where ( n.cat = 'smain' or r2[0].rel = 'whd' )
and ( ( htopic.lemma is not null
and htopic.begin < fin.begin
and ( length(rel) = 0
or rel[0].rel in ['hd','cmp','crd']
)
)
or
( topic.begin < fin.begin
and
topic.end <= fin.begin
)
)
match (topic)<-[:rel*1..]-(nt:node)<-[:rel*1..]-(n)
match (nt)-[relt:rel*0..1]->(hnt:nw)
where ( hnt.lemma is not null
and hnt.begin < fin.begin
and ( length(relt) = 0
or relt[0].rel in ['hd','cmp','crd']
)
)
or
( nt.begin < fin.begin
and
nt.end <= fin.begin
)
return topic.sentid + ' ' + topic.id as sid, n.id as nid
) as foo
)
set x._vorfeld = true;
Aanpassing macro’s voor PaQu.
Eerste macro onveranderd, tweede nieuw, derde veranderd.
PQ_precedes_head_of_smain = """
( ancestor::node[@cat="smain"]/node[@rel="hd"]/%PQ_b% > %PQ_begin_of_head%
or
( ancestor::node[@cat="smain"]/node[@rel="hd"]/%PQ_b% > %PQ_b%
and
not(node[%PQ_headrel%])
)
) """
PQ_precedes_head_of_whq = """
( ancestor-or-self::node[@rel="whd"]/parent::node[@cat="whq"]/node[@rel="body" and @cat="sv1"]/node[@rel="hd"]/%PQ_b% > %PQ_begin_of_head%
or
( ancestor-or-self::node[@rel="whd"]/parent::node[@cat="whq"]/node[@rel="body" and @cat="sv1"]/node[@rel="hd"]/%PQ_b% > %PQ_b%
and
not(node[%PQ_headrel%])
)
) """
PQ_vorfeld = """
( ( ( %PQ_precedes_head_of_smain%
and
not(parent::node[%PQ_precedes_head_of_smain%])
)
or
( %PQ_precedes_head_of_whq%
and
not(parent::node[%PQ_precedes_head_of_whq%])
)
)
and
(@cat or @pt)
) """