bibleref

package
v0.0.0-...-d770312 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 10 Imported by: 0

README

Acknowledgements

Data for book aliases, chapter and verse counts copied from https://github.com/jpoehls/bible-metadata .

Documentation

Index

Constants

View Source
const (
	NumBooks = 66
)

Variables

View Source
var BookAliases []BookAlias
View Source
var BookAliasesRaw []byte

BookInfo contains information about the Bible Verses. Slices are zero-indexed, so book and chapter numbers must be adjusted downwards.

View Source
var ChaptersRaw []byte
View Source
var MissingVerses = []WordRef{
	{Book: sblgnt.Matthew, Chapter: 17, Verse: 21},
	{Book: sblgnt.Matthew, Chapter: 18, Verse: 11},
	{Book: sblgnt.Matthew, Chapter: 23, Verse: 14},
	{Book: sblgnt.Mark, Chapter: 7, Verse: 16},
	{Book: sblgnt.Mark, Chapter: 9, Verse: 44},
	{Book: sblgnt.Mark, Chapter: 9, Verse: 46},
	{Book: sblgnt.Mark, Chapter: 15, Verse: 28},
	{Book: sblgnt.Luke, Chapter: 17, Verse: 36},
	{Book: sblgnt.Luke, Chapter: 23, Verse: 17},
	{Book: sblgnt.John, Chapter: 5, Verse: 4},
	{Book: sblgnt.Mark, Chapter: 11, Verse: 26},
	{Book: sblgnt.Acts, Chapter: 8, Verse: 37},
	{Book: sblgnt.Acts, Chapter: 15, Verse: 34},
	{Book: sblgnt.Acts, Chapter: 28, Verse: 29},
}

MissingVerses is a list of verse number which are "missing" from modern versions of the Bible due to textual analysis.

Functions

func AfterMissing

func AfterMissing(ref WordRef) bool

AfterMissing will return true if ref is directly after a "missing" verse

func BeforeMissing

func BeforeMissing(ref WordRef) bool

BeforeMissing will return true if ref is directly before a "missing" verse

func BookInfoChapterCount

func BookInfoChapterCount(bn BookNum) int

func BookInfoChapterMaxVerse

func BookInfoChapterMaxVerse(bn BookNum, cn int) int

Types

type BookAlias

type BookAlias struct {
	Num   BookNum
	Alias string
}

type BookInfoStruct

type BookInfoStruct struct {
	ChapterMaxVerse []int
}

type BookNum

type BookNum int

func BookFromString

func BookFromString(s string) BookNum

type ParsedPassage

type ParsedPassage struct {
	Bookname string     `parser:"@Book"`
	Chapter  int        `parser:"Space @ChapterOrVerse"`
	Range    VerseRange `parser:"(ChapterSeparator @@)?"`
}

type Passage

type Passage struct {
	Bookname                      sblgnt.BookName
	Chapter, VerseStart, VerseEnd int
}

func ParsePassage

func ParsePassage(refstring string) (*Passage, error)

type VerseRange

type VerseRange struct {
	VerseStart int `parser:"@ChapterOrVerse"`
	VerseEnd   int `parser:"(RangeMarker @ChapterOrVerse)?"`
}

type WordRange

type WordRange struct {
	Start, End WordRef
}

func (WordRange) Cmp

func (wr WordRange) Cmp(ref commentary.Ref) int

Cmp will compare the range to the given reference, returning 0 if the sentence contains the reference, -x if the sentence is before the reference, and +x if the sentence is after the reference. If the book names don't match, or there is an error parsing the sentence id, it will return -1.

type WordRef

type WordRef struct {
	Book                 sblgnt.BookName
	Chapter, Verse, Word int
}

func (WordRef) IsFollowing

func (a WordRef) IsFollowing(b WordRef) bool

IsFollowing checks if b is plausiably a direct successor of a, with the *numerical values only*. Book name is ignored.

func (WordRef) LessThan

func (a WordRef) LessThan(b WordRef) bool

LessThan compares *numerical values only*; returning whether a < b. Book names are ignored. If at the level of difference either of the values are zero, LessThan always returns 'false'.

Jump to

Keyboard shortcuts

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