Taken:
_deste, _np en _vorfeld
:rel (als er extra attributen op komen)Voorbeeld:
dact_attrib \
-m macros.txt \
infile.dact \
outfile.dact \
'//node[%PQ_vorfeld%]' 'VORFELD="true"' \
'//node[%PQ_np%]' 'NP="true"' \
'//node[node[@graad="comp"] and node[@lemma=("hoe", "deste") or (node[@lemma="des"] and node[@lemma="te"])]]' 'DESTE="true"'
Dit moet anders, waarschijnlijk zoiets:
<node> <nattr name="aap"/> <!-- boolean --> <nattr name="kleur" value="rood"/> <rattr name="getrouwd_met"/> <!-- boolean --> <rattr name="afstand_tot" value="10km"/> </node>
Dan is de command line:
dact_attrib \
-m macros.txt \
infile.dact \
outfile.dact \
'//node[%PQ_vorfeld%]' 'nattr:vorfeld' \
'//node[%PQ_np%]' 'nattr:np' \
'//node[node[@graad="comp"] and node[@lemma=("hoe", "deste") or (node[@lemma="des"] and node[@lemma="te"])]]' 'nattr:deste'
Bovenstaand formaat kan verwerkt worden door dact2agens zonder het
programma voor elk nieuw attribuut te moeten aanpassen.
Ook hoeft de DTD voor alpino_ds maar één keer aangepast te worden.
Probleem: Hoe weet je bij het inlezen in AgensGraph of een waarde
"10" een getal of een string is? Zo?
<node> <nattr name="aap"/> <!-- boolean --> <nattr name="kleur" text="rood"/> <!-- string --> <rattr name="getrouwd_met"/> <!-- boolean --> <rattr name="afstand_tot" int="10000"/> <!-- int --> </node>
Van dit:
select count(distinct(sentid)) as zinnen, count(sentid) as items from ( match ... return distinct n.sentid, n.id ) as foo
… naar dit:
match ... with distinct n.sentid as sentid, n.id as id return count(distinct(sentid)) as zinnen, count(sentid) as items
Er blijven twee soorten query’s over waarin toch een select nodig is.
Een telling over een telling:
select crd, count(crd) as aantal
from (
match (n:node{cat: 'conj'})-[r:rel{rel: 'crd'}]->()
with n, count(r) as crd
return crd
) as foo
group by crd
order by crd
Een telling over een union of except:
select count(distinct(sentid)) as zinnen, count(sentid) as items
from (
match (w:word)
where w.sc starts with 'part_'
return distinct w.sentid, w.id
except
match (w:word)<-[:rel{rel: 'hd'}]-()-[:rel{rel: 'svp'}]->(w2)
where w.sc starts with 'part_'
and w2.frame starts with 'particle'
return distinct w.sentid, w.id
) as foo
Misschien kan het zonder sql, maar ik zou niet weten hoe.