Working with sentences, verbal expressions and tokens

The GreekSyntax package includes many functions documented in the API page on this site. This page highlights a few functions relating annotations in the hierarchy of sentences, verbal expressions, and tokens, to each other.

Sentence

Find verbal expressions belonging to a particular sentence:

s1 = sentences[1]
s1groups = groupsforsentence(s1, groups)
typeof(s1groups)
Vector{VerbalUnitAnnotation} (alias for Array{VerbalUnitAnnotation, 1})

Find tokens belonging to a particular sentence:

s1tokens = tokensforsentence(s1, tokens)
typeof(s1tokens)
Vector{TokenAnnotation} (alias for Array{TokenAnnotation, 1})

Find lexical tokens belonging to a particular sentence:

s1tokens = lexicalforsentence(s1, tokens)
typeof(s1tokens)
Vector{TokenAnnotation} (alias for Array{TokenAnnotation, 1})

Verbal expression

Find tokens belonging to a particular verbal expression:

g1 = groups[1]
g1tokens = tokensforgroup(g1, tokens)
typeof(g1tokens)
Vector{TokenAnnotation} (alias for Array{TokenAnnotation, 1})

Find the sentence a verbal expression belongs to:

g1sentence = sentenceforgroup(g1, sentences)
SentenceAnnotation(urn:cts:greekLit:tlg0540.tlg001.omar_tokens:1.6.1-1.6.46a, 10, urn:cts:greekLit:tlg0540.tlg001.omar_tokens:1.6.2)

Token

Find the group a token belongs to:

t1 = tokens[1]
groupfortoken(t1, groups)
VerbalUnitAnnotation("1.6.1-1.6.46a.1", "independent clause", "intransitive", 1, urn:cts:greekLit:tlg0540.tlg001.omar_tokens:1.6.1-1.6.46a)

Find the sentence a token belongs to:

sentencefortoken(t1, groups, sentences)
SentenceAnnotation(urn:cts:greekLit:tlg0540.tlg001.omar_tokens:1.6.1-1.6.46a, 10, urn:cts:greekLit:tlg0540.tlg001.omar_tokens:1.6.2)