THE ALGORITHM OF GIVING AUTOMATIC HARAKAT ON ARABIC SCRIPT

The majority of Arabic reference books in Arabic writing without a vowel/harakat cause students to have difficulty in learning Arabic. Reading Arabic Script without harakat requires an understanding of the science of Nahwu-Sharf (Arabic Grammar) to be able to understand its contents. Therefore, in this study the basic rules of Nahwu-Sharf Science have been translated into an algorithm that can be used to provide an automatic harakat on Arabic script (without harakat). Based on the interview results with the expert, six examples of sentences that represented the types(conditions) of basic sentences in the Arabic language have been used as scenarios to examine the generated algorithm. The allowed sentence is limited to one sentence only and cannot be in the form of poetry or satire. Additionally, Cyclomatic Complexity Testing is used to examine scenarios in a test case. All the steps of the Cyclomatic Complexity have been performed, which are creating the flowgraph, calculating the independent path, and testing scenario. The scenarios were examined in a test case through 13-path test case examination and result match with expected output. In addition, 24 examples which represented the six conditions have been utilized to examine for more detailed analysis and also results accuracy 100% in accordance with the basic rules of Nahwu-Sharf science.


INTRODUCTION
Learning Foreign languages provide many opportunities and benefits not just for personal needs but also in businesses, academics and communications.Arabic is one foreign language that is not less important to master, especially for Muslims around the world.Sirajudeen&Adebisi [1] suggested that Arabic is a Mother Language of over 300 million people and is used as a National Language in 20 countries.In Indonesia alone, some Indonesian words are adopted from Arabic.Chik [2] stated that there are 3303 Arabic words adopted into Malay.
Given the majority of Indonesian people are Muslims, learning Arabic can facilitate and improve their understanding of Islamic knowledge because Arabic is the language of the holy book of Al Quran and Hadith Scripture which are references for every Muslim in worship and daily life.Oxford [3] suggested that appropriate styles and strategies in learning language can be regarded as major factors in determining student's success in learning a foreign language.
However, in its implementation, Arabic writing which is not supplemented with a vowel/harakat making it difficult for students who want to master Arabic language in which they are accustomed to reading Arabic with harakat and only able to guess how to read Arabic writing without a vowel.This statement is supported by Greene [4] who stated that one of the challenges in learning Arabic is reading a text without vowels.
Al-Jurjani in Abdurrahman [5] also stated that Nahwu is the science that can specify how to arrange the structure of words correctly.In Arabic Grammar (Nahwu-Sharf Science), sentence is called Jumlah, which means a collection of several words.Sentences in Arabic are divided into two types, namely: Jumlah Ismiyah (noun) and Jumlah Fi"liyah (verb) [6].There are certain conditions in a particular case that depends on the position and the function of the word in the sentence, which are: Rafi", Nasb, Jarr and Jazm [7].If the word is singular, then to be able to see which case it belongs will depend on what harakah is at the end of the word [8].
In addition, nowadays computer technology can be found anywhere and has became a part of every day"s life.Web-based learning media that utilize technology can be a solution for students to learn reading Arabic writing without harakat.A correct translation of Nahwu-Sharf science into programming algorithms can be used in developing an automated harakat system of Arabic Writing.
An algorithm is a procedure that underlies each command in a computer program that can solve problems involving data processing, computations, or both [9].There are several ways to specify the algorithm, which are by using the natural language, pseudo code or flowchart.Natural language is the simplest technique to identify algorithms, but often programmers find it difficult to translate into programming languages.Therefore, programmers prefer to utilize other techniques that is clearer and more accurate, such as pseudo code, which is a combination of natural language and programming language.Meanwhile, flowchart can also be used to represent the algorithm in a graphical representation [10].
In order to test the algorithm, Pressman [11] defines Cyclomatic Complexity as a software matrix that provides quantitative measurements of the logical complexity of a program.This method determines the number of independent paths and provides a limit on the number of tests to be performed to ensure all statements have been executed at least once.Preferably, the Cyclomatic Complexity value is limited to 10 because the more complex the module, the more likely error will occur, the more difficult it is to understand, tested and modified [12].
From those statements above, the aim of this study is to develop an algorithm that can provide harakat automatically in Arabic script without harakat.Furthermore, Cyclomatic Complexity Testing will be utilized to examine the accuracy of the algorithm.

AUTOMATIC HARAKAT IN ARABIC SCRIPT
The research method starts from understanding the basic rules of the Nahwu-Sharf Science (Arabic Grammar) of giving automatic harakat in Arabic script without harakat, translating the rules into algorithm and finally, testing the algorithm whether it is in accordance with the rules or not (see Figure 1)

