Implementation of Winnowing Algorithm Based K-Gram to Identify Plagiarism on File Text-Based Document

Plagiarism occurs when the students have tasks and pursued by the deadline. Plagiarism is considered as the fastest way to accomplish the tasks. This reason makes the author tried to build a plagiarism detection system with Winnowing algorithm as document similarity search algorithm. The documents that being tested are Indonesian journals with extension .doc, .docx, and/or .txt. Similarity calculation process through two stages, the first is the process of making a document fingerprint using Winnowing algorithm and the second is using Jaccard coefficient similarity. In order to develop this system, the author used iterative waterfall model approach. The main objective of this project is to determine the level of plagiarism. It is expected to prevent plagiarism either intentionally or unintentionally before our journal published by displaying the percentage of similarity in the journals that we make.


Introduction
The rapid technology improvement does give not only positive effect on daily life but also gives negative influences that cannot be avoided. In this era, information is easy to get and influence people. One of the negative impacts is the great number of plagiarism [1]. Plagiarism often occurs when the students have tasks and pursued by the deadline. The students consider that conducting plagiarism is the fastest way to accomplish the assignment [2].
Students regard that doing plagiarism is the instant way to accomplish their assignments [3]. Those factors influence the result of the evaluation. This issue also makes an obstacle for teachers in detecting plagiarism regarding the numerous task file and the scientific work. One of the functions of technology is that it can be used as an alternative to identifying plagiarism regarding that has been so many scientific works published in electronic. Thus the identifying process becomes much easier.
The technology is used, which means the author uses the computer application to do the calculation of text-document similarity [4]. The algorithm selection on text-document similarity search is very affecting [5]. A mistake in algorithm selection may decrease the accuracy of document similarity calculation [6]. Winnowing algorithm is a method of word similarity search in a document by comparing the fingerprint on the document [7], the algorithm input is the text document which is processed and result in output in the form of hash value. That hash value is then called as the fingerprint. This is the fingerprint which is used to compare the similarity of each document.
There are some basic needs that are used by winnowing algorithm in detecting the document similarity. The basic needs which have to be accomplished by detection algorithm are [8,9]: i) Whitespace insensitivity, it is a word search which is not influenced by space, punctuation, type of letter (capital or normal), etc. ii) Noise suppression, the function is to avoid the finding of short word and not the common word such as "the" iii) Position independence, it is a similarity finding that does not have to depend on the word position, so words with different order still can be recognized if there is a similarity. Generally, the work principles of the algorithm in the document-similarity detection are (in a few steps): i) Both the target text and the original text are assumed as string s with the length t ii) Conducting the cleaning of punctuation, space, etc. which refer to the basic needs of detection algorithm iii) Dividing the document to be k-gram, that is as parameter selected by the user. K-Gram is the sub-string that is alongside with the length of character k. iv) Finding Hash Value from each k-gram v) Selecting some hash result to be the fingerprint document. The difference of Winnowing Algorithm and another algorithm of similarity detector is in the selection process of its fingerprint. The result of hash value calculation is divided into window w in which the smallest value will be taken from each window to be the document fingerprint.

Research method
This research used the designing method and system development method. To do that method, we use software for life cycle development by adopting the iterative waterfall model.

System requirements analysis
The analysis system is needed at the early stage in designing and developing the system to determine the needs of plagiarism detection system that will build. On this stage, the researcher conducted literature study that learnt the retrieval information system and fingerprint document method using winnowing algorithm to identify the similarity of text document through all sorts of media, those are the internet, journals and books refer to plagiarism and text processing to get the view of winnowing algorithm that is going to be used on the system as the algorithm to detect the document similarity and what data needed to build that system.

a) Winnowing Algorithm as Algorithm of document similarity search
The selected result of winnowing algorithm as the algorithm of document similarity search was based on the accuracy stage and the time speed of the process by referring to the previous research that is written in the bibliography. The stage of winnowing algorithm process that is implemented in the system is described in Figure 1 below.

Fig. 1.
Stage of the fingerprint makes using winnowing algorithm.

