mirror of
https://github.com/thisago/bibleTools
synced 2026-01-14 21:11:38 +00:00
No description
| src | ||
| tests | ||
| .gitignore | ||
| bibleTools.nimble | ||
| changelog.md | ||
| config.nims | ||
| license | ||
| readme.md | ||
Examples
For more examples, please see the tests
Identify books
doAssert "second bar".identifyBibleBookEn == Baruk2
doAssert "ex".identifyBibleBookEn == Exodus
doAssert "Jo".identifyBibleBookPt == John
Smart book identification
doAssert "second bar".identifyBibleBook == (Baruk2, ALEnglish)
doAssert "tg".identifyBibleBook == (James, ALPortuguese)
doAssert "1ts".identifyBibleBook == (book: Thessalonians1, lang: ALPortuguese)
Parse verse
doAssert "Mt 5:17-20".parseBibleVerse == BibleVerse(
book: AnyLangBook (Matthew, ALPortuguese),
chapter: 5,
verses: @[17, 18, 19, 20],
translation: "",
error: false
)
Parse multiple verses
from pkg/bibleTools import ALPortuguese, ALEnglish
let found = "Gen 1:1; exod 2:2; Lv 3:3".parseBibleVerses
doAssert found[2].parsed.book.lang == ALPortuguese
doAssert found[0].parsed.book.lang == ALEnglish
doAssert $found[1].parsed == "Exo 2:2"
doAssert found[1].raw == "exod 2:2"
Stringify verse
doAssert $BibleVerse(
book: (Proverbs, ALPortuguese),
chapter: 29,
verses: @[27],
translation: "",
error: false
) == "Pv 29:27"
To Ozzuu Bible URL
doAssert "Revelation 14:12".parseBibleVerse.inOzzuuBible("en_wyc2014") ==
"https://bible.ozzuu.com/en_wyc2014/Rev/14#12"
More examples!
Please see the tests files to see more examples!
TODO
- Add documentation
- [-] Add missing hebrew book names
- Add hebrew transliteration book identification
- Add a function to get the short version of a book
License
MIT