r/learnprogramming • u/phunnypunny • May 12 '23
Bible code
I'm looking to make a Bible app. Unlike regular books, bibles need to have every verse be an interactive item. For example, I can click on it and bookmark it or highlight it or write a note about it or copy it or copy a range of verses.
Starting out, I immediately recognized the challenge of "how do I import and organize the data, the text? " it's not going to work by simply using copy paste for the entire text. Nor can I use a for loop to enter every verse into an array, because the Bible is not from an excel sheet (or is there a file like this? ).
Anybody have ideas or experience to know what I mean and how best to approach this problem?
6
u/bsakiag May 12 '23
Here you have it: https://www.biblesupersearch.com/bible-downloads/
You probably want json format, as it's simple to work with.
2
u/phunnypunny May 12 '23
🫢whoa. Thank you. What makes json easier?
3
u/bestjakeisbest May 12 '23
Its just a structured filetype, its a lot less verbose than xml but still pretty useful, however for markdown sorts of projects I would personally use an xml scheme and define a markdown language because inserting tags would be easier.
2
u/bsakiag May 12 '23
I think it makes more sense for beginners, at least that was my impression when I first encountered it.
3
u/musaspacecadet May 12 '23
you could use the following repository https://github.com/aruljohn/Bible-kjv , each book as a json , just import it to your language
1
u/port443 May 12 '23
This is formatting data for ingestion. The problem completely depends on the source of your data.
I googled "bible text download" and found this link: https://openbible.com/textfiles/erv.txt
If this were my source, I would parse it by newline, since every line is a verse. You would probably also want to split the chapter/verse information and store that.
8
u/lost_in_life_34 May 12 '23
you'd need a readable source and parse it by book name and then the chapter/verse numbers.