veangous / DBHA

0 stars 0 forks source link

12b completed in last comment #5

Open everythingnew opened 4 years ago

everythingnew commented 4 years ago

select count(*) as anzahl from document d ,document_term t , pos_type p
where d.document_id = t.document_id and t.pos_id =p.pos_id and d.title ilike 'Der Eisenhans' and (not (p.parent_pos =0 or p.pos_id=0))

-- output = 1913 --Lösung = 2461

veangous commented 4 years ago

and d.title ilike 'Der Eisenhans' and (not (p.parent_pos =0 or p.pos_id=0))

Wenn wir das integrieren kriegen wir 0 punkte, man darf nur (POS_TYPE.DESCRIPTION=’N’) verwenden

veangous commented 4 years ago

WITH n1 as (SELECT pos_id as pi1 FROM pos_type p1 WHERE description = 'N'),

n2 as (SELECT p2.pos_id as term FROM pos_type p2, n1 WHERE p2.parent_pos = n1.pi1)

SELECT count(dt.term) as anzahl_nicht_substantive FROM document d, document_term dt, pos_type p3 WHERE d.document_id = dt.document_id AND dt.pos_id = p3.pos_id AND d.title like 'Der Eisenhans'

AND NOT EXISTS (SELECT * FROM n2 WHERE p3.pos_id = n2.term)