Automation of Quranic Readings Gathering Process

Quran has been the focus of many computer science and computational linguistics researchers. However, insufficient contribution is directed towards Quranic readings. This field focuses on the different ways in which Quranic words can be recited. Quranic readings gathering is a recitation process that is well-known by the specialists in this field. In this process, all the possible ways of reading a verse are covered in a compact and well-structured manner. To the best of the author’s knowledge, no computational automation has been cited for this process in literature. In this paper, this process was algorithmically formulated and a developed software system was presented to automate this process. This system took Quranic verse texts as input and generated a text file containing the detailed gathering of the readings of this verse as done by a specialised reciter. The system was applied to the verses of Surah Al-Baqarah and the output text was carefully validated against authentic books in this field. This system can be the basis of software systems for teaching and vocal construction of Quranic readings gathering. It would be useful for students who are interested in Quranic readings.


INTRODUCTION
Quran is the holy book of Muslims. No book in history has ever taken the attention and care that were given to this miraculous book. The scientific work -to serve this book -touched various fields of computer science and information technology. This includes searching (Larbi, 2013;Mohamed & Shokry, 2020), information extraction (Yauri et al., 2013) and mining (Majdalawieh et al., 2017), software systems to facilitate its learning, teaching (AlKhatib et al., 2020;Abdou & Rashwan, 2014;Menacer et al., 2013) and memorisation (Bin Musa et al., 2018;Rafi et al., 2019), recognising its textual (Alotaibi et al., 2018) and vocal forms (Qayyum et al., 2108), studying its syntactical structures (AbuZeina & Alsaheb, 2013;Khadangi et al., 2018), building databases and websites to make it available in the web (Boussenan, 2013;Priatna et al., 2020) and in mobile applications (Abdullah et al., 2019;Elmarhomy, 2020), securing the integrity of its electronic versions against alteration (Hakak et al., 2017), studying the spiritual and mental effects of its recitation (Khan et al., 2010), validating the correctness of its vocal recitation (Rashid et al., 2013) and many other fields.
In the context of Quranic readings, there has been some work towards teaching Quranic readings (Ishak et al., 2016). Mahmoud and Hassan (2013) developed a software system where the different readings of a Quranic verse were retrieved from a database with explanations but without gathering. The authors of the present study could not find any work in the automation of Quranic gathering process. One reason for that could be the nature of the Quranic readings field. It is one of the Quranic scientific fields that are not widely known. Among specialists in Quranic studies, only a very small fraction chooses to specialise in this field. This field is vast and not easy to master. The gathering of Quranic recitation is deemed even harder.
Many books that document the readings gathering for individual Quranic verses -based on the narration ways of Tayyebat-Annashr 1 -can be found in the literature (Abdeen, 2016;Salem, 2003). These books briefly describe the gathering of readings for every Quranic verse without the generation of detailed readings. However, it is found that one book (Tulba & Awadh, 2016) documented the readings gathering of Quranic verse in detail. However, this book -contained in five volumes -covered only less than one-fifth of the Quran. This book was the present study's main reference to validate the gathering that is generated by the proposed system.

