Documentation
¶
Index ¶
- func FindFirstIndex(work Work) (int, bool)
- func FindLastIndex(work Work) (int, bool)
- func FindTextTokens(p Passage) (index int, found bool)
- func GetFirstIndex(work Work) (int, bool)
- func GetIndexByID(passageID string, work Work) (int, bool)
- func GetLastIndex(work Work) (int, bool)
- func IsCITEURN(URNString string) bool
- func IsCTSURN(URNString string) bool
- func IsExemplarID(URNString string) bool
- func IsRange(URNString string) bool
- func IsTextgroupID(URNString string) bool
- func IsVersionID(URNString string) bool
- func IsWorkID(URNString string) bool
- func RReturnSubStr(cmd, s string) (string, error)
- func ReturnSubStr(cmd, s string) (string, error)
- func WantSubstr(URNString string) bool
- type ArrayToken
- type CTSURN
- type Cite2Urn
- type CiteVerb
- type PassLoc
- type Passage
- type TextAndID
- type Textgroup
- type Tokenisation
- type Triple
- type Work
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFirstIndex ¶
FindFirstIndex was returning the First.Index saved in a passage. This task is now fulfilled by GetFirstIndex Now, FindFirstIndex returns the lowest Passage.Index of the Passages in a Work, along with a bool whether it has found one. This is necessary for the first analysis of a work. For example in SortPassages.
func FindLastIndex ¶
FindLastIndex was returning the Last.Index saved in a passage. This task is now fulfilled by GetLastIndex Now, FindLastIndex returns the highest Passage.Index of the Passages in a Work along with a bool whether it has found one. This is necessary for the first analysis of a work. For example in SortPassages.
func FindTextTokens ¶
FindTextTokens finds the analysis that contains txt tokens
func GetFirstIndex ¶
GetFirstIndex returns the Work.First.Index of given Work along with a bool whether it has found that index.
func GetIndexByID ¶
GetIndexByID searches for an ID in a given work and if found, returns its slice index in the Work.Passages slice (not the passage.Index) along with a bool indicating whether it has found the Passage
func GetLastIndex ¶
GetLastIndex returns the Work.Last.Index of given Work along with a bool whether it has found that index.
func IsExemplarID ¶
IsExemplarID tests whether a CTSURN (string) points to the exemplar level
func IsTextgroupID ¶
IsTextgroupID tests whether a CTSURN (string) points to the textgroup level
func IsVersionID ¶
IsVersionID tests whether a CTSURN (string) points to the version level
func RReturnSubStr ¶
RReturnSubStr returns the substring identified by the reverse of @substr[n]. [n] is optional.
func ReturnSubStr ¶
ReturnSubStr returns the substring identified by @substr[n]. [n] is optional.
func WantSubstr ¶
WantSubstr tests whether the passage part of a URN string refers to a substring
Types ¶
type ArrayToken ¶
type ArrayToken struct {
Type string
CharRepres []string
IntRepres []int
BoolRepres []bool
FloatRepres []float64
}
ArrayToken is a container for tokens represented in an array.
type CTSURN ¶
CTSURN references text as explained in http://cite-architecture.org/ctsurn/ For a note on CTS citations see http://cite-architecture.github.io/cts_spec/
type Cite2Urn ¶
Cite2Urn implemented as outlined here http://cite-architecture.org/cite2urn/
type CiteVerb ¶
type CiteVerb struct {
ID, Summary, Subject, Object, InverseID string
}
CiteVerb implemented similar to https://github.com/cite-architecture/cite-verbs/blob/master/cite-collection/cite-verbs-data-draft.csv
type PassLoc ¶
PassLoc is a container for the ID and the Index of a Passage for First, Last, Prev, Next
type Passage ¶
type Passage struct {
PassageID string
Range bool
Analysis []Tokenisation
Index int
Prev, Next PassLoc
ImageLinks []Triple
}
Passage is the smallest CTSNode
func GetFirst ¶
GetFirst returns the Passage that is the first in the passage slice in a given a Work (not the one saved as Work.First)
func GetLast ¶
GetLast returns the Passage with the last index in the passage slice in a given a Work (not the one saved as Work.Last)
func GetNext ¶
GetNext returns the Passage after the Passage given the PassageID in given Work (not the next in the work.Passages slice)
func GetPassageByID ¶
GetPassageByID returns a Passage given the PassageID in a given Work
func GetPassageByInd ¶
GetPassageByInd returns the Passage at given Index in the Work.Passages slice (Not by Passage.Index)
type TextAndID ¶
type TextAndID struct {
ID, Text string
}
TextAndID is a container for a text-extract and its ID
type Tokenisation ¶
type Tokenisation struct {
ID string
Description string
DataStructure string
Array ArrayToken
}
Tokenisation is a container for different tokenisations of the same textual information
type Triple ¶
type Triple struct {
Subject, Verb, Object string
}
Triple is a Simple LinkedData-Triple implementation
type Work ¶
Work is a container for CTS passages that belong to the same work
func DelFirstPassage ¶
DelFirstPassage deletes the first Passage from a Work by changing the references
func DelLastPassage ¶
DelLastPassage deletes the last Passage from a Work by changing the references
func DelPassage ¶
DelPassage deletes a Passage from a Work by changing the references
func InsertPassage ¶
InsertPassage inserts a Passage into a Work
func SortPassages ¶
SortPassages sorts the Passages in the Work.Passages slice from First to Last according to their Passage.Index values empty Passages are not taken over