A Go module for parsing Bible references
go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Josias c06e0ec7a6 Remove comma from separators for now 1 year ago
COPYING Add program 1 year ago
COPYING.LESSER Add program 1 year ago
README.md Return valid output when just given book name 1 year ago
books.go Accidentally edited books.go filename 1 year ago
bref.go Remove comma from separators for now 1 year ago
bref_test.go Fix new test 1 year ago
go.mod Remove heb12/heb12 from deps 1 year ago
go.sum Make Whole chapter work 1 year ago
info.go Fix problems caused by dependence on JSON 1 year ago

README.md

bref

An advanced Bible reference parser with first class multi-language support written in Go.

Inspired by chapter-and-verse.

Features

  • First class support for parsing references in other languages
  • Simplicity and division into different functions
  • Good information about each book

Example

package main

import "code.heb12.com/heb12/bref"

func main() {
	reference := "John 3:16"
	referenceData, _ := bref.Process(reference)
}

Supported references:

  • Hebrews 4:12 (Book Chapter:Verse)
  • John 3:16-17 (Book Chapter:Start-End)
  • Hebrews 3 (Book Chapter)

For the most part bref doesn’t care what separators you use to separate between the book, chapter, and verses. So these are also valid:

  • Hebrews.4.2.3
  • Hebrews 4 2 3
  • John+3
  • John:4+2_16
  • John (provides information about the book itself)

Users make typos or may just enter a reference in an awkward way. bref can handle this.

Todo

  • Search function (for searching different bookInfo fields and returning the matching books)
  • More language names (and find a better way to store them)
  • Possibly support non-linear Bible references. E.g. “John 3:16,18
  • Improve testing to cover more cases and other functions

Contributing

The biggest way to contribute is to add more languages. Add the books of the Bible in a language to the books.go file. Here are some things to keep in mind:

  • Only alts different than the English alts should be added
  • If there are no alts for a particular book, leave it as []string{}

License

Copyright (C) 2020 Josias Allestad justjosias@tutanota.com and contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

See COPYING.LESSER for more license information.

The JSON files are licensed under the ISC license, as found in chapter-and-verse.