Quranic Readings Gathering Process
Many words of the Holy Quran can be read in more than one way. These different ways of reading Quranic words are vocally transferred from one generation to the next. Among very early generations, there are twenty narrators that were well-known for their integrity and competency in Quranic readings. Each of these narrators had learned some of the readings of Quranic words and taught them to others. Every one of them became well-known for his narration. It is believed that all authentic readings of the Quranic verses are found in one of these twenty narrations.
Students who are interested in learning Quranic readings put effort to master these twenty narrations. A student is assumed to master a narration and is then authorised to teach it if he recites the whole Quran with that narration before an authorised scholar. He repeats this process for each of the twenty narrations. These narrations are learned in a certain order that is known in this field ( Figure 1). This order does not reflect the authenticity of the narration. Once a student masters these twenty narrations separately, he becomes qualified to what is known in Arabic as Jam'e Al-qiraat which is literally translated to English as gathering of readings. In this stage, the student covers all the twenty narrations through one recitation of the Holy Quran. The gathering of readings can be defined as the recitation of Quranic verse (or ayah in Arabic) where all the possible readings of its words are covered. From now on, the word ayah will be used in this paper to refer to the Quranic verse.
2 Quranic verse were retrieved from a database with explanations but without gathering. T present study could not find any work in the automation of Quranic gathering process. O could be the nature of the Quranic readings field. It is one of the Quranic scientific fields t known. Among specialists in Quranic studies, only a very small fraction chooses to spec This field is vast and not easy to master. The gathering of Quranic recitation is deemed e Many books that document the readings gathering for individual Quranic verses -base ways of Tayyebat-Annashr 1 -can be found in the literature (Abdeen, 2016;Salem, 20 briefly describe the gathering of readings for every Quranic verse without the gene readings. However, it is found that one book (Tulba & Awadh, 2016) documented the r of Quranic verse in detail. However, this book -contained in five volumes -covered o fifth of the Quran. This book was the present study's main reference to validate the generated by the proposed system.

Quranic Readings Gathering Process
Many words of the Holy Quran can be read in more than one way. These different ways o words are vocally transferred from one generation to the next. Among very early gene twenty narrators that were well-known for their integrity and competency in Quranic these narrators had learned some of the readings of Quranic words and taught them to oth them became well-known for his narration. It is believed that all authentic readings of t are found in one of these twenty narrations.
Students who are interested in learning Quranic readings put effort to master these twe student is assumed to master a narration and is then authorised to teach it if he recites the that narration before an authorised scholar. He repeats this process for each of the twenty narrations are learned in a certain order that is known in this field ( Figure 1). This order d authenticity of the narration. Once a student masters these twenty narrations separa qualified to what is known in Arabic as Jam'e Al-qiraat ‫القراءات(‬ ‫,)جمع‬ which is literally tra as gathering of readings. In this stage, the student covers all the twenty narrations throug the Holy Quran. The gathering of readings can be defined as the recitation of Quranic Arabic) where all the possible readings of its words are covered. From now on, the word 1.
Gathering of readings is a complex process, and even the most competent reciters are subject to slip into mistakes. However, this process is well-defined and thus may be automated. If correctly implemented, a software system may generate an accurate and correct gathering. This gathering can be used as a reference for the interested students.

2.
Although many books were written to gather the readings of Quranic ayahs, they present the gathering as a summarised description without a detailed generation of gathering. The reasons could be due to the huge size of the text and the amount of effort that are required to document the gathering in detail.
A software system will be a better alternative to generate a detailed gathering of Quranic ayah readings instead of a manual generation that will be error-prone and expensive in terms of time and effort. 3.
This process is performed for the twenty narrations as previously mentioned. With a software system, this study can generalise the process of readings gathering for a smaller number of narrations. The process can also be applied for more than twenty narrations to consider other less authentic narrations of the Quran. 4. Having a software system for Quranic readings opens the door for utilising information technology solutions to serve this honoured science. This software system can be the basis for learning, searching, and vocal construction of Quranic readings.
The methodology that was followed in this research can be summarised as follows: (1) studying the different readings for different narrations -ayah by ayah -of Surah Al-Baqarah. These readings follow well-defined rules. These rules are formulated and programmed as conditions to be tested against every letter of the text of the input ayah. If a condition is satisfied, the corresponding Quranic reading is associated with that letter. The input to the system will be a text file containing the Uthmani text of the ayah to gather its readings.
(2) Once the different readings of the letters are identified, the ayah is scanned to build the ayah readings tree, which will be traversed to generate the readings gathering. The output will be written to a text file with a detailed description. (3) The gathering that is generated by the system is tested against trustworthy readings gathering books to validate the generated gathering. The system is continuously adjusted until the generated ayah gathering matches the gathering found in the books before advancing to the next ayah.
This paper is organised as follows: the second section formalises the readings gathering process. The next section presents an automation solution for the process in the algorithmic level, while the following section discusses several implementation issues. The paper ends with a conclusion and a set of references.

FORMALISING THE QURANIC READINGS GATHERING PROCESS
Before presenting how the gathering is done by specialists, an assumption is made for simplification purposes. This study will consider gathering for the whole ayah and not parts of it. This study will assume that the reciter stops at the end of the ayah. This assumption is based on two reasons. The first reason is to unify the stopping points to be at the end of the Quranic ayahs. This may be justified by the fact that the end of the ayah is known to be a stopping point when reciting the Quran. The second reason is that with this assumption, the number of passes of the gathering will be equal to the number of ways the ayah (as a whole) can be read for the twenty narrators.
algorithm will be described as followed by a human reciter. The reciter starts reading the ayah word by word. CurrentWord is the word to be read. Initially, the currentWord is the first word of the ayah. StoppingNarrators set is the set of narrators that still have some readings for the currentWord that are not yet covered in the gathering. Every word has its own stoppingNarrators, which will change through the course of gathering.
The set of stoppingNarrators is represented in the form of a set of ordered pairs. The first coordinate is a narrator and the second is a reading for currentWord for that narrator. For example, assume that n 1 is a narrator that is stopping at currentWord and has the readings r 1 and r 2 for currentWord. Let n 2 be another narrator that is stopping at currentWord and has the readings r 1 and r 3 for currentWord. In this case, stoppingNarrators set for currentWord will be {(n 1 ,r 1 ), (n 1 ,r 2 ), (n 2 ,r 1 ), (n 2 ,r 3 )}.
Initially, the stoppingNarrators for the first word of the ayah is {(n,r) | r is a reading for currentWord for narrator n}, where all narrators are stopping there with no one stopping anywhere else yet.
CurrentNarrator is the narrator who is reading for in the current pass. In this paper, pass is defined as a reading of the ayah starting from some word within the ayah and ending by its last word for a given narrator(s). A pass corresponds to one of the narrations of the ayah as a whole. CurrentNarrator is always the narrator with the highest rank among the stopping narrators at the currentWord ( Figure 1). The algorithm iterates until all stoppingNarrators for all the words of the ayah become empty.
Once currentWord and currentNarrator are set, one pair from currentWord.stoppingNarrators is picked with the first coordinate of currentNarrator. If there is more than one pair for currentNarrator, then the currentNarrator has multiple readings for currentWord. The reciter will then pick the pair with the reading of the highest priority. There is a certain ordering of the different readings that is known by the reciters. This selected reading will be referred to as currentReading. The reciter will read the currentWord for currentNarrator with currentReading. This currentReading will be stored in the currentWord's place in wordReadingVector.

Gathering of Readings Process
WordReadingVector is a vector that stores the last reading that was conducted by the reciter for the words of the ayah. It is length equals to the number of the words of the ayah. Whenever the reciter reads a word of the ayah with some reading, then the corresponding element of that word is updated to be that reading. It will stay as is until that word is recited again during the gathering process, in which the new reading of the word replaces the older. As will be shown later, this vector is needed to check for contradicting readings.
WalkingNarrators are the stopping narrators at currentWord (including currentNarrator) that have currentReading as one of their readings for currentWord. The stoppingNarrators set for currentWord is updated by removing every pair (n,r) where n is a walking narrator and r is currentReading. The narrators in currentWord.stoppingNarrators and walkingNarrators are not necessarily disjoint.
Next, a decision needs to be made: if currentWord is not the last word in the ayah, currentWord will be set to be the next word in the ayah. StoppingNarrators for the new currentWord will be the set of pairs 5 of the highest priority. There is a certain ordering of the different readings that is known by the reciters. This selected reading will be referred to as currentReading. The reciter will read the currentWord for currentNarrator with currentReading. This currentReading will be stored in the currentWord's place in wordReadingVector.

Figure 2. Gathering of readings process.
WordReadingVector is a vector that stores the last reading that was conducted by the reciter for the words of the ayah. It is length equals to the number of the words of the ayah. Whenever the reciter reads a word of the ayah with some reading, then the corresponding element of that word is updated to be that reading. It will stay as is until that word is recited again during the gathering process, in which the new reading of the word replaces the older. As will be shown later, this vector is needed to check for contradicting readings.
WalkingNarrators are the stopping narrators at currentWord (including currentNarrator) that have currentReading as one of their readings for currentWord. The stoppingNarrators set for currentWord is updated by removing every pair (n,r) where n is a walking narrator and r is currentReading. The narrators in currentWord.stoppingNarrators and walkingNarrators are not necessarily disjoint.
Next, a decision needs to be made: if currentWord is not the last word in the ayah, currentWord will be set to be the next word in the ayah. StoppingNarrators for the new currentWord will be the set of pairs (n,r) where n is a narrator from walkingNarrators set and r is a reading for the new currentWord for narrator n.
(n,r) where n is a narrator from walkingNarrators set and r is a reading for the new currentWord for narrator n. In addition to r being one of the readings for n, r should satisfy another condition: the reading r should not contradict (for narrator n) with any of the readings (of the current pass) of the words existing before currentWord in the ayah. This condition is checked by examining the readings of the words that exist before the currentWord location in wordReadingVector. If a contradiction is found, then (n,r) will not be added to the stoppingNarrators of the new currentWord. These contradictions are assumed to be known by the reciter. The following section of example will show how this constraint is checked.
If currentWord is the last word of the ayah, then the current pass is ended. In this case, the currentWord is set to be the word that is closest to the end of the ayah and has non-empty stopping narrators set. If such a word exists, the algorithm iterates and a new pass starts; otherwise, the algorithm terminates.

Example of Gathering of Readings
The gathering algorithm will be applied to the ayah (2:2). To gather the readings for an ayah, there is a need to know the different readings of its words (Table 1).    Figure 1. The order of the twenty narrators.

Table 1
Readings of the Words of the Ayah (2:2)

Rank
Word

Roways
Rawh I Figure 1. The order of the twenty narrators.      Figure 1. The order of the twenty narrators.    ) In addition to knowing the readings of the words of the ayah, contradicting readings for narrators should be known. If the ayah contains more than one word with multiple readings for the same narrator, some combinations of these words' readings may not be acceptable for that narrator and they should be avoided in reading the ayah. Table 2 shows the contradicting readings for the narrators for ayah (2:2). For example, the second contradiction means that if a reciter reads this ayah for Roways and reads word-5 with EDGHAM_KABEER reading, then he can only read word-7 with NO_HA_SAKT reading. However, if he reads word-5 without EDGHAM_KABEER for Roways, then word-7 can be read with HA_SAKT or with NO_HA_ SAKT. No general rules identify these contradictions. They should be learned and memorised by the reciter. The gathering of readings for this ayah is shown in Table 3. The reciter will go through nine passes in gathering the readings of this ayah. Each row in the table corresponds to one recitation pass through the ayah. The reciter reads the ayah as shown in the pass with the corresponding readings. The ayah does not need to be read completely for every narration. (2) (1) Bazzi, Qonbul (1) EDGHAM_WITHOUT_ GHUNNA (2) NO_HA_SAKT 7 ( Table 3 Gathering of Readings of Ayah (2:2)
The currentWord (word-3) is read with QASR_LA reading (currentReading will be QASR_LA). This is the only way with which Qaloon reads word-3. All narrators read word-3 with currentReading, thus they will all join walkingNarrators. The stoppingNarrators for word-3 will reduce down to {(Khalaf, MAD_LA), (Khallad, MAD_ LA)}. This is because they have another reading for word-3 (MAD_ LA). Next, currentWord becomes word-4 and its stoppingNarrators will be the twenty pairs for all narrators with DEFAULT reading code.
The currentWord (word-4) is read the same way for all narrators. All stopping narrators for word-4 will join walkingNarrators set. The stoppingNarrators set for word-4 will reduce down to an empty set. The currentWord (word-5) is read for currentNarrator (Qaloon) with currentReading of QASR-HA-ALKINAYA. Narrators that read with this reading will join the walkingNarrators. WalkingNarrators will az, Roways, Rawh, Finished Completely: Shuba, AbuAlharith, DoriAlkisaee, Ishaq, Idrees thm to show how the first pass is generated. Initially, the currentWord is word-1 et contains twenty pairs, one pair for each narrator with the DEFAULT reading. ill be Qaloon because he is the highest in rank among the narrators in entNarrator will not change until the end of the pass. All narrators will join e all of them read currentWord like the currentNarrator (Qaloon). All the pairs, be removed from stoppingNarrators for word-1 because none of them read it in ord-1 is not the last word in the ayah, currentWord becomes word-2. The rd-2 will contain the twenty pairs: one pair for each narrator with the DEFAULT starts and the same will happen for word-2 because it is read in one way only for tWord becomes word-3 with stoppingNarrators composed of twenty-two pairs: enty narrators with the QASR_LA reading (which is the default reading for . Another two pairs will be added: (Khalaf, MAD_LA) and (Khallad, MAD_LA).
-5) is read for currentNarrator (Qaloon) with currentReading of QASR-HAhat read with this reading will join the walkingNarrators. WalkingNarrators will pt Bazzi and Qonbul. These two narrators are excluded because they do not read ding. All pairs (n,r) with r is QASR_HA_ALKINAYA will be removed from the s of word-5. StoppingNarrators for word-5 reduces to {(Bazzi, ), (Qonbul, SILAT_HA_ALKINAYA), (DoriAbuAmr, EDGHAM_KABEER), EER), (Roways, EDGHAM_KABEER), (Rawh, EDGHAM_KABEER)}. Note nJammaz, Roways, Rawh, Finished Completely: Shuba, AbuAlharith, DoriAlkisaee, Ishaq, Idrees algorithm to show how the first pass is generated. Initially, the currentWord is word-1 tors set contains twenty pairs, one pair for each narrator with the DEFAULT reading. tor will be Qaloon because he is the highest in rank among the narrators in . CurrentNarrator will not change until the end of the pass. All narrators will join because all of them read currentWord like the currentNarrator (Qaloon). All the pairs, s, will be removed from stoppingNarrators for word-1 because none of them read it in ince word-1 is not the last word in the ayah, currentWord becomes word-2. The at word-2 will contain the twenty pairs: one pair for each narrator with the DEFAULT ration starts and the same will happen for word-2 because it is read in one way only for urrentWord becomes word-3 with stoppingNarrators composed of twenty-two pairs: he twenty narrators with the QASR_LA reading (which is the default reading for code). Another two pairs will be added: (Khalaf, MAD_LA) and (Khallad, MAD_LA).
word-3) is read with QASR_LA reading (currentReading will be QASR_LA). This is which Qaloon reads word-3. All narrators read word-3 with currentReading, thus they ingNarrators. The stoppingNarrators for word-3 will reduce down to {(Khalaf, ad, MAD_LA)}. This is because they have another reading for word-3 (MAD_LA). becomes word-4 and its stoppingNarrators will be the twenty pairs for all narrators with code.
word-4) is read the same way for all narrators. All stopping narrators for word-4 will tors set. The stoppingNarrators set for word-4 will reduce down to an empty set. (word-5) is read for currentNarrator (Qaloon) with currentReading of QASR-HAators that read with this reading will join the walkingNarrators. WalkingNarrators will s except Bazzi and Qonbul. These two narrators are excluded because they do not read ntReading. All pairs (n,r) with r is QASR_HA_ALKINAYA will be removed from the rrators of word-5. StoppingNarrators for word-5 reduces to {(Bazzi, NAYA), (Qonbul, SILAT_HA_ALKINAYA), (DoriAbuAmr, EDGHAM_KABEER), include all narrators except Bazzi and Qonbul. These two narrators are excluded because they do not read word-5 as the currentReading. All pairs (n,r) with r is QASR_HA_ALKINAYA will be removed from the word-5.stoppingNarrators of word-5. StoppingNarrators for word-5 reduces to {(Bazzi, SILAT_HA_ALKINAYA), (Qonbul, SILAT_HA_ALKINAYA), (DoriAbuAmr, EDGHAM_KABEER), (Soosi, EDGHAM_KABEER), (Roways, EDGHAM_KABEER), (Rawh, EDGHAM_KABEER)}. Note that narrators with EDGHAM_ KABEER will stay with the stopping narrators of word-5. These four narrators also read with QASR_HA_ALKINAYA reading, so their corresponding pairs will join with the walking narrators.
The currentWord (word-6) is read for currentNarrator (Qaloon) with currentReading is EDGHAM_WITHOUT_GHONNA. Note that both pairs {(Qaloon, EDGHAM_WITHOUT_GHONNA) and (Qaloon, EDGHAM_WITH_GHONNA)} are in stoppingNarrators set for word-6. The reciter will pick the first pair because the first reading code is the default of the second. StoppingNarrators at word-6 are all narrators except Bazzi and Qonbul and all of them read with currentReading. Therefore, all of them will join walkingNarrators. Their corresponding pairs will be removed from the stoppingNarrators of word-6. StoppingNarrators for word-6 will reduce to {(x,EDGHAM_WITH_GHONNA)| x is Qaloon, Warsh, DoriAbuAmr, Soosi, Hisham, IbnThakwan, Hafs, Eisa, IbnJammaz, Roways or Rawh}. CurrentWord becomes word-7. The stoppingNarrators for word-7 becomes {(n,NO_HA_SAKT)| n is not Bazzi nor Qonbul} {(Roways, HA_SAKT), (Rawh, HA_SAKT)}. Note that there are no contradictions between currentReading and any of the readings for the previous words. There are no readings yet with EDGHAM_KABEER ( Table 2).
The currentWord (word-7) is read by currentNarrator (Qaloon) with currentReading (NO_HA_SAKT). All stoppingNarrators read with this reading, thus all of them will join the walkingNarrators. All pairs with the NO_HA_SAKT reading will be removed from the 10 the twenty pairs: one pair for each narrator with the DEFAULT e will happen for word-2 because it is read in one way only for word-3 with stoppingNarrators composed of twenty-two pairs: ith the QASR_LA reading (which is the default reading for irs will be added: (Khalaf, MAD_LA) and (Khallad, MAD_LA).
maz, Roways, Rawh, Finished Completely: Shuba, AbuAlharith, DoriAlkisaee, Ishaq, Idrees orithm to show how the first pass is generated. Initially, the currentWord is word-1 s set contains twenty pairs, one pair for each narrator with the DEFAULT reading. will be Qaloon because he is the highest in rank among the narrators in urrentNarrator will not change until the end of the pass. All narrators will join ause all of them read currentWord like the currentNarrator (Qaloon). All the pairs, ill be removed from stoppingNarrators for word-1 because none of them read it in word-1 is not the last word in the ayah, currentWord becomes word-2. The ord-2 will contain the twenty pairs: one pair for each narrator with the DEFAULT n starts and the same will happen for word-2 because it is read in one way only for entWord becomes word-3 with stoppingNarrators composed of twenty-two pairs: twenty narrators with the QASR_LA reading (which is the default reading for e). Another two pairs will be added: (Khalaf, MAD_LA) and (Khallad, MAD_LA).

rd-3)
is read with QASR_LA reading (currentReading will be QASR_LA). This is ich Qaloon reads word-3. All narrators read word-3 with currentReading, thus they Narrators. The stoppingNarrators for word-3 will reduce down to {(Khalaf, MAD_LA)}. This is because they have another reading for word-3 (MAD_LA). omes word-4 and its stoppingNarrators will be the twenty pairs for all narrators with de.
Since word-7 is the last word of the ayah, currentWord is set to be the word -with stopping narrators -that is closest to the end of the ayah, which is word-7 itself. As a result, currentWord becomes word-7. By this, the first pass is finished and the situation will be as shown in Table 4. Partially finished narrators are those who are still stopping at some word of the ayah. They still have some other readings to come in later passes. The completely finished narrators are not stopping anywhere and all their readings are covered.
The second pass will start with the right backward arrow in Figure  2. The currentWord is word-7 with stoppingNarrators of {(Roways, HA_SAKT), (Rawh, HA_SAKT)}. The currentNarrator is set to be the narrator with the highest rank among the stoppingNarrators of word-7 (that is, Roways). The reciter will read word-7 with (HA_ SAKT) for currentNarrator (Roways). Both Roways and Rawh join WalkingNarrators. Both narrators will also be removed from stoppingNarrators for word-7. Therefore, stoppingNarrators for word-7 becomes empty. Since word-7 is the last word in the ayah, currentWord will be set to the word with stopping narrators that are closest to the end of the ayah. Thus, it will be set to word-6 and a new pass starts.
In pass-2, the reciter does not start reading from the beginning of the ayah because this earlier part of the ayah has been covered implicitly in the nearest previous pass(es). Although one word only is read in this pass, this pass corresponds to the narration for the whole ayah.
The narrations of the whole ayah can be rebuilt by concatenating the part that is read in this pass, with the latest readings of the preceding words in the nearest previous pass(es). These last readings are stored in wordReadingVector. For pass-2, the corresponding whole ayah narration is the same as the first pass, except that word-7 is to be read with HA_SAKT reading. By the end of this pass, Roways and Rawh have finished partially because they are still stopping at word-5 and word-6.
The following section will explore pass-7 to illustrate the case where contradicting readings for a narrator co-exist. The stopping narrators at the end of pass-6 are shown in Table 5. CurrentWord is set to be the closest word to the end of the ayah with stopping narrators (word-5).

AUTOMATION OF THE GATHERING PROCESS
A software system was developed to automate the process of gathering of Quranic readings. The main algorithm (Figure 3) takes the text of the ayah as input to gather readings. The programme goes through the ayah word by word by summoning BUILD-WORD-READINGS to identify the different readings for the words. Then, the ayah readings tree is built and traversed to generate the gathering text file.

Building Word Readings Tree
The BUILD-WORD-READINGS algorithm ( Figure 4) takes a word as input. The letter Reading Generators are applied one after another on the letters of word via the APPLY algorithm. A letter reading generator is the software unit that detects and defines a reading for a letter. It is identified by a condition and a letter reading code. If one letter of word has more than one reading, then word has multiple readings. Once the readings of all the letters are determined, the readings of word as a whole are constructed by summoning BUILD-WORD-TREE and TRAVERSE-WORD-TREE algorithms.
The APPLY algorithm ( Figure 5) takes letterReadingGenerator and letter as input. If letter satisfies the letterReadingGenerator's condition, a letterReading object is created by identifying the corresponding letter reading code and is then added to letter's readings list. Before applying letter reading generators, every letter has only one letter reading object in its readings list (called firstReading with DEFAULT reading code). When a new letterReading is added to the letter's reading list, the firstReading code should be updated. If it is the DEFAULT reading, the firstReading code is set to be the default reading code of letterReading. Otherwise, it is set to be the 12 AUTOMATION OF THE GATHERING PROCESS ftware system was developed to automate the process of gathering of Quranic readings. T ithm (Figure 3) takes the text of the ayah as input to gather readings. The programme goes yah word by word by summoning BUILD-WORD-READINGS to identify the different rea ords. Then, the ayah readings tree is built and traversed to generate the gathering text file.

13
APPLY algorithm ( Figure 5) takes letterReadingGenerator and letter as input. If letter satisfies rReadingGenerator's condition, a letterReading object is created by identifying the correspond r reading code and is then added to letter's readings list. Before applying letter reading genera y letter has only one letter reading object in its readings list (called firstReading with DEFAU ing code). When a new letterReading is added to the letter's reading list, the firstReading code sh pdated. If it is the DEFAULT reading, the firstReading code is set to be the default reading cod rReading. Otherwise, it is set to be the composition of the firstReading code and the default rea of letterReading.

Figure 4. BUILD-WORD-READINGS algorithm.
llustrate the APPLY algorithm, take for example word-5 ‫)فيه(‬ in the ayah example. Two letter read rator conditions are satisfied at the letter ( ‫:)ـه‬ silat_ha_alkinaya_generator, am_kabeer_generator. First, a letter Reading object -with SILAT_HA_ALKINAYA reading co eated and added to the readings list of the letter ( ‫.)ـه‬ The letter reading codes attributes are mainta composition of the firstReading code and the default reading code of letterReading.

BUILD-WORD-READINGS Algorithm
To illustrate the APPLY algorithm, take for example word-5 in the ayah example. Two letter readings generator conditions are satisfied at the letter : silat_ha_alkinaya_generator, and edgham_ kabeer_generator. First, a letter Reading object -with SILAT_HA_ ALKINAYA reading code -is created and added to the readings list of the letter . The letter reading codes attributes are maintained in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter , will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA ( Figure 6).

APPLY Algorithm
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter . Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7).

