Parsing citable text content

Published

June 7, 2024

You can also parse citable text structures: passages, documents and corpora. Here we illustrate parsing a citable passage.

First, create a GettysburgParser and assign it to a variable named parser.

Instantiate a parser
using CitableParserBuilder
parser = CitableParserBuilder.gettysburgParser()
using CitableText, CitableCorpus
psgurn = CtsUrn("urn:cts:demo:gburg.hays.v2:1.2")
psg = CitablePassage(psgurn, "score")
psg_analysis = parsepassage(psg, parser; data = parser.data)
typeof(psg_analysis)
AnalyzedToken

The result is a new kind of object, the AnalyzedToken, which associates a Vector of Analysis objects with a citable passage.

urn(psg_analysis)
urn:cts:demo:gburg.hays.v2:1.2

What’s this?

psg_analysis.analyses == scoreparses