#using HmtArchive, HmtArchive.Analysis
using HmtArchive.Analysis
current_release = hmt_cex()
normalizedtexts = hmt_normalized(current_release)Corpus with 40485 citable passages in 12 documents.
Package version: 0.16.1
January 13, 2025
Start by extracting a normalized edition of all texts in the archive.
#using HmtArchive, HmtArchive.Analysis
using HmtArchive.Analysis
current_release = hmt_cex()
normalizedtexts = hmt_normalized(current_release)Corpus with 40485 citable passages in 12 documents.
We’ll search in this corpus for the first line of Iliad 10 in the Venetus A manuscript, identified with a URN urn:cts:greekLit:tlg0012.tlg001.msA:10.1.
In the normalized editions of the HMT archive, CTS URNs have an exemplar identifier, normalized. The URN for Iliad 1.1 in the Venetus A, for example, is urn:cts:greekLit:tlg0012.tlg001.msA.normalized:1.1. When we filter the texts in our corpus, we’ll use the dropexemplar function (from the CitableBase package) to match the value we want.
using CitableText, CitableCorpus, CitableBase
u = CtsUrn("urn:cts:greekLit:tlg0012.tlg001.msA:10.1")
psgmatches = filter(normalizedtexts.passages) do psg
dropexemplar(psg.urn) == u
end1-element Vector{CitablePassage}:
<urn:cts:greekLit:tlg0012.tlg001.msA.normalized:10.1> Ἄλλοι μὲν παρὰ νηυσὶν ἀριστῆες Παναχαιῶν
In this case, the resulting Vector of passages has only one element. We could extract its text value directly from psgmatches[1]:
Alternatively, we extract a list of text values using any normal approach to working with Vectors, such as mapping or Julia broadcasting.
1-element Vector{SubString{String}}:
"Ἄλλοι μὲν παρὰ νηυσὶν ἀριστῆες Παναχαιῶν"
The HMT archive includes an index of scholia to passages of the Iliad. The index is a CitableCommentary (from the CitableAnnotations package; see documentation here).
Although the hmt_commentary returns a Vector of all citable commentaries in the archive, the currrent contents of the archive only have one commentary object, scholia on the Iliad. Since we know that, we’ll just confidently take the first commentary in the returned Vector.
urn:cite2:hmt:commentary.v1:all Index of scholia to *Iliad* passages they comment on
We can use the annotated and annotators functions from the CitableAnnotations package to see that the current index includes three texts of the Iliad commented on by eight scholia documents.
Set{CtsUrn} with 3 elements:
urn:cts:greekLit:tlg0012.tlg001.msA:
urn:cts:greekLit:tlg0012.tlg001.msB:
urn:cts:greekLit:tlg0012.tlg001.e3:
Set{CtsUrn} with 8 elements:
urn:cts:greekLit:tlg5026.msAim.hmt:
urn:cts:greekLit:tlg5026.msA.hmt:
urn:cts:greekLit:tlg5026.msAextra.hmt:
urn:cts:greekLit:tlg5026.msB.hmt:
urn:cts:greekLit:tlg5026.msAext.hmt:
urn:cts:greekLit:tlg5026.msAint.hmt:
urn:cts:greekLit:tlg5026.e3.hmt:
urn:cts:greekLit:tlg5026.msAil.hmt:
To find CitablePassages, use the scholia_on function.
2-element Vector{Vector{CitablePassage}}:
[<urn:cts:greekLit:tlg5026.msA.hmt.normalized:10.2.lemma> ἀλλοι μὲν παρα νηυσὶν ἀριστῆες Παναχαιῶν, <urn:cts:greekLit:tlg5026.msA.hmt.normalized:10.2.comment> εἰκότως ἀμφότερα γὰρ ὕπνου ἀγωγὰ καὶ ὁ ἐκ τῆς μάχης κάματος καὶ ἡ επι τῆ ἥττη δυσθυμία. παρα νηυσὶ δὲ λέγει. ἐπεὶ οἱ φύλακες ἐκτὸς τῶν νεῶν ῆσαν οἶς τὸ εγρηγορέναι ἀναγκαῖον οὔτε δὲ οἱ ἀριστεῖς δι όλης τῆς νυκτὸς ἐκάθευδον, ἀλλ Ὅμηρος τὸ παννύχιοι καὶ πανημέριοι , εἴωθε τιθέναι, καὶ ἐπι τῶν κατα μέρος, παννυχίη γάρ μοι Πατροκλῆος δειλοῖο ψυχὴ ἐφεστήκει , παννύχιοι μεν έπειτα καρηκομόωντες ἀχαιοί : οἱ δὲ πανημέριοι μολπῇ θεὸν ἱλάσκοντο ⁑]
[<urn:cts:greekLit:tlg5026.msA.hmt.normalized:10.3.lemma> , <urn:cts:greekLit:tlg5026.msA.hmt.normalized:10.3.comment> παραιτητέον τοὺς γράφοντας ὦν ἐστι καὶ Ζηνόδοτος ὤλλοι μὲν : ὴ καὶ τοὺς oπως οὖν βουλομένους δασύνειν: ἔστι γὰρ ὁ ποιητὴς παραλειπτικὸς τῶν ἄρθρων ⁑]
The resulting vector has one entry per scholion; each entry will have two citable passages, with the lemma and comment for the scholion.
To find a Vector of plain text contents for each scholion on a passage, use the scholia_text_on function.
2-element Vector{SubString{String}}:
"ἀλλοι μὲν παρα νηυσὶν ἀριστῆες " ⋯ 814 bytes ⋯ "ημέριοι μολπῇ θεὸν ἱλάσκοντο ⁑"
"παραιτητέον τοὺς γράφοντας ὦν ἐ" ⋯ 165 bytes ⋯ "τὴς παραλειπτικὸς τῶν ἄρθρων ⁑"
You can also get the same contents formatted in Markdown (with lemma, if any, strongly emphasized), using the scholia_text_md_on function.
2-element Vector{AbstractString}:
"**ἀλλοι μὲν παρα νηυσὶν ἀριστῆε" ⋯ 819 bytes ⋯ "ημέριοι μολπῇ θεὸν ἱλάσκοντο ⁑"
"παραιτητέον τοὺς γράφοντας ὦν ἐ" ⋯ 165 bytes ⋯ "τὴς παραλειπτικὸς τῶν ἄρθρων ⁑"
You could, for example, use these in a numbered list of results:
listitems = map(scholia_md) do item
"1. " * item
end
using Markdown
join(listitems, "\n") |> Markdown.parseἀλλοι μὲν παρα νηυσὶν ἀριστῆες Παναχαιῶν εἰκότως ἀμφότερα γὰρ ὕπνου ἀγωγὰ καὶ ὁ ἐκ τῆς μάχης κάματος καὶ ἡ επι τῆ ἥττη δυσθυμία. παρα νηυσὶ δὲ λέγει. ἐπεὶ οἱ φύλακες ἐκτὸς τῶν νεῶν ῆσαν οἶς τὸ εγρηγορέναι ἀναγκαῖον οὔτε δὲ οἱ ἀριστεῖς δι όλης τῆς νυκτὸς ἐκάθευδον, ἀλλ Ὅμηρος τὸ παννύχιοι καὶ πανημέριοι , εἴωθε τιθέναι, καὶ ἐπι τῶν κατα μέρος, παννυχίη γάρ μοι Πατροκλῆος δειλοῖο ψυχὴ ἐφεστήκει , παννύχιοι μεν έπειτα καρηκομόωντες ἀχαιοί : οἱ δὲ πανημέριοι μολπῇ θεὸν ἱλάσκοντο ⁑
παραιτητέον τοὺς γράφοντας ὦν ἐστι καὶ Ζηνόδοτος ὤλλοι μὲν : ὴ καὶ τοὺς oπως οὖν βουλομένους δασύνειν: ἔστι γὰρ ὁ ποιητὴς παραλειπτικὸς τῶν ἄρθρων ⁑
Note that the first scholion has a lemma, the second does not.