Qur'an | Word by Word | Audio | Prayer Times
__ Sign In
 
__

Java API - Chapter Initials Example

__

The example program below finds all chapters in the Holy Quran that begin with special initials. These are sequences of letters (e.g. alif, lām, mīm) which make up the first verses of certain chapters, but do not combine to form words. Within the Uthmani script, the initials are the only tokens in the Quran that have no diacritics other than maddah.

Java Example

public class ChapterInitialsExample {

    public static void main() {

        // Initiate an analysis table.
        AnalysisTable table = new AnalysisTable(
            "Verse", "Initials");

        // Check each token in the Quranic text.
        for (Token token : Document.getTokens()) {

            // The token is not what we are looking for
            // if it has a diacritic other than maddah.
            boolean isValid = true;
            for (ArabicCharacter ch : token) {
                if (!ch.isMaddah()
                    && ch.getDiacriticCount() != 0) {
                    isValid = false;
                    break;
                }
            }

            // If this token has only maddah for diacritics,
            // then add it to the analysis table.
            if (isValid) {table.add(
                token.getVerse().getLocation(),
                token.removeDiacritics().toSimpleEncoding());
            }
        }

        // Display the results.
        System.out.println(table);
    }
}

Program Output

Verse  Initials
-----  --------
(2:1)  Alif | Lam | Meem
(3:1)  Alif | Lam | Meem
(7:1)  Alif | Lam | Meem | Sad
(10:1) Alif | Lam | Ra
(11:1) Alif | Lam | Ra
(12:1) Alif | Lam | Ra
(13:1) Alif | Lam | Meem | Ra
(14:1) Alif | Lam | Ra
(15:1) Alif | Lam | Ra
(19:1) Kaf | Ha | Ya | Ain | Sad
(20:1) TTa | Ha
(26:1) TTa | Seen | Meem
(27:1) TTa | Seen
(28:1) TTa | Seen | Meem
(29:1) Alif | Lam | Meem
(30:1) Alif | Lam | Meem
(31:1) Alif | Lam | Meem
(32:1) Alif | Lam | Meem
(36:1) Ya | Seen
(38:1) Sad
(40:1) HHa | Meem
(41:1) HHa | Meem
(42:1) HHa | Meem
(42:2) Ain | Seen | Qaf
(43:1) HHa | Meem
(44:1) HHa | Meem
(45:1) HHa | Meem
(46:1) HHa | Meem
(50:1) Qaf
(68:1) Noon

Discussion

The results show that 30 verses in 29 chapters of the Quran are made up of initials. All initials occur in the first verse, except for those in chapter 42. This chapter has a pair of initials at verses (42:1) and at (42:2).

The full meaning behind the Quranic initials is still not yet fully understood. One observation is that the initials are almost always followed by a description of Quranic revelation itself, for example:

"These are the signs..."
"The Revelation…"
"By the Quran..."
"By the Book..."

The only occurrence of double initials - at the first two verses of chapter 42 - is followed by two mentions of revelation, at verse (42:3).

See Also

Language Research Group
University of Leeds
__