A TextCatalogCollection is a wrapper around a Vector of CatalogedTexts. You can construct one from a Vector of CatalogedTexts.
usingCitableCorpususingCitableTexthay_urn =CtsUrn("urn:cts:citedemo:gburg.hay.v2:")hay =entry(hay_urn, "section", "Gettysburg Address", "Text of John Hay", "second HC digital edition")everett_urn =CtsUrn("urn:cts:citedemo:gburg.everett.v2:")everett =entry(everett_urn, "section", "Gettysburg Address", "Text of Edward Everett", "second HC digital edition")catalog =TextCatalogCollection([hay, everett])
TextCatalogCollection with 2 entries
The TextCatalogCollection implements the CitableCollectionTrait, which implies that it also implements URN comparison and CEX serialization
usingCitableBasecitablecollection(catalog)
true
usingCitableBaseurntype(catalog)
CtsUrn
cexserializable(catalog)
true
urncomparable(catalog)
true
In addition, it implements Julia’s Iterators behavior, as we’ll see below.
"#!ctscatalog\nurn|citationScheme|groupName|workTitle|versionLabel|exemplarLabel|online|language\nurn:cts:citedemo:gburg.hay.v2:|section|Gettysburg Address|Text of John Hay|second HC digital edition|nothing|true|eng\nurn:cts:citedemo:gburg.everett.v2:|section|Gettysburg Address|Text of Edward Everett|second HC digital edition|nothing|true|eng"
fromcex(catcex, TextCatalogCollection) == catalog
true
## Iteration
length(catalog)
2
eltype(catalog)
CatalogedText
collect(catalog)
2-element Vector{CatalogedText}:
<urn:cts:citedemo:gburg.hay.v2:> Gettysburg Address, Text of John Hay, second HC digital edition
<urn:cts:citedemo:gburg.everett.v2:> Gettysburg Address, Text of Edward Everett, second HC digital edition
for entry in catalogprintln(entry)end
<urn:cts:citedemo:gburg.hay.v2:> Gettysburg Address, Text of John Hay, second HC digital edition
<urn:cts:citedemo:gburg.everett.v2:> Gettysburg Address, Text of Edward Everett, second HC digital edition