|BuildTools a0a5aa1de3||11 months ago|
|__pycache__||11 months ago|
|Makefile||11 months ago|
|README.md||11 months ago|
|compile.js||11 months ago|
|datamaker.js||11 months ago|
|main.py||11 months ago|
|server.py||11 months ago|
This Python program + Flask API to take multiple words, and search them in the bible. It can be used with or without the HTTP server part.
To compile Bible data, run:
wget http://api.heb12.com/translations/json/en/jubl2000.json node compile.js ./jubl2000.json data/jubl2000
To run the Python server, run:
python3 server.py data/jubl2000
BibleSearch is a Bible search engine optimized for speed rather than portability. It weights about 10-20MB when all the files are generated.
In a nutshell, there are 2 main files. The
words file, and the
Both are sorted the exact same, and are of the same length.
words file is searched. Since searching a 12k line file can be a
bit slow, there are 2 optimizations that help Biblesearch run fast.
The files are sorted alphabetically, but only by the first character. In
alphabet.json file, it shows where each character (a-z) starts at.
This prevents it from reading unnecessary lines.
Each section (words that start with the same letter), are sorted by
popularity (occurrence). This can be viewed in the
verses file, as
the lines start out large, then get smaller and smaller, then large again.
If the word is matched, then the corresponding line in the verses file is grabbed. Each line in the verses file is a JSON array, but it is not JSON altogether.
If the request is only one word, then the read JSON will be returned. If longer than one, then the process starts over again, but instead of returning, it uses a Python function to find matches in both arrays.
Copyright (C) 2020 Daniel C
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.