Figure 6
The Letter Readings List for the Letter After Applying Silat_ha_ alkinaya_generator

Figure 7
The Letter Readings for the Letter After Applying Edgham_ kabeer_generator 14 in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter ‫,)ـه(‬ will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA (Figure 6).

Figure 5. APPLY algorithm.
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter ( ‫.)ــه‬ Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7). 14 in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter ‫,)ـه(‬ will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA (Figure 6).

Figure 5. APPLY algorithm.
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter ( ‫.)ــه‬ Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7). 14 in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter ‫,)ـه(‬ will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA (Figure 6).

Figure 5. APPLY algorithm.
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter ( ‫.)ــه‬ Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7).

word-5 ( ‫)فيه‬
letter ‫)ـه(‬ 14 in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter ‫,)ـه(‬ will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA (Figure 6).

Figure 5. APPLY algorithm.
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter ( ‫.)ــه‬ Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7). in a database. These attributes include description, contradicting reading codes, default reading code, and narrators. Every reading code has a default reading code that is associated with it. The default of a reading code can be viewed as its opposite. The default reading code for SILAT_HA_ALKINAYA is QASR_HA_ALKINAYA. Adding SILAT_HA_ALKINAYA letter reading to the letters reading list of the letter ‫,)ـه(‬ will change the firstReading code from DEFAULT to QASR_HA_ALKINAYA (Figure 6).

Figure 5. APPLY algorithm.
When edgham_kabeer_generator is applied, another letterReading will be created and added to the readings list of the letter ( ‫.)ــه‬ Since the firstReading code is not DEFAULT, its code will be changed to be the default composite of the two letter readings that were added to the letter (Figure 7). BUILD-WORD-TREE algorithm (Figure 8) takes a word with one or more letters with multiple readings as input. The word letters are taken one by one. If currentLetter is the first letter in word with multiple readings, the root word tree node is created. A tree node block will be created for every reading of currentWord and is then inserted into the root. The narrators of the root tree node blocks will be set as the narrators of the corresponding letter reading. Every currentLetter in word with multiple readings will result in adding a new level to the word tree. A new level is created by creating new word tree nodes to be the children of every word tree node block in the previous level. For every reading of the currentLetter, a new word tree node block is created and inserted into the new level tree nodes. Narrators for the new word tree node blocks will be set as the intersection of the narrators of the newly created word tree node blocks and the narrators of the parent word tree node block. If this intersection is empty, then the corresponding tree node block is eliminated from its tree node.

BUILD-WORD-TREE Algorithm
The word tree for word-5 is shown in Figure 9. The word tree is composed of one tree node only (the root). This is because there is BUILD-WORD-TREE algorithm (Figure 8) takes a word with one or more letters with multiple readings as input. The word letters are taken one by one. If currentLetter is the first letter in word with multiple readings, the root word tree node is created. A tree node block will be created for every reading of currentWord and is then inserted into the root. The narrators of the root tree node blocks will be set as the narrators of the corresponding letter reading. Every currentLetter in word with multiple readings will result in adding a new level to the word tree. A new level is created by creating new word tree nodes to be the children of every word tree node block in the previous level. For every reading of the currentLetter, a new word tree node block is created and inserted into the new level tree nodes. Narrators for the new word tree node blocks will be set as the intersection of the narrators of the newly created word tree node blocks and the narrators of the parent word tree node block. If this intersection is empty, then the corresponding tree node block is eliminated from its tree node. The word tree for word-5 is shown in Figure 9. The word tree is composed of one tree node only (the root). This is because there is only one letter in this word with multiple readings. The word tree node of word-5 consists of three tree node blocks because there are three different readings for ( ‫.)ـه‬ only one letter in this word with multiple readings. The word tree node of word-5 consists of three tree node blocks because there are three different readings for

Figure 9
The Word Tree Node for Word-5 with Three Tree Node Blocks The word tree for the word-5 example is too simple. To better illustrate the algorithm, a tree will be built for a word with many letters and multiple readings. Consider the word Jibreel with letter readings shown in Table 6. There are two different readings for the letter , two different readings for the letter , and three different readings for the letter .  e word tree for word-5 is shown in Figure 9. The word tree is composed of one tree node only (the is is because there is only one letter in this word with multiple readings. The word tree node of w nsists of three tree node blocks because there are three different readings for ( ‫.)ـه‬ Table 6 Letter Readings of the Word Jibreel ‫)جبريل(‬

Letter
Readings letter ‫)يـ(‬ Table 6 Letter Readings of the W           The word tree will be built as follows: first, the root is built, which corresponds to the letter readings of the first letter in the word with multiple readings (Figure 10). In the second level, a word tree node is added for every word tree node block in the level above. A new word tree node block will be added for every reading for the letter in the newly created tree nodes. The set of narrators of a new word tree node block will be the narrators' intersection of the letter reading with the narrators in the parent word tree node block. For example, the narrators in the word tree node block of in the left word tree node are Bazzi and Qonbul. This was found by intersecting the narrators in the parent word tree node block with the narrators of the reading. Tree node blocks with no narrators are shaded because there are no narrators in the intersection. These word tree node blocks should be eliminated; however, they are kept in the figure for illustration only. The same process is repeated for the third letter with multiple readings will be built as follows: first, the root is built, which corresponds to the letter readings of the he word with multiple readings ‫)جـ(‬ (Figure 10). In the second level, a word tree node is added d tree node block in the level above. A new word tree node block will be added for every e letter ‫)ـر(‬ in the newly created tree nodes. The set of narrators of a new word tree node block rators' intersection of the letter reading with the narrators in the parent word tree node block. the narrators in the word tree node block of ( ‫)ـر‬ in the left word tree node are Bazzi and was found by intersecting the narrators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the e ( ‫)ـر‬ reading. Tree node blocks with no narrators are shaded because there are no narrators tion. These word tree node blocks should be eliminated; however, they are kept in the figure only. The same process is repeated for the third letter with multiple readings ‫.)يـ(‬ . The word tree for the word (Jibreel).
d tree will be built as follows: first, the root is built, which corresponds to the letter readings of the er in the word with multiple readings ‫)جـ(‬ (Figure 10). In the second level, a word tree node is added y word tree node block in the level above. A new word tree node block will be added for every for the letter ‫)ـر(‬ in the newly created tree nodes. The set of narrators of a new word tree node block he narrators' intersection of the letter reading with the narrators in the parent word tree node block. mple, the narrators in the word tree node block of ( ‫)ـر‬ in the left word tree node are Bazzi and This was found by intersecting the narrators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the s of the ( ‫)ـر‬ reading. Tree node blocks with no narrators are shaded because there are no narrators tersection. These word tree node blocks should be eliminated; however, they are kept in the figure tration only. The same process is repeated for the third letter with multiple readings ‫.)يـ(‬ d tree will be built as follows: first, the root is built, which corresponds to the letter readings of the er in the word with multiple readings ‫)جـ(‬ (Figure 10). In the second level, a word tree node is added y word tree node block in the level above. A new word tree node block will be added for every for the letter ‫)ـر(‬ in the newly created tree nodes. The set of narrators of a new word tree node block he narrators' intersection of the letter reading with the narrators in the parent word tree node block. mple, the narrators in the word tree node block of ( ‫)ـر‬ in the left word tree node are Bazzi and This was found by intersecting the narrators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the s of the ( ‫)ـر‬ reading. Tree node blocks with no narrators are shaded because there are no narrators tersection. These word tree node blocks should be eliminated; however, they are kept in the figure tration only. The same process is repeated for the third letter with multiple readings ‫.)يـ(‬ t is built, which corresponds to the letter readings of the Figure 10). In the second level, a word tree node is added e. A new word tree node block will be added for every odes. The set of narrators of a new word tree node block ing with the narrators in the parent word tree node block. block of ( ‫)ـر‬ in the left word tree node are Bazzi and ators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the h no narrators are shaded because there are no narrators ould be eliminated; however, they are kept in the figure for the third letter with multiple readings ‫.)يـ(‬ The word tree will be built as follows: first, first letter in the word with multiple readings for every word tree node block in the level reading for the letter ‫)ـر(‬ in the newly created will be the narrators' intersection of the lette For example, the narrators in the word tree Qonbul. This was found by intersecting th narrators of the ( ‫)ـر‬ reading. Tree node bloc in the intersection. These word tree node blo for illustration only. The same process is rep will be built as follows: first, the root is built, which corresponds to the letter readings of the he word with multiple readings ‫)جـ(‬ (Figure 10). In the second level, a word tree node is added d tree node block in the level above. A new word tree node block will be added for every e letter ‫)ـر(‬ in the newly created tree nodes. The set of narrators of a new word tree node block rrators' intersection of the letter reading with the narrators in the parent word tree node block. the narrators in the word tree node block of ( ‫)ـر‬ in the left word tree node are Bazzi and was found by intersecting the narrators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the e ( ‫)ـر‬ reading. Tree node blocks with no narrators are shaded because there are no narrators tion. These word tree node blocks should be eliminated; however, they are kept in the figure only. The same process is repeated for the third letter with multiple readings ‫.)يـ(‬

Figure 10
The Word Tree for the Word (Jibreel) Every path from a root word tree node block to a non-shaded leaf word tree node block corresponds to one reading for the word as a whole. The narrators of this word reading are the narrators of the corresponding leaf tree node block ( Table 7). The reading code of the word is the set of the reading codes of its letters. first letter in the word with multiple readings ‫)جـ(‬ (Figure 10). In the second level, a word tree node is added for every word tree node block in the level above. A new word tree node block will be added for every reading for the letter ‫)ـر(‬ in the newly created tree nodes. The set of narrators of a new word tree node block will be the narrators' intersection of the letter reading with the narrators in the parent word tree node block. For example, the narrators in the word tree node block of ( ‫)ـر‬ in the left word tree node are Bazzi and Qonbul. This was found by intersecting the narrators in the parent word tree node block ( ‫ـ‬ ‫)ج‬ with the narrators of the ( ‫)ـر‬ reading. Tree node blocks with no narrators are shaded because there are no narrators in the intersection. These word tree node blocks should be eliminated; however, they are kept in the figure for illustration only. The same process is repeated for the third letter with multiple readings ‫.)يـ(‬ Figure 10. The word tree for the word (Jibreel).
Every path from a root word tree node block to a non-shaded leaf word tree node block corresponds to one reading for the word as a whole. The narrators of this word reading are the narrators of the corresponding leaf tree node block ( Table 7). The reading code of the word is the set of the reading codes of its letters.

Ayah Readings Tree
Once the different readings of the words of the ayah are defined, the different readings of the ayah as a whole can be defined by building ayah readings tree. The BUILD-AYAH-TREE algorithm ( Figure  11) is beckoned by the main algorithm (Figure 3). Building the ayah reading tree is very similar to building the word reading tree, except that it runs on the word readings instead of letter readings. The algorithm goes through the words of the ayah word by word. If currentWord has only one reading, it becomes the next word of the ayah. If currentWord is the first word with multiple readings in the ayah, the algorithm will build the root tree node with a tree node block for every reading of currentWord. Narrators are set to be the narrators of the corresponding reading. Then, currentWord will be set to be the next word of the ayah. If the currentWord is not the first word with multiple readings in the ayah, a new level is built into the tree by summoning BUILD-NEW-LEVEL ( Figure 12). Finally, the root of the ayah readings tree will be returned after visiting all the words of the ayah. If the ayah has no words with multiple readings, no tree will be built. To be precise, there is only one reading for this ayah.

Ayah Readings Tree
Once the different readings of the words of the ayah are defined, the different readings of the ayah as a whole can be defined by building ayah readings tree. The BUILD-AYAH-TREE algorithm ( Figure 11) is beckoned by the main algorithm ( Figure 3). Building the ayah reading tree is very similar to building the word reading tree, except that it runs on the word readings instead of letter readings. The algorithm goes through the words of the ayah word by word. If currentWord has only one reading, it becomes the next word of the ayah. If currentWord is the first word with multiple readings in the ayah, the algorithm will build the root tree node with a tree node block for every reading of currentWord. Narrators are set to be the narrators of the corresponding reading. Then, currentWord will be set to be the next word of the ayah. If the currentWord is not the first word with multiple readings in the ayah, a new level is built into the tree by summoning BUILD-NEW-LEVEL ( Figure 12). Finally, the root of the ayah readings tree will be returned after visiting all the words of the ayah. If the ayah has no words with multiple readings, no tree will be built. To be precise, there is only one reading for this ayah. The BUILD-NEW-LEVEL algorithm ( Figure 12) is beckoned in case the currentWord is not the first word with multiple readings. A new ayah tree node will be created as a child for every ayah tree node block in the previous level. An ayah tree node block will be created for every reading for currentWord with narrators to be the intersection of corresponding reading and the narrators of the parent tree node block. Narrators of the new tree node block with contradictions and an ancestor tree node block reading will be eliminated by summoning the ELIMINATE-NARRATORS-WITH-CONTRADICTIONS algorithm. Only if the narrators set of the new tree node block is not empty, it will be inserted into the new ayah tree node.

BUILD-NEW-LEVEL Algorithm
The ELIMINATE-NARRATORS-WITH-CONTRADICTIONS algorithm ( Figure 13) is beckoned before adding a new ayah tree node block The BUILD-NEW-LEVEL algorithm (Figure 12) is beckoned in case the currentWord is not the first word with multiple readings. A new ayah tree node will be created as a child for every ayah tree node block in the previous level. An ayah tree node block will be created for every reading for currentWord with narrators to be the intersection of corresponding reading and the narrators of the parent tree node block. Narrators of the new tree node block with contradictions and an ancestor tree node block reading will be eliminated by summoning the ELIMINATE-NARRATORS-WITH-CONTRADICTIONS algorithm. Only if the narrators set of the new tree node block is not empty, it will be inserted into the new ayah tree node. The ELIMINATE-NARRATORS-WITH-CONTRADICTIONS algorithm ( Figure 13) is beckoned before adding a new ayah tree node block into a new ayah tree node for currentWord (in ayah readings tree). Its input is the newly created treeNodeBlock. The narrators of the new treeNodeBlock are taken one by one. It checks if a contradiction exists between one of the readings of the new treeNodeBlock with one of the readings of an ancestor tree node block for narrator. If a contradiction is found, that narrator is eliminated. into a new ayah tree node for currentWord (in ayah readings tree). Its input is the newly created treeNodeBlock. The narrators of the new treeNodeBlock are taken one by one. It checks if a contradiction exists between one of the readings of the new treeNodeBlock with one of the readings of an ancestor tree node block for narrator. If a contradiction is found, that narrator is eliminated.

ELIMINATE-NARRATORS-WITH CONTRADICTIONS Algorithm
The ayah readings tree for the example ayah (2:2) is shown in Figure  14. Every tree node block is identified by a sequence of numbers separated by dots. Each number represents the rank of the ancestor tree node block in its tree node. For example, the tree node block (1.2.2.1) is the tree node block that exists in the fourth level and descends from tree node block (1.2.2) in the third level, which descends from tree node block (1.2) in the second level, which descends from tree node block (1.) in the root. The tree node and tree node blocks within a tree node are ranked from right to left. igure 13. ELIMINATE-NARRATORS-WITH-CONTRADICTIONS algorithm. yah readings tree for the example ayah (2:2) is shown in Figure 14. Every tree node block is identifi equence of numbers separated by dots. Each number represents the rank of the ancestor tree no in its tree node. For example, the tree node block (1.2.2.1) is the tree node block that exists in t level and descends from tree node block (1.2.2) in the third level, which descends from tree no (1.2) in the second level, which descends from tree node block (1.) in the root. The tree node and tr blocks within a tree node are ranked from right to left. igure 14. Ayah readings tree. ration of the ayah readings gathering building the ayah readings tree, the tree is traversed in a well-defined order using the TRAVERS -TREE (root) algorithm to generate readings gathering text file ( Figure 15). First, the nextReadi

Figure 14
Ayah Readings Tree

Generation of the Ayah Readings Gathering
After building the ayah readings tree, the tree is traversed in a well-defined order using the TRAVERSE-AYAH-TREE (root) algorithm to generate readings gathering text file ( Figure 15). First, the nextReading of a given currentReading has to be defined. R next is beckoned to be the next reading of R current if R next satisfies one of the following four conditions. Remember that tree node blocks within tree nodes represent readings. Note that the tree nodes and readings within tree nodes are ranked from right to left (to match Arabic text direction). The first tree node in its level is the rightmost tree node, and the first reading is the rightmost reading in its tree node.

1.
If R current has a child, R next is the first reading in the tree node that is the child of R current . For example, in Figure 14, if R current is the reading (1.), then R next is the reading (1.1).

2.
If R current exists in the last level of the ayah readings tree and is not the last reading in its node, then R next will be the reading that exists immediately next to R current . For example, in Figure 14, if R current is the reading (1.1.1.1), then R next is the reading (1.1.1.2). 3.
If R current exists in the last level of the ayah readings tree, is the last reading in its node, and its parent reading is not the last . Figure 14. Ayah readings tree. reading in its node, then R next is the reading that exists directly next to its parent reading. For example, in Figure 14, if R current is the reading (1.1.1.2), then R next is the reading (1.1.2). 4.
If R current exists in the last level of the ayah readings tree, is the last reading in its node, and its parent reading is also the last reading in its node, R next will be the reading that exists immediately next to the closest ancestor of R current that is not the last in its node. For example, in Figure 14, if R current is the reading (1.2.2.1), then R next is the reading (1.3) and if R current is the reading (1.3.2.1), then R next is the reading (2.)

TRAVERSE-AYAH-TREE Algorithm
Summoning TRAVERSE-AYAH-TREE for the root of the tree in Figure 14 will result in visiting the tree node blocks in the following order: (1.), (1.1), (1.  1.2). 4. If Rcurrent exists in the last level of the ayah readings tree, is the last reading in its node, and its parent reading is also the last reading in its node, Rnext will be the reading that exists immediately next to the closest ancestor of Rcurrent that is not the last in its node. For example, in Figure 14, if Rcurrent is the reading (1.2.2.1), then Rnext is the reading (1.3) and if Rcurrent is the reading (1.3.2.1), then Rnext is the reading (2.)

Figure 15. TRAVERSE-AYAH-TREE algorithm.
Summoning TRAVERSE-AYAH-TREE for the root of the tree in Figure 14 will result in visiting the tree node blocks in the following order: (1.), (1.1), (1.  Table 3.

IMPLEMENTATION ISSUES
The present study implemented this system using Java following the object-orientation paradigm in analysis, design, and implementation. So far, the gathering was performed for Surah Al-Baqarah, which contains 286 ayahs with varying lengths.

System Validation
To assure the correctness of the generated gathering, the system was developed through a test-driven incremental process ( Figure 16). First, the AYAH_TRAVERSE_TREE algorithm -that represents the gathering generation engine -was carefully programmed and tested. By this, it is guaranteed that any mismatch between the gathering that is generated by the system and the gathering found in the specialised gathering books occurs due to an incorrect ayah readings tree. An incorrect creation of ayah readings tree may result from: (1) a missing letter reading that was not added to a letter; or (2) wrongly adding a letter reading that should not be added; or (3) missing contradiction that should be defined. A missing letter reading may happen because the corresponding letter reading generator is not yet defined or due to a fault in its programming. The ayahs of Surah Al-Baqarah were taken one by one. This research referred to specialised books that described the readings of the words of the ayahs (Abdeen, 2006;Ibnu Al-Jazari, 2003;Salem, 2003;Tulba & Awadh, 2016). A word reading is viewed as a set of letter readings. For every new class of a letter reading, a reading generator was created by defining its condition and the corresponding reading code. Then, the ayah readings tree was built and tested. If the new letter reading was correctly modelled in the tree, the next step was to proceed to the next letter reading in the ayah that was not yet programmed. The process was repeated for every letter reading until all the ayah readings -and contradictions if anywere correctly and completely defined. If a mismatch was found, the reading generators were updated and new reading contradictions were formulated and stored. Then, the ayah readings tree was tested again. Once all the readings and contradictions for the current ayah were correct and complete, the next ayah was proceeded and the process was repeated.

Figure 16
System Development Process

Modelling the Holy Quran
The Holy Quran was modelled using the composite design pattern. The Quran is modelled as a vector of Surahs, a surah is modelled as a vector of ayahs, an ayah is modelled as a vector of words, and a word is modelled as a vector of letters. This research used three Quranic text files from (Tanzil Documents, n. d.): Uthmani, Simple, and Clean. Every Quranic word was maintained in three forms: Uthmani where the word text was as written in the Mos-haf, simple that used standard Arabic dictation with annotation signs (harakat), and finally clean that used standard Arabic dictation but without annotation signs. These forms were necessary for the Quranic word to ease writing reading generators' conditions.

Reading Generators
A reading generator is the component that defines the letter readings. Every reading generator is implemented as a Java class that contains all the functionality needed to define the readings and associate them with the Quranic letters. A reading generator is identified by a condition and a reading code, another functionality that is done by the generator that is identical for all generators. Reading code is modelled as a Java class with the attributes that are needed to define the reading. There are more than 300 generators and this makes the manual definition of the generators hard. Therefore, the present study defined 22 may result from: (1) a missing letter reading that was not added to a letter; or (2) wrongly adding a letter reading that should not be added; or (3) missing contradiction that should be defined. A missing letter reading may happen because the corresponding letter reading generator is not yet defined or due to a fault in its programming. The ayahs of Surah Al-Baqarah were taken one by one. This research referred to specialised books that described the readings of the words of the ayahs (Abdeen, 2006;Ibnu Al-Jazari, 2003;Salem, 2003;Tulba & Awadh, 2016). A word reading is viewed as a set of letter readings. For every new class of a letter reading, a reading generator was created by defining its condition and the corresponding reading code. Then, the ayah readings tree was built and tested. If the new letter reading was correctly modelled in the tree, the next step was to proceed to the next letter reading in the ayah that was not yet programmed. The process was repeated for every letter reading until all the ayah readings -and contradictions if any -were correctly and completely defined. If a mismatch was found, the reading generators were updated and new reading contradictions were formulated and stored. Then, the ayah readings tree was tested again. Once all the readings and contradictions for the current ayah were correct and complete, the next ayah was proceeded and the process was repeated. Figure 16. System development process.

Modelling the Holy Quran
The Holy Quran was modelled using the composite design pattern. The Quran is modelled as a vector of Surahs, a surah is modelled as a vector of ayahs, an ayah is modelled as a vector of words, and a word is modelled as a vector of letters. This research used three Quranic text files from (Tanzil Documents, n. d.): Uthmani, Simple, and Clean. Every Quranic word was maintained in three forms: Uthmani where the word text was as written in the Mos-haf, simple that used standard Arabic dictation with annotation signs (harakat), and finally clean that used standard Arabic dictation but without annotation signs. These forms LetterReadingGeneratorGenertor that automatically generated the reading generator code file given the condition and the reading code. Readings generators were instantiated into a vector and applied one by one on each of the letters of the input ayah.

Graphic Representation of the Ayah Readings Tree
A simple Graphical User Interface (GUI) to view the ayah readings tree using JTree was developed (Elliott et al., 2002). This GUI was very practical in verifying the letter generators and the ayah readings tree during system development. The ayah tree example in Figure 14 is shown in Figure 17. It can be seen that every tree node in the ayah gathering tree is represented by a JTree node. There are seven leaf tree nodes with nine leaf tree node blocks that correspond to the nine passes. There are two leaf tree nodes with two tree node blocks each. The selected JTree node contents are shown in the lower panel.

Figure 17
Ayah Gathering Tree in the Form of Jtree

CONCLUSION
In this paper, the gathering of the Quranic readings process was formalised and implemented by a software system. It is believed 23 were necessary for the Quranic word to ease writing reading generators' conditions.

Reading Generators
A reading generator is the component that defines the letter readings. Every reading generator is implemented as a Java class that contains all the functionality needed to define the readings and associate them with the Quranic letters. A reading generator is identified by a condition and a reading code, another functionality that is done by the generator that is identical for all generators. Reading code is modelled as a Java class with the attributes that are needed to define the reading. There are more than 300 generators and this makes the manual definition of the generators hard. Therefore, the present study defined LetterReadingGeneratorGenertor that automatically generated the reading generator code file given the condition and the reading code. Readings generators were instantiated into a vector and applied one by one on each of the letters of the input ayah.

Graphic Representation of the Ayah Readings Tree
A simple Graphical User Interface (GUI) to view the ayah readings tree using JTree was developed (Elliott et al., 2002). This GUI was very practical in verifying the letter generators and the ayah readings tree during system development. The ayah tree example in Figure 14 is shown in Figure 17. It can be seen that every tree node in the ayah gathering tree is represented by a JTree node. There are seven leaf tree nodes with nine leaf tree node blocks that correspond to the nine passes. There are two leaf tree nodes with two tree node blocks each. The selected JTree node contents are shown in the lower panel. CONCLUSION that this work is useful because it proved that a detailed gathering of Quranic readings can be generated using computers, which would be very hard to do manually. Moreover, this software system would be a good base to build upon more software systems to serve the field of Quranic readings like vocal generation of Quranic readings gathering. As future work, it is recommended to complete the system to cover the whole Quran and make it available for interested students. It would be interesting to generalise the gathering process to work for any number of narrations that are decided by the user.