b) Data needed by system
The data used to build the system of plagiarism detection is Journal Data. The journal data of the system will be renewed by both administration and student as a user nonadministrator. However, the student can only upload a journal which has been approved by the administrator. If the journal is already approved, it can be saved in the database and used as the reference by other students for next verification in order to avoid the damage of the journal data in the database. Database for the journal is divided into two table: i) Table of field study It is a table that saves the data of field study category which functions to divide the journal based on each category of its field study. ii) Table of Journal  Table of journal is a table that saves journal data both specifically about the journal or the fingerprints as the result of processing using winnowing algorithm.

System design
Stage of the system designing which is going to build uses UNIFIED Modeling Language (UML) that supports the model concept of programming based on Object-Oriented Programming (OOP) as will be applied to program code writingstage. This stage will result in modeling documentation; those are Business Process, Use Case Diagram, Use Case Scenario, Sequence Diagram, Activity Diagram, Class Diagram, and Entity Relationship Diagram (ERD).

Implementation
Implementation stage is the conversion process of the system design into the program code. A system that is going to be built is written by language program of Page Hypertext data that is needed anytime and can be re-accessed. The local server uses XAMPP application which supports apache to build an application based on web and database that was used MySql (PhpMyadmin).

Testing
After the implementation process, the next stage is system testing. This research conducted two methods of system testing; those are white box testing and black box testing. White Box Testing is testing on the module of program coding to guarantee that the program code is clear from syntax or logical error. Black Box Testing is a testing that emphasizes on system functionality testing in order to get the expectation result.

The design and the planning
The design and the planning of the plagiarism detection systems using winnowing algorithm as the algorithm on similarity document search explained the functional need and also non-functional need, use case diagram, and Entity Relationship Diagram (ERD).
1. The functional need-system is a need that has to be owned by the system. The functional need-system of the plagiarism detection used winnowing algorithm as below: i) The system which used login feature to authenticate the access right of its user. ii) The system can save the user"s data on user register feature. iii) The system can update the user"s data. iv) The system can show the user"s data in the database. v) The system can manage the journal data (insert, update, delete). vi) The system can show the journal data of the database. vii) The system can show the log activity of the user. viii) The system is available in calculating the similarity of the journal document that is uploaded to the system. ix) The system is available to show the calculation result of the journal document similarity which is uploaded.
2. The Non-Functional need is the addition need to complete the system. The nonfunctional needs are: i) System based on web. ii) System that uses CodeIgniter framework.
3. Entity Relationship Diagram is a data structure data and the relation of the data. The object in ERD is usually described in an entity which has attributes that relate to other entities. The process of system making in this research used nine entities. Those entities have been normalized to collect the data in the database that is related using one to many relations. Entity relationship diagram of plagiarism detector can be seen in Figure 2 and Figure 3 below.

Discussion
Winnowing algorithm implementation in this system is also feature of new journal data that can be accessed by the user administration and on the feature that checks the journal plagued in which can be accessed by user students. Those two features have the fingerprint making process that uses winnowing algorithm. Every word of the journal file is uploaded first to through the filtering process, that is the cleaning process of punctuation, space, etc. by referring to the basic need of algorithm detector. In this research, the writer added the stemming process that functions to change every word in the journal to be a basic word.

Stemming and filtering
Stemming is the part of retrieval (IR) information process; it changes the word into its basic word before doing the indexing process [10]. The stemming of Indonesian is different from the stemming of English. The stemming process of Indonesian is more complicated because Indonesian has prefixes, infixes, suffixes, and combination between confix.
The stemming and filtering process of the system are included in stemmer and filtering function method. Before processing the file using those methods, the file has to be processed into document extraction process. This stage is conducted in order to get the content of the document file. The process of content extraction is included into get_content() method that can be seen in Figure 4. Get_content() method needs a parameter in the form of file extension and saved file location. Furthermore, the file extension will be checked. If the file extension accomplishes the system certainty, it will be processed into extraction of the document file content. The output of this process is string in document file content which is placed in variable "$isi_file".
The next process is stemming process and filtering process which is implemented into stemmer and filtering function method. Those methods can be seen on Figure 5 and Figure  6 below The stemming process on the system needs parameter input as string that is collected from the extraction process of document file content. The result of stemming process is placed in variable $hasil_stem. While the filtering process cleans the sentences from punctuation, space, the conversion of capital letters, and the number elimination.

