qpc-fonts icon indicating copy to clipboard operation
qpc-fonts copied to clipboard

"None" line in mushaf-v2.txt

Open khalid-hussain opened this issue 2 years ago • 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.

khalid-hussain avatar Dec 09 '21 01:12 khalid-hussain

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

آمين وإياكم

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.

mustafa0x avatar Dec 09 '21 03:12 mustafa0x

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

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: https://github.com/quran/quran.com-api/issues/363

thecashewtrader avatar Dec 09 '21 05:12 thecashewtrader

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

khalid-hussain avatar Dec 09 '21 07:12 khalid-hussain

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

thecashewtrader avatar Dec 09 '21 13:12 thecashewtrader

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

khalid-hussain avatar Dec 09 '21 16:12 khalid-hussain

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

mustafa0x avatar Dec 09 '21 17:12 mustafa0x

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

khalid-hussain avatar Dec 11 '21 17:12 khalid-hussain

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.

naveed-ahmad avatar Dec 12 '21 23:12 naveed-ahmad