### A Pluto.jl notebook ###
# v0.20.20
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
#! format: off
return quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
#! format: on
end
# ╔═╡ 6cd35fe4-32f3-11ef-23a7-25b03dbd4a6a
# ╠═╡ show_logs = false
begin
using Pkg
Pkg.add(url = "https://github.com/neelsmith/Complutensian.jl")
using Complutensian
Pkg.add("CitableText")
using CitableText
using Markdown
Pkg.add("PlutoUI")
using PlutoUI
Pkg.add("CSV")
using CSV
Pkg.add("TypedTables")
using TypedTables
md"""*To see Julia environment, unhide this cell.*"""
end
# ╔═╡ 34e2e4d6-ba9e-4652-9d1c-be7a80386978
nbversion = "0.1.0";
# ╔═╡ 6afc33e1-0a59-4162-b2d3-b81e52ba1192
md"""*Notebook version*: **$(nbversion)** *See release notes*: $(@bind releaseinfo CheckBox())"""
# ╔═╡ 223d76fd-5f1d-46f4-954d-c3d2c526d947
if releaseinfo
md"""
- version **0.1.0**: initial release
"""
end
# ╔═╡ 18896021-53ce-4600-8b96-6a8edae405d3
TableOfContents()
# ╔═╡ ee7b33a1-e02c-459a-b9f5-3fb8b855bf1d
md"""# Explore automated verb alignments"""
# ╔═╡ d81c5cfd-8ebb-492d-a45c-44163e333379
html"""
"""
# ╔═╡ 63f908ee-0fe0-4afe-b68a-dc7f478ddec9
md"""# Mechanics"""
# ╔═╡ e5ec8309-58cc-4127-998d-da4ff70ac34c
md"""> ## HTMLing"""
# ╔═╡ 6662a744-a6ab-4609-b4dd-05cc0cb5e78b
css = html"""
"""
# ╔═╡ b7cb6ead-9d89-4532-a5e5-bddaecef8338
md"""> ## Data"""
# ╔═╡ d26fff15-871c-424b-bc68-3df2cf48752a
md"""Tweak skip list:"""
# ╔═╡ ce2f65bc-8e6b-4f2f-ba3e-2ec3c0d07f0e
dico = "ls.n13804"
# ╔═╡ 2d6fdab9-0abd-4f21-aa5d-2a6c9eafbc9c
eo = "ls.n15868"
# ╔═╡ a3263b9e-a1bd-462b-9b83-71a839b4d040
facio = "ls.n17516"
# ╔═╡ 8d4e5b24-6024-4fa5-81e2-91376f754fd1
creo = "ls.n11543"
# ╔═╡ a45d2229-e648-443a-b87f-7974782027e1
fero = "ls.n17964"
# ╔═╡ 50b2ada9-5bae-4fb7-993f-3228d27f5ccb
skips = [Complutensian.SUM, dico, eo, facio, fero]
# ╔═╡ 92143449-98ee-4f2f-ab02-ef0aad75996b
md"""## Local data"""
# ╔═╡ 3c6b384f-476f-4379-bbb4-1545eeda9114
repo = pwd() |> dirname |> dirname
# ╔═╡ c9afd2db-5370-49db-9ed7-7f0a80c645aa
labelsfile = joinpath(repo, "parses", "labels.cex")
# ╔═╡ a7b2e433-87d8-413f-915b-703ab0bed3f5
vlexdata = joinpath(repo, "parses", "verblexemes-current.csv")
# ╔═╡ aa8f2894-08fd-4aaa-a99c-8cc2433e1b52
"""Get labels data from local copy of `labels.cex`"""
function labelslocal(f)
#lblurl = "http://shot.holycross.edu/complutensian/labels.cex"
#tmplbls = Downloads.download(lblurl)
#lns = readlines(tmplbls)
lns = readlines(f)
#rm(tmplbls)
dict = Dict()
for ln in lns
parts = split(ln, "|")
dict[parts[1]] = string(parts[1], " (", parts[2], ")")
end
dict
end
# ╔═╡ 0f533e23-757a-4882-8f8a-2ce16fee2b11
labels = labelslocal(labelsfile) #loadlabels()
# ╔═╡ 954fabb3-6c65-464a-9b3c-0f115df029db
"""Compose an HTML table for table of alignments."""
function alignmenttab(vrb, data; lbls = labels)
psgids = passagesforverb(vrb,data)
urns = map(psg -> urnforpassage(psg, data), psgids)
psglabels = map(u -> string("", titlecase(workid(u)), " ", passagecomponent(u)), urns)
vulgateranks = map(passagesforverb(vrb,data)) do psg
alignverb(vrb, "vulgate", psg,data)
end
targumranks = map(passagesforverb(vrb,data)) do psg
alignverb(vrb, "targum", psg,data)
end
lxxranks = map(passagesforverb(vrb,data)) do psg
alignverb(vrb, "septuagint", psg,data)
end
htmlout = ["
| Passage | Vulgate | Septuagint | Targum |
|---|---|---|---|
| $(psglabels[i]) | $(v) | $(s) | $(t) |