Giter Club home page Giter Club logo

lzbible's Introduction

[LZBible] - LZW compressed JSON Bible

What is LZBible

LZBible is a javascript library to partially load compressed JSON bible chapter to the client browser for further processing, without the need to rely on server-side processing. The compressed data is between 1-10Kb, allowing fast loading for further usage and ideal to be cached for CDN.

LZBible is relying on the following liraries

LZ-String
JQuery
CDNJS

LZBible is suitable for

  • javscript bible app
  • mobile application

Bible data is converted from the following source:

bibledatabase.org

Contribution

The tools section contains small apps written in C# to convert csv into json. The program is written to extract bibledatabase.org csv bibles stored as submodule from bibledatabasecsv.

  • Add new bible.csv into the db folder, following the same csv format
  • Modify the language/SysDefs/bibles_index.csv with new bible entry
  • Add books_language.txt following the same format
  • Run the program which will generate the files
  • Test the sample app that the bibles are loading
  • Create separate pull request in bibledatabasecsv and in LzBible
    Check the readme inside the tools

Examples

Inclused LzBible.js and required scripts

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.min.js"></script>
<script type="text/javascript" src="../js/lzbible.js"></script>

Init LzBible - when url is not added it uses local /db/

var bibles = await LzBible.Init('http://lzbible/db/');

Get books

var books = await LzBible.GetBooks(bibles[0]);

Get array of chapters for given book idx 0..65

var chapters = LzBible.GetChapters(0..65);

Get passages/verse array with non-zero idx (starts from 1)

var verses = await LzBible.GetPassages(bookIdx, chapterIdx);
var verses = await LzBible.GetPassages(1, 1); // genesis, ch 1

Sample Bible App using Vue JS + Open Spritz Reader

View Here

[BZip2 Bible] - BZip2 compressed JSON Bible

Json compressed in Two Dimentional Array of Book e.g. Gen [ChapterVerses[]]
The file size is ranging 1kb to 56Kb totalling around 1Mb per bible.
(more loading time as oposed to LzwBibles)

The Bz2 files is good for powerful device to decompress bzip2, or for apps to rebuild the database. The files are compressed using SharpZipLib Decompression can be done using Javascript bzip2-js

Sample can be found in sample1

TODO

  • convert more bibles and update copyrights
  • more test cases
  • better documentation
  • Book index translation
  • improve reporisoty speed, as files start accumulating?
  • Clean up bible data

lzbible's People

Contributors

edwinyosorahardjo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.