-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Christopher W. Blackwell edited this page Jul 23, 2024
·
8 revisions
Iliad 2.4: ὡς αχέας should be ὡς ταχέας.
Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος
οὐλομένην· ἡ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκεν·
πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προΐαψεν
ἡρώων· αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν
οἰωνοῖσί τε πᾶσι· Διὸς δ' ἐτελείετο βουλή·
- Make an HTML page for Iliad Book 1, diplomatic edition.
- Make a series of HTML pages for each of the 24 books of the Iliad.
- Make a series of HTML pages for the whole Iliad, with 25 lines on each page, or fewer if you are the end of a Book. Be sure each pages identifies the Book and range of lines displayed.
- Ditto, but including both Diplomatic and Normalized exemplars. Grab a URN, do
dropexemplar
; do afilter
usingurncontains
. - Ditto, but when the Diplomatic and Normalized exemplars match, just show the Diplomatic line.
- Ditto, but when the two exemplars differ, wrap the differing substrings in a
<span>
element. - Format that result so it looks cool. The trick will be to use CSS to make the Normalized" line be completely transparent, except for the
<span>
element. And to do some fun color-thing on those<span>
elements.
function wrap_differences_with_span(stringA::String, stringB::String)::String
lenA = length(stringA)
lenB = length(stringB)
max_len = max(lenA, lenB)
resultA = ""
resultB = ""
in_diff = false
for i in 1:max_len
charA = i <= lenA ? stringA[i] : ""
charB = i <= lenB ? stringB[i] : ""
if charA != charB
if !in_diff
resultA *= "<span>"
resultB *= "<span>"
in_diff = true
end
resultA *= charA
resultB *= charB
else
if in_diff
resultA *= "</span>"
resultB *= "</span>"
in_diff = false
end
resultA *= charA
resultB *= charB
end
end
# Close any remaining open <span> tags
if in_diff
resultA *= "</span>"
resultB *= "</span>"
end
# Return the result
if stringA == stringB
return stringA
else
return resultA * "\r" * resultB
end
end
# Example usage
result1 = wrap_differences_with_span("hello, hello", "hallo, hallo")
println(result1) # Output: "h<span>e</span>llo, h<span>e</span>llo\rh<span>a</span>llo, h<span>a</span>llo"
- Get Diplomatic passages.
- Get URNs for each book of the Iliad, using URN-arithmatic
- Map each book, using
filter
usingurncontains
. You will have "citablePassage" objects, with a URN and a text. - Do "sliding" on those.
- Then map each "window" to HTML.