Skip to content

dotquran/corpus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotquran/corpus

Processes multiple Tanzil Quran text variants and produces structured output files in JSON, YAML, and XML formats.


Processed versions (ready to use)

The processed/ folder is committed to this repository.

Each source variant in src/resources/ is exported to its own folder:

  • processed/simple/
  • processed/simple-clean/
  • processed/simple-imlaai/
  • processed/simple-minimal/
  • processed/simple-plain/
  • processed/uthmani/
  • processed/uthmani-all/

Inside each folder, you will find:

  • quran-<variant>.json
  • quran-<variant>.yaml
  • quran-<variant>.xml

Version notes

  • uthmani / uthmani-all: Uthmani-script variants for general Quran text usage.
  • simple / simple-clean / simple-minimal / simple-plain: simplified-script variants for different normalization needs.
  • simple-imlaai: special variant used only for ASR matching.

Warning: simple-imlaai is provided for ASR matching workflows only and should not be used for any other purpose.


Output structure

Each file contains a top-level object with two fields: metadata and surahs.

metadata

{
  "source": "Tanzil Project",
  "version": "Uthmani, Version 1.1",
  "repository": "dotquran/corpus",
  "website": "https://tanzil.net",
  "license": "Creative Commons Attribution 3.0",
  "termsOfUse": "...",
  "processedBy": "github.com/dotquran/corpus",
  "processedAt": "Sat, 11 Apr 2026 14:19:46 GMT"
}

surahs

An array of surah objects:

{
  "number": 2,
  "name": "البقرة",
  "loc": "مدنية",
  "ayahs": [...]
}
  • loc is either مكية (Makki) or مدنية (Madani).

ayahs

Each surah contains an array of ayah objects:

{ "number": 1, "text": "الٓمٓ" }
{ "number": 23, "text": "...", "marks": ["sajda"] }
{ "number": 26, "text": "...", "marks": ["rub' hizb"] }
  • marks is optional and may contain "sajda" and/or "rub' hizb".

Basmalah handling

  • Surah 1 (Al-Fatihah): the Basmalah is ayah 1 as it is counted as an actual verse.
  • Surah 9 (At-Tawbah): no Basmalah.
  • All other surahs: the Basmalah is separated from the first ayah and given ayah number 0, keeping the original ayah numbering intact.
{ "number": 0, "text": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ" },
{ "number": 1, "text": "الٓمٓ" }

Running the generator

Requires Node.js 18+.

npm install
npm run generate

Output files are written to processed/<variant>/.


Source

The Quran text is sourced from the Tanzil Project (src/resources/*.txt) and is used under the Creative Commons Attribution 3.0 license. The text may not be modified. Any redistribution must credit Tanzil Project and link back to tanzil.net.

About

this is the full quran corpus from tanzil.net processed into easy to digest formats like json, yaml, xml files

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors