A python parser to parse bible verse references from a text.
This was originally created to tag resources for building https://marvel.bible.
The script is now modified for general use.
This script is now adapted to become a core utility in UniqueBible.app project.
- Search for verse references from text file(s)
- Add taggings on verse references
- Support books of bible canon and apocrypha
- Support tagging on chains of refernces, e.g. Rom 1:2, 3, 5, 8; 9:2, 10
- Support books of one chapter only, like Obadiah 2, Jude 3, 3John 4, etc.
- Support chapter references [references without verse number specified], e.g. Gen 1, 3-4; 8, 9-10.
- Support standardisation of book abbreviations and verse reference format.
- Support parsing multiple files in one go.
- Support extracting all references in a text. (This feature is especially useful for bulding indexes.)
- Support tagging on range(s) of verses
BibleVerseParser.py [written with python version 3.6+]
Use "BibleVerseParser.py" together with "BibleBooks.py" & "RegexSearch.py" in the same directory.
Tag a file, where [file] is the filename:
python3 BibleVerseParser.py [file]
Tag all files in a folder, where [folder] is the folder name:
python3 BibleVerseParser.py [folder]
Interactive Mode:
python3 BibleVerseParser.py
e.g. John 3:16 is tagged as <ref onclick="bcv(43,3,16)">John 3:16</ref>
e.g. John 3:14-16 is tagged as <ref onclick="bcv(43,3,14,3,16)">John 3:14-16</ref>
e.g. John 3:14-4:3 is tagged as <ref onclick="bcv(43,3,14,4,3)">John 3:14-4:3</ref>
Prompting question (1) "Enter a file / folder name here: "
Enter the name of a file, which you want to parse.
OR
Enter the name of a directory containing files, which you want you parse.
Prompting question (2) "Do you want to standardise the format of all bible verse references? [YES/NO] "
Enter YES if you want to standardise all verse references with SBL-style-abbreviations and common format like Gen 2:4; Deut 6:4, etc.
Any answers other than "YES" [case-insensitive] skip the standarisation.
This bible-verse-parser is available in Dart programming language.
https://github.com/eliranwong/DartBible/blob/master/lib/BibleParser.dart
Copy files "bible-verse-parser.py" and "dictionary-for-testing.txt" and put in the same folder
(Remarks: "dictionary-for-testing.txt" is the Mounce Concise Greek-English Dictionary in plain text format)
(bible-verse-parser.py is used here to add taggings for bible verse references.)
Enter command in terminal: python bible-verse-parser.py
"Enter a file / folder name here: " dictionary-for-testing.txt
"Do you want to standardise the format of all bible verse references? [YES/NO] " YES
You can find the output file in the same folder named as "output_dictionary-for-testing.txt"
Source: https://github.com/billmounce/dictionary/blob/master/dictionary.txt
Attribution:
Mounce Concise Greek-English Dictionary
Copyright 1993 All Rights Reserved
www.teknia.com/greek-dictionary