getbible / Unbound-Biola

Please do not use, Since some of the Scripture Text has errors!!! USE https://github.com/getbible/v2 instead.
Other
59 stars 22 forks source link

Bible versions #4

Closed ChristianMercyMinistry closed 8 years ago

ChristianMercyMinistry commented 8 years ago

Greetings,

First, thank you for creating the Get Bible application. It is a wonderful way to share the light of God's love into dark places.

I noticed that there are many versions of the Bible on the The Unbound Bible website that are not included in what is available for use in you application. I was wondering if you might have a piece of software to convert these into the correct format for use with your system that is available?

May God prosper you and give great success to your endeavors.

Thank you,

Stephen Wray Christian Mercy Ministry

Llewellynvdm commented 8 years ago

Hi, Stephen

Praise God! This application is due a major upgrade... I mean I wrote it long ago and have since then found so many better ways to do things. It is just that I am not getting around to do it.

I have been using notepad and string replacement tricks combined with some PHP scripts where needed to get all those already available setup, but it takes like 20min to 40min per translation and with some two hours depending on the language encoding.

A good starting point would be to watch this video https://getbible.net/main-component?tab=3 download the files from Unbound Bible and see what needs to be done to match the required format explained.

Hey if you would like to help convert all the remaining Bibles to work on getBible let me know I could sure use the help.

Do you know any programming?

ChristianMercyMinistry commented 8 years ago

Hi Llewellynvdm,

Sorry to have not gotten back to you sooner. Things have been crazy in every domain. This is probably an indication that the adversary does not want this work to occur. Which tells me that I need to redouble my efforts.

I do know some programming, at least a little bit. Currently my time is a little bit limited due to having a long commute to and from work. After July 1st I am moving to a new place that the Lord has blessed me with that changes my 1.5+ hour commute each way into a 15 minute commute. Then I will see if I can use my rusty programming skills to create a little formatting algorithm to ease the process of converting various formats to work with Get Bible.

What are your plans regarding an update?

Thanks you,

Stephen Wray Christian Mercy Ministry.

Llewellynvdm commented 8 years ago

Hi Stephen

Thanks for the feedback. I am working on building the whole getBible component inside component builder that is a rapid component builder tool I've developed to speedup the development of component for Joomla. I am working on many projects and honestly can't give any time frame as to when it will be ready.

But I can tell you that once this has been done, the further development of getBible will enter a whole new dynamic arena were we may see extrema expansion beyond what is humanly possible. We are already seeing this happening to other projects that was build inside of component builder like Sermon Distributor

What I know is most desirable is that the data storage and therefore the API of getBible remains unchanged even in the newer versions in production. We will just see added features emerge like an HTML front-end that gives each chapter its own URL that will allow for better SEO on the entire scripture.

There is much being planed, so lets keep this in prayer before the Lord as only if He builds this house is it worth building.

tushortz commented 8 years ago

Hello. It gives me joy to come across your github page seeing that there are people who strive to make the bible available in different versions and languages. I would be honoured to help if needed.

I am not bad using Python if my skills is needed maybe to write simple scripts or anything that can make life easy. I made a sample bible project using django. Feel free to check it out at https://study-bible.herokuapp.com

Llewellynvdm commented 8 years ago

Wonderful, sure you can help...

If you look at the versions here you would see that they have a convention or format in which they are stored inside of the text file

Genesis||1||1||In the beginning God created the heaven and the earth.
Genesis||1||2||And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
Genesis||1||3||And God said, Let there be light: and there was light.
Genesis||1||4||And God saw the light, that it was good: and God divided the light from the darkness.
Genesis||1||5||And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
Genesis||1||6||And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.
Genesis||1||7||And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.
Genesis||1||8||And God called the firmament Heaven. And the evening and the morning were the second day.
Genesis||1||9||And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so.
Genesis||1||10||And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.
Genesis||1||11||And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so.
Genesis||1||12||And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good.

OR

01O||1||1||In die begin het God die hemel en die aarde geskape.
01O||1||2||En die aarde was woes en leeg, en duisternis was op die wêreldvloed, en die Gees van God het gesweef op die waters.
01O||1||3||En God het gesê: Laat daar lig wees! En daar was lig.
01O||1||4||Toe sien God dat die lig goed was. En God het skeiding gemaak tussen die lig en die duisternis;
01O||1||5||en God het die lig dag genoem, en die duisternis het Hy nag genoem. En dit was aand en dit was môre, die eerste dag.
01O||1||6||En God het gesê: Laat daar 'n uitspansel wees tussen die waters, en laat dit skeiding maak tussen waters en waters.
01O||1||7||God het toe die uitspansel gemaak en die waters wat onder die uitspansel is, geskei van die waters wat bo die uitspansel is. En dit was so.
01O||1||8||En God het die uitspansel hemel genoem. En dit was aand en dit was môre, die tweede dag.
01O||1||9||En God het gesê: Laat die waters onder die hemel hulle op een plek versamel, sodat die droë grond sigbaar word. En dit was so.
01O||1||10||En God het die droë grond aarde genoem, en die versameling van die waters het Hy see genoem. Toe sien God dat dit goed was.
01O||1||11||En God het gesê: Laat die aarde voortbring grasspruitjies, plante wat saad gee en bome wat, volgens hulle soorte, vrugte dra, waarin hulle saad is, op die aarde. En dit was so.
01O||1||12||Die aarde het voortgebring grasspruitjies, plante wat saad gee volgens hulle soorte en bome wat vrugte dra, waarin hulle saad is, volgens hulle soorte. Toe sien God dat dit goed was.

