Tutorial 12: Mutashabihat End-to-End
This tutorial is for users who want to integrate phrase-level similarity aids for memorization and comparison.
1) What This Resource Is
Mutashabihat resources provide phrase-level similarity mappings across ayahs.
The help model typically includes files such as:
-
phrases.json(shared phrases) -
phrase_verses.json(ayah-to-phrase mappings)
Primary category:
2) When to Use It
Use mutashabihat data when building:
- Memorization revision tools
- Similar phrase comparison views
- Confusion-reduction aids for close ayah wording
3) How to Get Your First Example Resource
- Open https://qul.tarteel.ai/resources/mutashabihat.
- Keep default listing order and open the first published card.
- Confirm the detail page includes:
-
Mutashabihat Previewtab -
Helptab
-
- Confirm available download file(s) (commonly
json).
This keeps onboarding concrete without hardcoded IDs.
4) What the Preview Shows (Website-Aligned)
On mutashabihat detail pages:
-
Mutashabihat Previewtab:Jump to Ayah- Displays similar phrase relationships for selected ayah
- Shows phrase words and repeat statistics
- Lists phrase ayahs where the phrase appears
-
Helptab:- Explains
phrases.jsonandphrase_verses.json - Shows lookup flow to retrieve related phrases
- Explains
Practical meaning:
- You should resolve phrase IDs first, then fetch phrase details.
- Mutashabihat is phrase-level guidance, not full tafsir/translation content.
Concrete example (mutashabihat resource 73):
- Phrase words:
- بِسۡمِ
- ٱللَّهِ
- ٱلرَّحۡمَٰنِ
- ٱلرَّحِيمِ
- Summary:
- This phrase is repeated 2 times in 2 ayahs across 2 surahs.
- Phrase ayahs:
-
1:1: بِسۡمِ ٱللَّهِ ٱلرَّحۡمَٰنِ ٱلرَّحِيمِ ١ -
27:30: إِنَّهُۥ مِن سُلَيۡمَٰنَ وَإِنَّهُۥ بِسۡمِ ٱللَّهِ ٱلرَّحۡمَٰنِ ٱلرَّحِيمِ ٣٠
-
5) Download and Use (Step-by-Step)
- Download mutashabihat dataset (
json). - Load
phrase_verses.jsonandphrases.json. - For selected ayah, fetch phrase IDs from phrase-verses mapping.
- Resolve phrase IDs to phrase details.
- Optionally join with script words for visual highlighting.
Starter integration snippet (JavaScript):
JavaScript
// Required: load phrases.json, phrase_verses.json, and Quran words data.
const phraseIdsForAyah = (phraseVerses, ayahKey) => phraseVerses[ayahKey] || [];
const phrasesForAyah = (phraseVerses, phrasesById, ayahKey) =>
phraseIdsForAyah(phraseVerses, ayahKey)
.map((id) => phrasesById[id])
.filter(Boolean);
// In phrases.json, each phrase can include:
// - source: where the phrase is first sourced from
// - ayah: a mapping like { "2:23": [[from, to], ...] } for word ranges
const phraseRangesForAyah = (phrase, ayahKey) =>
phrase?.ayah?.[ayahKey] || [];
6) Real-World Example: Similar Phrase Helper
Goal:
- User selects an ayah and sees phrase-level similar references.
Inputs:
phrases.jsonphrase_verses.json
Processing:
- Resolve phrase IDs for selected ayah.
- Load matching phrase entries.
- Render phrase and related ayah references.
- On demand (
View all), show all known ayahs where phrase appears.
Expected output:
- User can compare similar phrase patterns quickly.
Interactive preview (temporary sandbox):
You can edit this code for testing. Edits are not saved and may not persist after refresh.
JavaScript Playground
Editor
Preview
7) Common Mistakes to Avoid
- Treating mutashabihat as ayah-level one-to-one data.
- Ignoring phrase ID indirection.
- Not showing related ayah context alongside phrase matches.
8) When to Request Updates or Changes
Open an issue if you find:
- Missing phrase IDs in mappings
- Broken references from phrase ID to phrase object
- Broken json download links
Issue tracker: