Word stem

Word by word

Tags

Download Links

About stem data

The stem of a word is the word itself with the pieces attached to it taken off. Arabic joins several small words onto the front and back of a word, so one written word such as فَأَزَلَّهُمَا ("so he made the two of them slip") holds a particle, a verb and a pronoun. Its stem is just the verb, أَزَلَّ.

Every word of the Quran has exactly one stem. Words that share a stem are the same word with different pieces attached, so stems are useful for search and for finding every place a word is used.

The article

The definite article ال ("the") is removed.

Word Location Stem Removed
ٱلۡحَمۡدُ 1:2:1 حَمْدُ ال
ٱلرَّحۡمَٰنِ 1:1:3 رَّحْمَٰنِ ال

Prefixes: joined particles

One-letter particles written as part of the next word are removed: وَ and فَ ("and", "so"), the prepositions بِ ("with, in") and لِ ("for, to"), and the يَا used to call someone ("O").

Word Location Stem Removed
وَبَشِّرِ 2:25:1 بَشِّرِ وَ
فَأَخۡرَجَ 2:22:12 أَخْرَجَ فَ
بِمَآ 2:4:3 مَآ بِ
لِلرَّحۡمَٰنِ 19:26:13 رَّحْمَٰنِ لِ + ال
يَٰٓأَيُّهَا 4:1:1 أَيُّهَا يَا

Suffixes: attached pronouns

Pronouns joined to the end of a noun, preposition or verb, such as ـهِ ("him"), ـهِمۡ ("them") and ـنَا ("us"), are removed.

Word Location Stem Removed
عَلَيۡهِ 2:37:7 عَلَيْ ـهِ
رَّبِّهِمۡ 2:5:5 رَّبِّ ـهِمۡ
أَيۡدِيهِمۡ 2:255:30 أَيْدِي ـهِمۡ
ٱهۡدِنَا 1:6:1 اهْدِ ـنَا

Suffixes: verb endings

The endings that say who did the action, such as ـتَ ("you") and ـُواْ ("they"), are removed too, along with any pronoun after them.

Word Location Stem Removed
أَنۡعَمۡتَ 1:7:3 أَنْعَمْ ـتَ
ءَامَنُواْ 2:9:4 ءَامَنُ ـُواْ
رَزَقۡنَٰهُمۡ 2:3:7 رَزَقْ ـنَا + ـهُمۡ
فَيَعۡلَمُونَ 2:26:15 يَعْلَمُ فَ + ـُونَ

What stays

Everything that belongs to the word itself is kept, including:

Word Location Stem Kept
نَعۡبُدُ 1:5:2 نَعْبُدُ The present-tense prefix نَ ("we")
جَمِيعٗا 3:103:4 جَمِيعًا The case ending
أُحِلَّتۡ 5:1:6 أُحِلَّتْ The feminine ـتْ
ٱللَّهُ 2:7:2 اللَّهُ The article in the name of Allah
وَإِيَّاكَ 1:5:3 إِيَّاكَ إِيَّاكَ is itself a pronoun, so only وَ goes

Stem, lemma and root compared

Word Location Stem Lemma Root
ٱلۡحَمۡدُ 1:2:1 حَمْدُ حَمْد ح م د
ٱلرَّحۡمَٰنِ 1:1:3 رَّحْمَٰنِ رَّحْمَٰن ر ح م
ٱلرَّحۡمَةَ 6:12:12 رَّحْمَةَ رَحْمَة ر ح م
عَلَيۡهِ 2:37:7 عَلَيْ عَلَىٰ —
ٱلرَّحۡمَٰنِ and ٱلرَّحۡمَةَ share a root but not a stem: they are different words. Use roots to group words by meaning, lemmas to group them by dictionary entry, and stems to find one word in all its attached forms.

SQLite format

The download is a SQLite database with two tables: stems (12,113 rows, one per stem) and stem_words (one row per word of the Quran, linking it to its stem).

Table: stems

Column Type Description
id INTEGER Stem id, used by stem_words.stem_id
text TEXT Stem with full diacritics
text_clean TEXT Stem without diacritics, for search
words_count INTEGER How many words in the Quran have this stem
uniq_words_count INTEGER How many different forms those words take
Sample rows
id    | text        | text_clean | words_count | uniq_words_count
368   | حَمْدُ       | حمد        | 28          | 2
6475  | رَّحْمَٰنِ    | رحمان      | 33          | 3
10329 | رَّحِيمِ      | رحيم       | 6           | 1

For example, the stem رَّحْمَٰنِ appears 33 times in 3 forms: ٱلرَّحۡمَٰنِ, لِلرَّحۡمَٰنِ and بِٱلرَّحۡمَٰنِ.

Table: stem_words

Column Type Description
stem_id INTEGER The word's stem, from stems.id
word_location TEXT Word position as surah:ayah:word, e.g. 1:1:3 is the third word of the first ayah
Sample rows
stem_id | word_location
368     | 1:2:1
6475    | 1:1:3
6475    | 1:3:1
10329   | 1:1:4
Rows are not stored in Quran order. When you need them in reading order, sort by surah, ayah and word number rather than by the word_location text.

Example queries

Find the stem of a word

SQL
SELECT stems.*
FROM stem_words
JOIN stems ON stems.id = stem_words.stem_id
WHERE stem_words.word_location = '1:1:3';

Every place a stem is used

SQL
SELECT word_location
FROM stem_words
WHERE stem_id = 6475;  -- رَّحْمَٰنِ: 33 locations

Search by stem without diacritics

SQL
SELECT id, text, words_count
FROM stems
WHERE text_clean = 'حمد';
-- 368  | حَمْدُ | 28
-- 1422 | حَمْدِ | 15

Most used stems

SQL
SELECT text, words_count, uniq_words_count
FROM stems
ORDER BY words_count DESC
LIMIT 10;