Chapter 8: Scope and data
1 Two languages in one collection
The Kepler edition prints Kepler’s Latin together with a German apparatus. A count that does not filter by language mixes Kepler’s text with the editors’ notes.
How many sentences of the Kepler edition does Stanza assign to each language?
Partitur
---
id: languages
collections: [kepler-prim]
display: tabelle
duckdb:
- alias: main
path: $PDAI_COLLECTIONS/kepler-prim/kepler-prim_stanza.duckdb
read_only: true
partiturs:
- id: duckdb-read
input:
sql: |
SELECT lang, count(*) AS sentences
FROM stz_sentences
GROUP BY lang
ORDER BY sentences DESC
artefacts:
- name: languages
kind: table
file: languages.json
---
How many sentences of the Kepler edition does Stanza assign to each language?2 What identifies a sentence
How many Latin sentences are there, counted by the key (doc_id, pidx, sent_idx), and how many remain if the page index pidx is left out of the key?
Partitur
---
id: sentence-key
collections: [kepler-prim]
display: kennzahl
duckdb:
- alias: main
path: $PDAI_COLLECTIONS/kepler-prim/kepler-prim_stanza.duckdb
read_only: true
partiturs:
- id: duckdb-read
input:
sql: |
SELECT count(*) AS n_rows,
count(DISTINCT (doc_id, pidx, sent_idx)) AS n_by_page_key,
count(DISTINCT (doc_id, sent_idx)) AS n_without_page
FROM stz_sentences
WHERE lang = 'la'
artefacts:
- name: keys
kind: table
file: keys.json
---
How many Latin sentences are there, counted by the key (doc_id, pidx, sent_idx),
and how many remain if the page index pidx is left out of the key?302401 n_rows, 302401 n_by_page_key, 5648 n_without_page.
ohne Erwartung3 Declaring the counting mode
The adjective naturalis is a lemma of its own, not a form of the noun natura. A count that adds it answers a different question.
In how many Latin sentences of Kepler do lex and natura occur together (counting mode canonical), and in how many if the adjective naturalis counts as well (family+adj)?
Partitur
---
id: counting-modes
collections: [kepler-prim]
display: kennzahl
duckdb:
- alias: main
path: $PDAI_COLLECTIONS/kepler-prim/kepler-prim_stanza.duckdb
read_only: true
partiturs:
- id: duckdb-read
input:
sql: |
WITH la AS (
SELECT doc_id, pidx, sent_idx FROM stz_sentences WHERE lang = 'la'
),
s AS (
SELECT t.doc_id, t.pidx, t.sent_idx,
bool_or(t.lemma = 'lex') AS has_lex,
bool_or(t.lemma = 'natura') AS has_natura,
bool_or(t.lemma = 'naturalis') AS has_naturalis
FROM read_parquet('$PDAI_COLLECTIONS/kepler-prim/lemma_index.parquet') AS t
JOIN la USING (doc_id, pidx, sent_idx)
WHERE t.lemma IN ('lex', 'natura', 'naturalis')
GROUP BY t.doc_id, t.pidx, t.sent_idx
)
SELECT count(*) FILTER (WHERE has_lex AND has_natura) AS canonical,
count(*) FILTER (WHERE has_lex AND (has_natura OR has_naturalis))
AS family_adj
FROM s
artefacts:
- name: modes
kind: table
file: modes.json
---
In how many Latin sentences of Kepler do lex and natura occur together
(counting mode canonical), and in how many if the adjective naturalis counts
as well (family+adj)?43 canonical, 51 family_adj.
ohne Erwartung