The last option seems the most convenient I suppose, each book has a number from 01O to 66N and two pipes are used between as follow book||chapter||verse||holytext

If you would like to add more translations to this repo that follow the same conventions it would be great :)

Please fork this repo, then add the new translation (must be public domain or permission given to add it here) and then make a pull request.

There is a few other things to keep in mind.

Naming convention of each file are as follow:

English__King_James_Version__kjv__LTR.txt

All separated by two underscores.

Let me know if you have any more questions, or if there is something else you would rather help with...

We are mostly working in PHP and JavaScript in the main component, but these txt files can be used in any project.

Here is a quick link to the import method that uses these files in the component https://github.com/getbible/Joomla-3-Component/blob/master/admin/models/import.php#L148

I am working on a major improvement on this component since I build it during the years I was just starting out as a developer. So I am sure there are much better ways to do this. But it is php that runs in Joomla as a component.

Would be grate if we could port it to Python to run in Django. let me know if you are up for the challenge... I mean I see you already have a working concept in Django but to have an API that gives json is really what getBible is doing.

We are only now thinking of doing more HTML driven responding views, so each chapter with have its own url in a Joomla website.

Well looking forward to hear back from you :)

tushortz commented 8 years ago

@Llewellynvdm

I will get started with writing a python script that converts the text files to JSON and see if I can write a script that can reverse the JSON to the original text.

Perhaps in the near future, if I have time, I would try port it to django.

I've got a question, Should I make another folder in these repository so that the script is separated from the text files

Llewellynvdm commented 8 years ago

Yes, please don't add code here, this repo must only have the actual Bible-text.

To add script/code that build the text or any other script I think you can dump a gist as a link here, but don't add it to this repo.

This is only the Holy text, so as you can see all the other projects are on their own repos... under https://github.com/getbible I would like to see the code so if you are willing to share it let me know and we can see what is possible :+1: we can even add it to getBible if all agree.

tushortz commented 8 years ago

Alright thanks. Will get back to you when it's done

On Sunday, 10 July 2016, Llewellyn notifications@github.com wrote:

Yes, please don't add code here, this repo must only have the actual Bible-text.

To add script/code that build the text or any other script I think you can dump a gist as a link here, but don't add it to this repo.

This is only the Holy text, so as you can see all the other projects are on their own repos... under https://github.com/getbible I would like to see the code so if you are willing to share it let me know and we can see what is possible 👍 we can even add it to getBible if all agree.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/getbible/Bibles/issues/4#issuecomment-231583317, or mute the thread https://github.com/notifications/unsubscribe/AMjJEPdzF9qiBSgHAwUo1P-4W1aO_Z0tks5qUNKEgaJpZM4IuATx .

Llewellynvdm commented 8 years ago

Please email me at llewellyn@vdm.io there is another subject I would like to share with you.

tushortz commented 8 years ago

I tried writing the script but I don't think there is a point doing so because the script runtime was very slow (although not finished) and you already have a working concept on the website.

But I notice that the json format in your website isn't valid. If you can change the beginning ( to [ and the ending ); to ]. That should make it valid @Llewellynvdm

Llewellynvdm commented 8 years ago

That is not an error. But a javascript way of passing the json. I could add a switch to the URL call to change that for those not coming from Javascript.

tushortz commented 8 years ago

Oh I get you now.

On 16 Jul 2016 8:14 a.m., "Llewellyn" notifications@github.com wrote:

That is not an error. But a javascript way of passing the json. I could add a switch to the URL call to change that for those not coming from Javascript.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/getbible/Bibles/issues/4#issuecomment-233116333, or mute the thread https://github.com/notifications/unsubscribe-auth/AMjJEA2Wt0L_y9LfhIX07ql9nTnLHPlCks5qWITegaJpZM4IuATx .

camilstaps commented 8 years ago

I've been watching this conversation for some time. I don't see why a python script that converts the txt to json should be slow. The following runs in 0.25s on one bible version:

#!/usr/bin/env python3
import json
import sys

class Verse:
    def __init__(self, book, chap, vers, text):
        self.book = self.find_book(book)
        self.chap = int(chap)
        self.vers = int(vers)
        self.text = text

    def find_book(self, book):
        # TODO
        return book

    def to_json(self):
        return json.dumps({
                'book': self.book,
                'chap': self.chap,
                'vers': self.vers,
                'text': self.text,
            })

