Open GibreelAbdullah opened 1 year ago
Just to add, I have a local DB which contains all the additional data as seen in the API. If this make sense I can work on this.
Yeah, my goal was to create an API similar to yours. Was about to add the English translations today but stumbled upon your repo.
Since you are already ahead in your work, I would rather contribute here than reinvent the wheel.
InShaAllah i will upload the DB file in some time.
https://github.com/GibreelAbdullah/HadithDBToFirestore/blob/master/hadith.zip
hadith.db file - A sqlite database file. Zipped because file size was too big.
Overview of tables -
Rest all tables are auto generated by sqlite to enable FullTextSearch
Assalamualekum,
In the Database/originals folder there are a lot file with "scrapped" postfix in the name of the txt files. What are they used for?
Also there are a couple of translations for urdu for example urduabudawud and urd-abudawud which are almost identical. Kindly let me know their purpose.
You can ignore that folder, the main files are at database/linebyline folder.
Database/original
is used to store backup of original files(i.e the original text file before importing data)
Hi, We can partition the hadith text with a zero width space character. (https://www.compart.com/en/unicode/U+200B)
This way the current api can be updated without any breaking or visible changes. But for those who need it, they can partition the hadith into pre-text, text and post-text.
For example.
حَدَّثَنَا آدَمُ بْنُ أَبِي إِيَاسٍ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي السَّفَرِ، وَإِسْمَاعِيلَ، عَنِ الشَّعْبِيِّ، عَنْ عَبْدِ اللَّهِ بْنِ عَمْرٍو ـ رضى الله عنهما ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " الْمُسْلِمُ مَنْ سَلِمَ الْمُسْلِمُونَ مِنْ لِسَانِهِ وَيَدِهِ، وَالْمُهَاجِرُ مَنْ هَجَرَ مَا نَهَى اللَّهُ عَنْهُ ". قَالَ أَبُو عَبْدِ اللَّهِ وَقَالَ أَبُو مُعَاوِيَةَ حَدَّثَنَا دَاوُدُ عَنْ عَامِرٍ قَالَ سَمِعْتُ عَبْدَ اللَّهِ عَنِ النَّبِيِّ صلى الله عليه وسلم. وَقَالَ عَبْدُ الأَعْلَى عَنْ دَاوُدَ عَنْ عَامِرٍ عَنْ عَبْدِ اللَّهِ عَنِ النَّبِيِّ صلى الله عليه وسلم.
This will become.
حَدَّثَنَا آدَمُ بْنُ أَبِي إِيَاسٍ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي السَّفَرِ، وَإِسْمَاعِيلَ، عَنِ الشَّعْبِيِّ، عَنْ عَبْدِ اللَّهِ بْنِ عَمْرٍو ـ رضى الله عنهما ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ [ZERO WIDTH CHARACTER HERE]" الْمُسْلِمُ مَنْ سَلِمَ الْمُسْلِمُونَ مِنْ لِسَانِهِ وَيَدِهِ، وَالْمُهَاجِرُ مَنْ هَجَرَ مَا نَهَى اللَّهُ عَنْهُ " [ZERO WIDTH CHARACTER HERE]. قَالَ أَبُو عَبْدِ اللَّهِ وَقَالَ أَبُو مُعَاوِيَةَ حَدَّثَنَا دَاوُدُ عَنْ عَامِرٍ قَالَ سَمِعْتُ عَبْدَ اللَّهِ عَنِ النَّبِيِّ صلى الله عليه وسلم. وَقَالَ عَبْدُ الأَعْلَى عَنْ دَاوُدَ عَنْ عَامِرٍ عَنْ عَبْدِ اللَّهِ عَنِ النَّبِيِّ صلى الله عليه وسلم.
Great idea!
Further partition the text of hadith.
Have a look at this - https://us-west1-hadeeth.cloudfunctions.net/hadith/bukhari/2
This api has further partitioned the text of the Hadith as Prefix (containing the chain of narrations), Post-fix (Comment by the narrator).
This would help in better parsing of data.