Process of K-Gram forming
K-Gram forming is a process that converts string into sub-string gram. K-Gram is a substring series that is along with length k.
The process of gram forming on the system is included in the function method of parsing_gram. Gram forming process needs two parameters. Those parameters are string of the stemming process and the filtering process and also value k. Value k functions to check whether the result of every gram is suitable with value k that has been determined. The parsing_gram method can be seen on Figure 7. Those are the result gram forming process showed by the system to ensure that the gram forming is suitable with the concept of winnowing algorithm. The appearance of gram forming on the comparison sentence file that has been processed on stemming can be seen on Figure 8 below.

The conversion process of Hash value
Firstly, every character in gram is converted into value ASCII. It is done before doing the calculation of rolling hash value. Hash formulation is defined as Equation 1.
Explanation: c: value ASCII character b: basis of primes k: value k-gram/many characters on Rolling Hash Gram has an advantage to search the hash H (c2...ck+1) by using the earned value on hash H c1...ck function hash H (c2...ck+1 can be done by Equation 2.
The forming process of the window on the system is included into the parsing_window function. Window process needs two parameters. Those are each conversion of hash value and value w. The value w functions to check whether the window forming result is suitable with value w that has been determined.
The conversion process uses the looping process for each conversion in each gram into hash value. Every character in each gran is converted into ASCII value with the help of function that has been given by language program php "ord function". Next, hash value is put into the array and next it is showed by the system.

The forming process of Window w
Forming window is a conversion process of hash value into windows. The window forming process of the system is included into parsing_window function method. Window forming method needs two parameters. First, it is the result of hash value and value w conversion. Value w functions to check whether the result of window forming is already suitable with value w that has been determined.
The result of window forming process is showed by the system to ensure the window forming is suitable with the winnowing concept.

The process of fingerprint selection
Fingerprint selection is the forming fingerprint process. It is conducted by selecting the minimum hash value of each different window that has been made before. If there are similar values in a different window, just choose one of those value to be the fingerprint.
The fingerprint selection process of the system is included into function fingerprint method. The fingerprint selection process needs the parameter of window w forming result. This process uses the looping function to select the minimum value on each window and array_unique function to ensure that there is no similar value on the array as the result of fingerprint selection. The fingerprint method can be seen on Figure 9  The result of fingerprint selection process is showed by the system to ensure that the fingerprint selection is suitable with winnowing algorithm system.

The calculation process of document similarity
The similarity calculation using Jaccard coefficient similarity. Jaccard Coefficient Similarity is similarity measurement standard that compares two sets, P and Q [11]. The general pattern of Jaccard"s Coefficient Similarity formulation can be seen in equation 3.

 
Explanation: Jacc (P, Q) : similarity value |P  Q| : the similar fingerprints number of P and Q |P  Q|: fingerprint p that does n ot have Q is added by number of fingerprint Q, that does not belong to P is added by the number of similar fingerprint between P and Q.
The similarity calculation process on the system is included into proses_hitung method (process_calculation). System searches the difference of the value in both array using function array_diff and then count the number of array using count function. The result of similarity calculation process can be seen in Figure 10 below.

Summary
i) This application is free and can be used for every journal, daily tasks and final task that is written in Bahasa Indonesia as the priority. Users can make their own database that can check plagiarism from every journals, daily tasks and final task that is written before. ii) Winnowing algorithm as the algorithm fingerprint document and Jaccard coefficient similarity as the similarity measurement standard can be applied in finding the similarity percentage of text document. The journal document as the input process using winnowing algorithm for the document's fingerprint-forming. The fingerprint of each document is calculated using Jaccard coefficient similarity formulation in order to get the similarity percentage. The researcher also added the stemming process to winnowing algorithm in order to get higher accuracy. iii) Winnowing algorithm error value with stemming process has less error value 1.63 %, whereas Winnowing algorithm without stemming process has error value 0.69 % Hopefully, the advice below can be used for further research to reach a better result: a. The addition process of undescriptive word elimination, such as "yang", "dan", "di", "dari", etc. may give a higher accuracy. b. The journal document can be processed by a more diverse system by adding the document in .pdf extension which has been suitable for the journal writing format (two column). Determination of gram value an window value uses a more relevant method in order to get higher accuracy.