Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So the entire Qur'an in XML or SQL file? Is that how some Qur'an apps are able to provide offline reading?


Probably so!

Here's a list of electronic text resources for the Christian Bible

https://hackathon.bible/data/

of which (surprisingly to me) many are also APIs rather than downloads. But there are lots of downloads like XML and text files. One that I found of the King James Version translation has lines like

Gen|4|26| And to Seth, to him also there was born a son; and he called his name Enos: then began men to call upon the name of the LORD.~

i.e. book of Genesis, chapter 4, verse 26, followed by an ASCII string of that verse.

The Quran download mentioned in the grandparent comment at

https://tanzil.net/download/

includes text files with lines like

2|150|ﻮَﻤِﻧْ ﺢَﻴْﺛُ ﺥَﺮَﺠْﺗَ ﻑَﻮَﻟِّ ﻮَﺠْﻬَﻛَ ﺶَﻃْﺭَ ﺎﻠْﻤَﺴْﺟِﺩِ ﺎﻠْﺣَﺭَﺎﻣِ ۚ ﻮَﺤَﻴْﺛُ ﻡَﺍ ﻚُﻨﺘُﻣْ ﻑَﻮَﻟُّﻭﺍ ﻮُﺟُﻮﻬَﻜُﻣْ ﺶَﻃْﺮَﻫُ ﻞِﺌَﻟَّﺍ ﻲَﻛُﻮﻧَ ﻞِﻠﻧَّﺎﺳِ ﻊَﻠَﻴْﻜُﻣْ ﺢُﺟَّﺓٌ ﺈِﻟَّﺍ ﺎﻟَّﺬِﻴﻧَ ﻆَﻠَﻣُﻭﺍ ﻢِﻨْﻬُﻣْ ﻒَﻟَﺍ ﺖَﺨْﺷَﻮْﻬُﻣْ ﻭَﺎﺨْﺷَﻮْﻨِﻳ ﻮَﻟِﺄُﺘِﻣَّ ﻦِﻌْﻤَﺘِﻳ ﻊَﻠَﻴْﻜُﻣْ ﻮَﻠَﻌَﻠَّﻜُﻣْ ﺖَﻬْﺗَﺩُﻮﻧَ

i.e. surah 2, ayah 150, followed by a Unicode string of the text of that ayah. (There's no "book" field because of the sufficiency of the surah numbers.) This file is about 1.3 megabytes uncompressed, although of course it doesn't include additional data that a user might want to have presented (the transliterations or translations mentioned elsewhere in this thread, for example).

There are probably lots of mobile apps that have graphics files alone that are larger than this 1.3 megabyte Quran text file. (Not that mobile apps are the only application for the APIs or anything.)

Another online text at

https://www.sacred-texts.com/isl/htq/index.htm

gives each surah in a separate file (less convenient for downloading, although you could still do it in a few minutes!), so that ayah is

150 ‏وَمِنْ حَيْثُ خَرَجْتَ فَوَلِّ وَجْهَكَ شَطْرَ ٱلْمَسْجِدِ ٱلْحَرَامِ ۚ وَحَيْثُ مَا كُنتُمْ فَوَلُّوا۟ وُجُوهَكُمْ شَطْرَهُۥ لِئَلَّا يَكُونَ لِلنَّاسِ عَلَيْكُمْ حُجَّةٌ إِلَّا ٱلَّذِينَ ظَلَمُوا۟ مِنْهُمْ فَلَا تَخْشَوْهُمْ وَٱخْشَوْنِى وَلِأُتِمَّ نِعْمَتِى عَلَيْكُمْ وَلَعَلَّكُمْ تَهْتَدُونَ ‎

There's some kind of Unicode issue where the letters in the second version seem to be connecting better (e.g. مَا rather than ﻡَﺍ), but my knowledge of Arabic isn't enough to make it obvious to me whether the second one is a more correct encoding or the first one is just making more assumptions about the rendering or something.


There are probably lots of mobile apps that have graphics files alone that are larger than this 1.3 megabyte Quran text file.

Heck, sacred-texts.com will sell you a Flash drive with a huge chunk of their collection on it: https://sacred-texts.com/cdshop/dvd90/index.htm

It's all of four gigabytes. Once that was a lot. Now it's nothing. Every holy text from antiquity, in something the size of your thumb.


I have a bit of minor frustration with how many different XML formats there are for scripture. We have OSIS and USX/USFX, both supposedly universal but really just used for the Bible and Torah.

I cannot access the tanzil XML file right now due to MobileSafari layout issues (boo). https://github.com/ceefour/qurandatabase has its own consistent DTD, but I doubt this is the only format I will find.


Thank you for the technical explanation. I appreciate it. I have been curious about the Qur'an apps for some time. You gave me a better understanding.


I hope my question isn't seen as rude, but have you worked on a non-web app before? Its been the natural thing to bundle all data needed offline and locally along with the app throughout history. I emphasize I don't mean to sound rude, your question just felt surprising to me. (It seems you are been downvoted and I gave you an up personally.)


No offence taken and I appreciate the upvote. I am a macOS/iOS developer. I expected the Qur'an to be bundled with the app but I wondered about the technical nature. How it is actually done? It could be a database file or a text file etc. There are many ways to accomplish this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: