ufal / perl-pmltq

Query engine and query language for trees in PML format
3 stars 2 forks source link

BTredEvaluator: member is in filter output a t-node #61

Open matyaskopp opened 5 years ago

matyaskopp commented 5 years ago

Related to #44

This query shouldn't return any output as member is not t-node

t-root $r := 
[ member mwes $m := [  ], 
     descendant t-node $t := 
     [ id = $m.id ] ];
  >> give $r.id,$m.id

It is listed in t-nodes but it has members attributes:

member type

t-root $r := 
[ member mwes $m := [  ], 
     descendant t-node $t := 
     [ id = $m.id ] ];
  >> give $r.id,$m.id,$t.id,$m.type

returns

t-cmpr9410-001-p2s1 s-cmpr9410-001-l1A  s-cmpr9410-001-l1A  lexeme
t-cmpr9410-001-p4s2 s-cmpr9410-001-l2A  s-cmpr9410-001-l2A  institution
t-cmpr9410-001-p4s3 s-cmpr9410-001-l3A  s-cmpr9410-001-l3A  time
t-cmpr9410-001-p6s1 s-cmpr9410-001-l4A  s-cmpr9410-001-l4A  person
t-cmpr9410-001-p8s1 s-cmpr9410-001-l5A  s-cmpr9410-001-l5A  lexeme
t-cmpr9410-001-p8s2 s-cmpr9410-001-l6A  s-cmpr9410-001-l6A  lexeme
t-cmpr9410-001-p8s2 s-cmpr9410-001-l7A  s-cmpr9410-001-l7A  lexeme

t-node type

t-node does not have type attribute

t-root $r := 
[ member mwes $m := [  ], 
     descendant t-node $t := 
     [ id = $m.id ] ];
  >> give $r.id,$m.id,$t.id,$t.type

returns error

Error while compiling attribute path type for objects of type 't-node': didn't find member 'type'

t-node t_lemma

t-root $r := 
[ member mwes $m := [  ], 
     descendant t-node $t := 
     [ id = $m.id ] ];
  >> give $r.id,$m.id,$t.id,$t.t_lemma

returns

t-cmpr9410-001-p2s1 s-cmpr9410-001-l1A  s-cmpr9410-001-l1A  
t-cmpr9410-001-p4s2 s-cmpr9410-001-l2A  s-cmpr9410-001-l2A  
t-cmpr9410-001-p4s3 s-cmpr9410-001-l3A  s-cmpr9410-001-l3A  
t-cmpr9410-001-p6s1 s-cmpr9410-001-l4A  s-cmpr9410-001-l4A  
t-cmpr9410-001-p8s1 s-cmpr9410-001-l5A  s-cmpr9410-001-l5A  
t-cmpr9410-001-p8s2 s-cmpr9410-001-l6A  s-cmpr9410-001-l6A  
t-cmpr9410-001-p8s2 s-cmpr9410-001-l7A  s-cmpr9410-001-l7A  

t_lemma is empty as this t-node is not real