Data Collection Procedure
Some interviews with an Arabic Expert have been conducted to collect the data to understand the basic rules of Nahwu-Sharf Science (Arabic Grammar) of giving automatic harakat.Based on the interview results, the types of basic sentences in the Arabic language can be classified into some conditions as shown in the Table 1.

Translating the Rules into Algorithm
There are steps performed to translate the rules into algorithm which are design database and create flowchart of giving automatic harakat.

Database Design
Two tables were designed in the database to store "dictionary" and "conjunction"."Dictionary" table stores the words without harakat and the words with their harakat based on I"rab rules, which are: marfu, mansub, majzum and majrur (See Table 2).While, "Conjunction" table is created to store the conjunction of the sentence."Conjuntion" table consists of two fields, which are the conjunction word without harakat (field word) and its word with harakat (field hurf).(See Table 3).

The Flowchart of Giving Automatic Harakat
Figure 2 shows the flowchart of giving automatic algorithm on Arabic Script.

Start Input Sentence
Check the first, the second and the third word whether it is a conjunction or not and store in buffer

Check the First word
Is the first word a conjunction?
The checked word is the first word?

Yes
The checked word is the second word?

The Algorithm of Giving Automatic Harakat
The finding of this research is the algorithm that was designed based on the conditions explained in Table 1. Figure 3 shows the algorithm to give harakat automatically in Arabic script without harakat.
The explanation of the algorithm from Figure 3 is that: Number 1 to 2 (refer to the number written on the left in Figure 3): firstly, user will input a sentence into the system.One sentence consists of a maximum 4 words.System will check the first, the second and the third word whether it is a conjunction or not and save them as variables.Then, system will check word by word starting from the first.Number 3 to 5: System will check the database whether the first word is a conjunction.If yes, system will continue checking whether the word being checked is the first word.If yes, then the system will print the word (conjunction) with harakat.
Number 6 to 9: If the checked word is not the first word, system will check whether the word being checked is the second word.If yes, then system will continue checking whether the first word is ‫نى‬or ‫نًا‬or ‫ال‬ or ‫.ل‬If yes, then the system will print the word (majzum) with harakat.If no, then the system will print the word (majrur) with harakat.
Number 10 to 13: If the checked word is not the second word, system will check whether the word being checked is the third word.If yes, then system will continue checking whether the first word is ‫.ال‬If yes, then the system will print the word (manshub) with harakat.If no, then the system will print the word (marfu') with harakat.
Number 14 to 17: If the checked word is also not the third word, then system will check whether the first word is ‫نى‬or ‫نًا‬or ‫ال‬or ‫.ل‬If yes, then the system will print the word (manshub) with harakat.If no, then the system will print the word (marfu') with harakat.
Number 18 to 21: If the first word is not a conjunction, then system will check whether the checked word is the third word and the third word is not a conjunction.Then, system will continue checking whether the second word is a conjunction.If yes, then system will print the word (majrur) with harakat.If no, system will print the word (manshub) with harakat.
Number 22 to 23: If the checked word is the third word and the third word is a conjunction, then system will print the word (conjunction) with harakat.
Number 24 to 25: If the checked word is not the third word and the third word is not a conjunction, then system will check whether the checked word is the forth word and the third word is a conjunction.If yes, system will print the word (majrur) with harakat.If no, then system will print the word (marfu') with harakat.
Number 26 to 28: Other than above conditions mentioned, means that the checked word is marfu", then the system will print the word (marfu') with harakat.Finally, after finish checking all the words one by one, the system will display the sentence with harakat.

Figure 3. The Algorithm of Giving Automatic
Harakat.

The Algorithm Testing
The algorithm testing has been done by utilizing Cyclomatic Complexity White Box Testing.There are three steps in this testing method, as follows: 1) Create the Flowgraph Figure 4 shows the flowgraph of the algorithm.The number of the node in the flowgraph refer to the number in the left from algorithm in Figure 3 (number 1 untill 28).
So, there will be 13 independent paths that need to be examined which is shown in Table 3. 3) Create Test Case The independent path obtained in Table 3 will be examined using a test case scenario.Based on the interview results with experts conducted earlier and have been explained also in Table 1, there are six examples of sentences that will be used for the test case scenario.See Table 4.

No
Input Sentence Expected Result ., The Algorithm of Giving… 61 Test case of the algorithm can be seen in Table 5.Furthermore, 24 sentences have been added to be examined for more detailed analysis.

Table 1 .
The basic rules of Arabic Grammar

Table 2 .
Table Structure for Table "Dictionary"

Table 3 :
Table Structure for Table "Conjunction"

Table 5 :
Test Case of the Algorithm

Table 5 :
Test Case of the Algorithm (contd.)

Table 5 :
Test Case of the Algorithm (contd.)

Table 6 :
More Samples Examination