Tutorial 11: Morphology End-to-End
This tutorial is for users who want to integrate word-level Quran morphology (roots, lemmas, grammar tags) into reading/study tools.
1) What This Resource Is
Morphology resources provide word-level linguistic annotations for Quran words.
Typical fields include:
- Word location keys (for example
surah:ayah:word) - Root/lemma/stem fields
- Part-of-speech and grammar tags
Primary category:
2) When to Use It
Use morphology data when building:
- Tap-word grammar insights
- Root/lemma based search
- Arabic linguistic study tools
3) How to Get Your First Example Resource
- Open https://qul.tarteel.ai/resources/morphology.
- Keep default listing order and open the first published card.
- Confirm the detail page includes:
-
Previewtab (resource-specific title such asWord root Preview) -
Helptab
-
- Confirm available download formats (commonly
sqlite).
This keeps onboarding concrete without hardcoded IDs.
4) What the Preview Shows (Website-Aligned)
On morphology detail pages:
-
Previewtab:Jump to Ayah- Word-level rows for selected ayah (
Word stem,Word root,Word lemma) - Ayah-level aggregates (
Ayah Stem,Ayah Root,Ayah Lemma)
-
Helptab:- Field definitions (including word location key)
- Integration notes about joining with word-by-word script
Practical meaning:
- Morphology rows must be joined at word-level, not only ayah-level.
- Word order and location keys are mandatory for accurate overlays.
5) Download and Use (Step-by-Step)
- Download morphology package (commonly
sqlite). - Import rows with
word_location/equivalent keys. - Join with Quran Script word data using the same key.
- Index by root/lemma/POS for search features.
- Render per-word analysis in UI.
Starter integration snippet (JavaScript):
JavaScript
const buildMorphologyIndex = (rows) =>
rows.reduce((index, row) => {
index[row.word_location] = row;
return index;
}, {});
const enrichWordsWithMorphology = (wordRows, morphologyIndex) =>
wordRows.map((word) => ({
...word,
morphology: morphologyIndex[word.location] || null
}));
6) Real-World Example: Tap Word for Grammar
Goal:
- User taps a Quran word and sees stem/root/lemma details.
Inputs:
- Morphology package
- Quran Script word-by-word package
Processing:
- Render words with location keys.
- User taps one word.
- App resolves morphology row by location key.
- UI shows stem/root/lemma and ayah-level morphology context.
Expected output:
- Morphology panel reflects the correct tapped word and the ayah-level summary.
Interactive preview (temporary sandbox):
You can edit this code for testing. Edits are not saved and may not persist after refresh.
Tip: scroll down in the preview area to view Ayah Stem/Root/Lemma sections.
JavaScript Playground
Editor
Preview
7) Common Mistakes to Avoid
- Joining morphology to verse-only keys instead of word location keys.
- Ignoring word order and position.
- Treating morphology labels as stable across different source datasets.
8) When to Request Updates or Changes
Open an issue if you find:
- Incorrect location-key mappings
- Missing stem/root/lemma values
- Broken download links
Issue tracker: