nuqayah/qpc-fonts

"None" line in mushaf-v2.txt

Opened this issue · 8 comments

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

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.

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

آمين وإياكم

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.

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

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

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 عليكمُ السلامُ.

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

@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
});

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

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']))

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.