osis

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package osis loads and parses OSIS works

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookInfo

type BookInfo struct {
	ID               string
	Num              int
	Chapters         int
	VersesPerChapter []int
}

A BookInfo contains information about a book in an OSIS work

type Osis

type Osis struct {
	XMLName  xml.Name `xml:"osis"`
	OsisText osisText `xml:"osisText"`
}

Osis contains all of the XML data in an OSIS work

func Load

func Load(filename string) (*Osis, error)

Load loads the OSIS data from a file specified by filepath

func (*Osis) BooksInfo

func (osisData *Osis) BooksInfo() ([]BookInfo, error)

BooksInfo gets information about the books available in a certain OSIS work

func (*Osis) Check

func (osisData *Osis) Check(ref Reference) error

Check verifies that a Reference actually exists in an OSIS work

func (*Osis) GetBookInfo

func (osisData *Osis) GetBookInfo(id string) (BookInfo, error)

GetBookInfo returns the BookInfo for a specific book

func (*Osis) GetVerses

func (osisData *Osis) GetVerses(ref Reference) ([]string, error)

GetVerses puts verses together based on the reference

func (*Osis) Info

func (osisData *Osis) Info() *Work

Info returns the Work information about a Bible version

type Reference

type Reference struct {
	ID      string
	Chapter int
	From    int
	To      int
}

Reference contains basic information for a Bible reference

type Work

type Work struct {
	XMLName     xml.Name `xml:"work"`
	Title       string   `xml:"title"`
	Contributor string   `xml:"contributor"`
	Subject     string   `xml:"subject"`
	Date        string   `xml:"date"`
	Description string   `xml:"description"`
	Publisher   string   `xml:"publisher"`
	Type        string   `xml:"type"`
	Identifier  string   `xml:"identifier"`
	Source      string   `xml:"source"`
	Language    string   `xml:"language"`
	Coverage    string   `xml:"coverage"`
	Rights      string   `xml:"rights"`
}

Work contains information about a specific work

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL