You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A serious Islamic learning platform has to handle Arabic as a language, not just as UTF-8 bytes it passes through to the model. A learner studying an ayah wants to know the root of a word, its morphology (verb form, tense, person), and how to read it correctly with diacritics (tashkeel). The model guesses at all of this today and is frequently wrong about roots and grammar. This issue adds an Arabic morphology toolkit: reliable diacritization, root-word extraction, morphological analysis, and word-by-word breakdown of Quranic text — deterministic linguistic tooling the assistant can lean on instead of hallucinating grammar. This is explicitly the analysis layer that complements the general Arabic/multilingual I-O support in #14 (which covers detecting Arabic, replying in Arabic, and RTL handling) — different problem, no overlap.
Current state
There is no Arabic processing anywhere. requirements.txt lists fastapi, uvicorn, python-dotenv, google-generativeai, pydantic, stellar-sdk — no NLP, no Arabic library, no Quranic corpus.
Any Arabic question (roots, i'rab/grammar, tashkeel) is answered by chat.send_message (main.py, lines 143–151) from the model's memory, which is unreliable for morphology and root derivation.
ISLAMIC_CONTEXT (lines 57–71) says nothing about Arabic linguistics, and the service has no verse text to analyze against.
[Enhancement] First-class Arabic and multilingual support #14 ("First-class Arabic and multilingual support") owns language detection and Arabic-language responses; it does not provide a morphological analyzer, root lookup, or word-by-word Quran breakdown — that gap is this issue.
What to build
A morphology module (e.g. arabic.py) exposing: diacritization (add tashkeel to unvowelled text), root extraction (return the triliteral/quadriliteral root), and morphological features (part of speech, verb form/pattern, tense, person, number, gender) — built on an established resource (e.g. a Quranic Arabic morphology corpus, CAMeL Tools, Farasa, or a comparable library/dataset), not on the LLM. Document the source and its accuracy characteristics.
Tests — offline unit tests against known-answer cases (a set of words with textbook roots and morphology, a few fully-parsed ayahs), asserting the analyzer matches. No live API calls in CI.
Acceptance criteria
The morphology module returns diacritization, root, lemma, and morphological features for Arabic input, backed by a documented linguistic resource (not the LLM), with known-answer tests passing.
CI (.github/workflows/ci.yml) lints/compiles only main.py and has no pytest step — extend flake8 to new modules and add a pytest step.
PRs target the dev branch (see CONTRIBUTING.md).
Difficulty
High — Arabic morphology is a hard NLP domain (roots, patterns, clitics, diacritization ambiguity), integrating a real linguistic resource has license/size/deployment implications on a small Render service, and the word-by-word feature must line up exactly with the Quran corpus. Done well it is a standout learning capability; done from the LLM it would just move the hallucination around.
🏆 GrantFox OSS — Official Campaign | FWC26. Apply for this issue through the GrantFox campaign page. The maintainer assigns one contributor before work starts; unassigned PRs may not be reviewed. PRs target the dev branch. Quality bar: CI must stay green.
💬 Questions or need help? Reach the maintainers and other contributors on the DeenBridge Telegram: https://t.me/+nst9lXNj1wc4ZDE0
Summary
A serious Islamic learning platform has to handle Arabic as a language, not just as UTF-8 bytes it passes through to the model. A learner studying an ayah wants to know the root of a word, its morphology (verb form, tense, person), and how to read it correctly with diacritics (tashkeel). The model guesses at all of this today and is frequently wrong about roots and grammar. This issue adds an Arabic morphology toolkit: reliable diacritization, root-word extraction, morphological analysis, and word-by-word breakdown of Quranic text — deterministic linguistic tooling the assistant can lean on instead of hallucinating grammar. This is explicitly the analysis layer that complements the general Arabic/multilingual I-O support in #14 (which covers detecting Arabic, replying in Arabic, and RTL handling) — different problem, no overlap.
Current state
requirements.txtlistsfastapi,uvicorn,python-dotenv,google-generativeai,pydantic,stellar-sdk— no NLP, no Arabic library, no Quranic corpus.chat.send_message(main.py, lines 143–151) from the model's memory, which is unreliable for morphology and root derivation.ISLAMIC_CONTEXT(lines 57–71) says nothing about Arabic linguistics, and the service has no verse text to analyze against.What to build
arabic.py) exposing: diacritization (add tashkeel to unvowelled text), root extraction (return the triliteral/quadriliteral root), and morphological features (part of speech, verb form/pattern, tense, person, number, gender) — built on an established resource (e.g. a Quranic Arabic morphology corpus, CAMeL Tools, Farasa, or a comparable library/dataset), not on the LLM. Document the source and its accuracy characteristics.POST /arabic/analyzeorGET /quran/{surah}/{ayah}/words) returning, per word: the surface form, root, lemma, morphological gloss, and translation — the backbone of a "study this ayah" feature. Reuse the bundled Quran corpus from [Enhancement] Citation verification: check quoted Quran text against a bundled corpus and flag unverifiable references #40 for the source text rather than shipping a second copy.Acceptance criteria
Pointers
main.py— router wiring (line 24),/chathandler (lines 118–184),ISLAMIC_CONTEXT(lines 57–71).stellar.py— typedAPIRouterpattern (lines 25, 65–81, 106–118) as the endpoint template.requirements.txt— currently no NLP deps; justify any Arabic library added (size, license, install footprint on Render — seerender.yaml)..github/workflows/ci.yml) lints/compiles onlymain.pyand has no pytest step — extend flake8 to new modules and add a pytest step.devbranch (seeCONTRIBUTING.md).Difficulty
High — Arabic morphology is a hard NLP domain (roots, patterns, clitics, diacritization ambiguity), integrating a real linguistic resource has license/size/deployment implications on a small Render service, and the word-by-word feature must line up exactly with the Quran corpus. Done well it is a standout learning capability; done from the LLM it would just move the hallucination around.
🏆 GrantFox OSS — Official Campaign | FWC26. Apply for this issue through the GrantFox campaign page. The maintainer assigns one contributor before work starts; unassigned PRs may not be reviewed. PRs target the
devbranch. Quality bar: CI must stay green.💬 Questions or need help? Reach the maintainers and other contributors on the DeenBridge Telegram: https://t.me/+nst9lXNj1wc4ZDE0