def convert(ffrom, fto):
    with open(ffrom, 'r') as ffrom:
        with open(fto, 'w') as fto:
            for line in ffrom:
                line = line.split('||')
                verse = Verse(*line)
                fto.write(verse.to_json() + '\n')

def main():
    args = sys.argv
    if len(args) < 2:
        print('Usage: %s <from> [<to>]' % (args[0]))
        sys.exit(-1)
    ffrom = args[1]
    fto = ffrom + '.json' if len(args) < 3 else args[2]

    convert(ffrom, fto)

if __name__ == '__main__':
    main()

Looking up books hasn't been implemented as you can see, but that shouldn't change much. Feel free to use this if you're interested.

tushortz commented 8 years ago

@camilstaps oh that's cool. I was doing it a different way. In the format at https://getbible.net/json?p=James.2:1 taking into consideration the filename. See if you have a quicker method as your code looks better

camilstaps commented 8 years ago

@tushortz one file per verse would mean rewriting convert. I have made this a gist to make versioning easier: https://gist.github.com/camilstaps/74cbe2a0d532e69d04a7a788ac8e945b

It runs a bit slower (2s), because we need to open and close many file descriptors.

Llewellynvdm commented 8 years ago

I wonder if we all got a little of topic here :)

This is why the topic started: there has been many request to add more versions to this repository, in the same TEXT format as those already in the repo.

So the idea was to get a script the will build the TXT documents, so that we can grow this archive of translations.

We get them in many ways from various places. Mostly from Unbound Bible So @camilstaps if you could help build a script that will take all the available translations on unbound Bible into the format described above that would be great :+1:

Don't get me wrong your script is welcome and awesome, but I would still like to actually have the issue focus on getting more versions/translations....

Llewellynvdm commented 8 years ago

I initially did most if it with a search replace in notepad... very basic, and slow. Since it takes about an half and hour to do one translation. I know we could do it much faster with some scripting. I know BASH, but have not had the time to actually write something up... That is when @ChristianMercyMinistry said he will help and try to come up with an answer to the problem.

Llewellynvdm commented 8 years ago

Well it seems like working directly from the TXT to the json could be a faster way then the DB option. That is essentially what with the get_bible component does, it installs the TXT into a DB as json and then serves it back via a URL/WEBSITE on demand...

Llewellynvdm commented 8 years ago

@camilstaps you can fork this repo https://github.com/getbible/txtFactory

Looking forward to what will come from this, Lets move our chat on the processes to that repository.

ChristianMercyMinistry commented 8 years ago

This is all very cool to watch. I have been involved in movong my home and am still settling in. Once settled I will dig into this more. I am really looking forward to being able to add new versions of the Bible to my website. Thank you all for working on this.

On 2016-07-18 15:14, Llewellyn wrote:

@camilstaps [1] you can fork this repo https://github.com/getbible/txtFactory

Looking forward to what will come from this, Lets move our chat on the processes to that repository.

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

*

Links:

[1] https://github.com/camilstaps [2] https://github.com/getbible/Bibles/issues/4#issuecomment-233428840 [3] https://github.com/notifications/unsubscribe-auth/AS00COvMdk6xnTFQNab4jEN2df3AD_9Eks5qW9CNgaJpZM4IuATx

Llewellynvdm commented 8 years ago

Well @ChristianMercyMinistry we have a work in progress at https://github.com/getbible/txtFactory that will result in adding all Unbound Bibles to this repo, and in turn to getBible.

@camilstaps was so helpful to add the initial required converter... I can see there is still some more work to do... but we have a script in the making.

I am also very exited about this....

Llewellynvdm commented 8 years ago

@ChristianMercyMinistry praise the Lord we now have more then a 104 translations, almost 80 more has been added.

ChristianMercyMinistry commented 7 years ago

Thank you so much, I will download them all and upload them to my site, http://christianmercyministry.org/

Llewellynvdm commented 7 years ago

@ChristianMercyMinistry please note that you can install them via the getBible backend directly from the standard list :)

ChristianMercyMinistry commented 7 years ago

Thank you, yes I am aware of this but I have found that it works more quickly when I download them and host them on my VPS which has a very fast connection to one of the main fiber backbones. Have you checked out our site at http://christianmercyministry.org/ yet? Please let me know what you like and dislike about it. I am always open to suggestions. We are getting a decent amount of traffic to the site.

Stephen

On 2016-07-29 05:53, Llewellyn wrote:

@ChristianMercyMinistry [1] please note that you can install them via the getBible backend directly from the standard list :)

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

*

Links:

[1] https://github.com/ChristianMercyMinistry [2] https://github.com/getbible/Bibles/issues/4#issuecomment-236141000 [3] https://github.com/notifications/unsubscribe-auth/AS00CL1lp9x4JJ-P32YxdsJThA9R94Axks5qac1-gaJpZM4IuATx