vulgata

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: MIT Imports: 11 Imported by: 0

README

GoDoc Build Status Go Report Card codecov

vulgata

Golang library containing the entire Holy Bible with both the Douay-Rheims English and Clementina Vulgata Latin texts.

Documentation here: https://godoc.org/github.com/borderstech/vulgata

Example Usage

// Create a new bible instance
b := vulgata.NewBible()

// Get all book names for the old testament
names := b.OldTestament.GetBookNames()

// Get book 1 from the old testament
book, err := b.OldTestament.GetBook(1)
fmt.Print(book.Title) // title of book

// Get book 1, chapter 1 from the old testament
chap, err := b.OldTestament.GetChapter(1, 1)

// Get book 4, chapter 8, verse 32 from the new testament
vers, err := b.NewTestament.GetVerse(4, 8, 32)
fmt.Print(vers.Text) // English
fmt.Print(vers.TextLatin) // Latin

// Search for verses
v := b.Search("truth make you free", 10) // max of 10 results
fmt.Print(v[0].Book.Title)
fmt.Print(v[0].Chapter.ChapterNumber)
fmt.Print(v[0].Verse.Text)
fmt.Print(v[0].String()) // John 8:32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bible

type Bible struct {
	OldTestament Testament
	NewTestament Testament
	// contains filtered or unexported fields
}

Bible contains the old testament and new testament

func NewBible

func NewBible() *Bible

NewBible creates a new bible instance

func (*Bible) Search added in v0.2.0

func (b *Bible) Search(query string, maxResults int) []SearchNode

Search finds top matching verses based on the given query. The number of search results are restricted by maxResults

type Book

type Book struct {
	Title      string    `json:"title"`
	BookNumber uint8     `json:"bookNumber"`
	Chapters   []Chapter `json:"Chapters"`
}

Book represents a single book in a testament of the bible

type Chapter

type Chapter struct {
	ChapterNumber uint8   `json:"chapterNumber"`
	Verses        []Verse `json:"verses"`
}

Chapter represents a single chapter in a book of the bible

type SearchNode added in v0.2.0

type SearchNode struct {
	Book    *Book
	Chapter *Chapter
	Verse   *Verse
}

func (*SearchNode) String added in v0.2.0

func (s *SearchNode) String() string

String creates a string representation for the SearchNode, ex. Genesis 1:1

type Testament

type Testament struct {
	Books []Book
}

Testament consists of a list of books, old vs. new

func (*Testament) GetBook

func (t *Testament) GetBook(bookNumber int) (*Book, error)

GetBook obtains a book within the testament by its number

func (*Testament) GetBookNames

func (t *Testament) GetBookNames() []string

GetBookNames creates a list of all book titles for the testament

func (*Testament) GetChapter

func (t *Testament) GetChapter(bookNumber int, chapterNumber int) (*Chapter, error)

GetChapter obtains a chapter within the provided book by its number

func (*Testament) GetVerse

func (t *Testament) GetVerse(bookNumber int, chapterNumber int, verseNumber int) (*Verse, error)

GetVerse obtains a verse within the provided book/chapter by its number

type Verse

type Verse struct {
	VerseNumber uint8  `json:"verseNumber"`
	Text        string `json:"text"`
	TextLatin   string `json:"textLatin"`
}

Verse represents a single verse in a chapter of the bible, with both English and Latin texts

Jump to

Keyboard shortcuts

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