Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"None" line in mushaf-v2.txt #6

Open
khalid-hussain opened this issue Dec 9, 2021 · 8 comments
Open

"None" line in mushaf-v2.txt #6

khalid-hussain opened this issue Dec 9, 2021 · 8 comments

Comments

@khalid-hussain
Copy link

السلام عليكم ورحمة الله وبركاته

May Allah (سبحانه وتعالى) reward you for this work.

Forgive me but I don't understand what the lines with a "None" mean. For example, see LL 955, 2251, and 2349.

@mustafa0x
Copy link
Owner

وعليكم السلام ورحمة الله وبركاته

آمين وإياكم

I'm not sure, this file was by @thecashewtrader. Those values can easily be corrected with https://tafsir.app/m-madinah-f/1/1 or api.quran.com.

@thecashewtrader
Copy link
Contributor

thecashewtrader commented Dec 9, 2021

وَ عَلَيْكُمَ اَلسَّلَامْ وَ رَحْمَةُ أللهِ وَ بَرَكَاتُه

It seems that some of the Isolated Letters (example: 'Alif Laam Meem') have been misrepresented as None / Null in the api. We'll have to wait for the api to update before we can fix this.

Related: quran/quran.com-api#363

@khalid-hussain
Copy link
Author

khalid-hussain commented Dec 9, 2021

There was also a pull request fixing some things in mushaf-v2.txt on 23 May 2021 but it has yet to be merged. Is there something I should be concerned about?

P.S. It should be عليكمُ السلامُ.

@thecashewtrader
Copy link
Contributor

tbh that PR is outdated, I'll make a new file with the updated quran.com api soon إِنْ شَاءَ الله

@khalid-hussain
Copy link
Author

@gimyboya provided some code in Javascript to help with this task:

import Papa from 'papaparse';

(async () => {
  const result = await fetch(
    'https://api.quran.com/api/v4/quran/verses/code_v2'
  );
  const verses = await result.json();
  console.log(verses);
  const csv = Papa.unparse(verses.verses, {
    header: true,
    columns: ['code_v2', 'v2_page'],
  });
  console.log(csv);
})().catch((e) => {
  // Deal with the fact the chain failed
});

@mustafa0x
Copy link
Owner

I made a small tool to convert between surah/ayah and ayah id.

https://svelte.dev/repl/20b48950379a44b781f79d87341b7a0f?version=3.44.2

Once you have the surah and ayah, you can copy the chars from https://tafsir.app

Screen Shot 2021-12-09 at 9 25 21 AM

@khalid-hussain
Copy link
Author

khalid-hussain commented Dec 11, 2021

The v1 font still has None for those ayaat. The v2, however, has no such problems. Here is a Python attempt:

import requests

quranAPI = 'https://api.quran.com/api/v4/quran/verses/code_v2'
content = requests.get(quranAPI).json()

for k in content['verses']:
    print("{},{}".format(k['v2_page'], k['code_v2']))

@naveed-ahmad
Copy link
Collaborator

v1 and v2 codes are fixed, we were not using codes for the whole ayah and didn't realize they're missing for some ayahs. Fixed and had a new release today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants