AhmedBaset / hadith-json

Database of Prophet hadiths include 50,884 hadiths from 17 book, among of them the nine books
61 stars 9 forks source link

Missing Chapters in Bukhari Book #5

Closed KarimRedaHassan closed 3 months ago

KarimRedaHassan commented 3 months ago

Thanks a lot for your effort. It is really appreciated.

The following chapters are missing from the Bukhari book and their IDs have been replaced by other chapters. 2Beliefكتاب الإيمان 8 to 58 3Knowledgeكتاب العلم 59 to 134 4Ablutions (Wudu')كتاب الوضوء135 to 247 5Bathing (Ghusl)كتاب الغسل 248 to 293 6Menstrual Periodsكتاب الحيض 294 to 333 7Rubbing hands and feet with dust (Tayammum)كتاب التيمم 334 to 348 8Prayers (Salat)كتاب الصلاة 349 to 520 9Times of the Prayersكتاب مواقيت الصلاة 521 to 602

You will find كتاب الأذان has an id of 2 which should be the id of the missing chapter كتاب الإيمان.

AhmedBaset commented 3 months ago

Salam @KarimRedaHassan Thanks for reporting the issue. It should be fixed now by #7 Please try again and let me know if it didn't.

KarimRedaHassan commented 3 months ago

I didn't try your modifications yet but I have found the issue and solved it. Actually, there was no missing chapters but the chapters' sorting in the book is inaccurate because it merges the files from by_chapters folder based on the files' names and the naming of those files is 1, 2, 3, ... , 20, 21, ... which causes the issue as when you sort these numbers you will find the actual sort is 1, 10, 11, .... , 2, 20, 21, ... , 3, 31, ... So, the solution was to make the file naming follows a 2 digits pattern such as 01, 02, 03, ....

AhmedBaset commented 3 months ago

It was solved

https://github.com/A7med3bdulBaset/hadith-json/blob/ca32fd72aa16eeeb9a819c80bb65c9e78766532d/src/index.ts#L154-L159 // the previous snippet sorts files by {n}.json

I agree with you on the file naming. Actually when I looked into the code yesterday I found too much space for improvements https://github.com/A7med3bdulBaset/hadith-json/blob/ca32fd72aa16eeeb9a819c80bb65c9e78766532d/README.md?plain=1#L120