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

  1. Open https://qul.tarteel.ai/resources/morphology.
  2. Keep default listing order and open the first published card.
  3. Confirm the detail page includes:
    • Preview tab (resource-specific title such as Word root Preview)
    • Help tab
  4. Confirm available download formats (commonly sqlite).

This keeps onboarding concrete without hardcoded IDs.

4) What the Preview Shows (Website-Aligned)

On morphology detail pages:

  • Preview tab:
    • Jump to Ayah
    • Word-level rows for selected ayah (Word stem, Word root, Word lemma)
    • Ayah-level aggregates (Ayah Stem, Ayah Root, Ayah Lemma)
  • Help tab:
    • 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)

  1. Download morphology package (commonly sqlite).
  2. Import rows with word_location/equivalent keys.
  3. Join with Quran Script word data using the same key.
  4. Index by root/lemma/POS for search features.
  5. 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:

  1. Render words with location keys.
  2. User taps one word.
  3. App resolves morphology row by location key.
  4. 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:

Related Docs