-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Neel Smith edited this page Oct 11, 2021
·
3 revisions
Welcome to the CitableBase.jl wiki!
note on THTT
using CitableBase
abstract type CitableTrait end struct IsCitable <: CitableTrait end struct NotCitable <: CitableTrait end CitableTrait(::Type) = NotCitable() CitableTrait(t::T) where {T <: Citable} = IsCitable()
using CitableText, CitableCorpus psg = CitablePassage(CtsUrn("urn:cts:greekLit:tlg0012.tlg001:1.1"), "Wrath begins")
CitableTrait(psg)
reallabel(x::T) where {T} = reallabel(CitableTrait(T), x)
reallabel(::IsCitable, x) = error("Please implement reallabel for ", typeof(x))
function reallabel(p::CitablePassage) "Woohoo, a label!" end
#Example of override for a citable text type:
#1. Assign trait value
# CitableTrait(::Type{GoodText}) = CitableByCtsUrn()
# 2. implement function