Translation of Natural Language to Source Code in the Case of Repetition in Pascal Language
Main Article Content
Adi Yusuf*
Aditya Kusuma Setyanegara
Muhammad Raafi Febrian Tara
Source code in computer science is a set of commands used to solve problems written in languages that can be understood by computers. Programming languages use concise syntax, and due to this conciseness, they avoid redundancy and ambiguity. However, these languages are often difficult to learn because they require strict adherence to specific syntactic rules. One approach to minimize the difficulty for programmers is to allow program writing using natural language, which is more flexible and easier for humans to understand. Therefore, this research aims to translate natural language, specifically Indonesian, into Pascal source code. The method applied is a rule-based method consisting of three stages: preprocessing (case folding and filtering), analysis (scanning and parsing), and translation. The preprocessing stage removes noise, the analysis stage checks conformity with the defined grammar, and the translation stage converts Indonesian commands into Pascal syntax. Testing was conducted using 60 Indonesian command texts across three types of loop structures (for do, while do, and repeat until). The system achieved an accuracy of approximately 95%. The results show that the rule-based approach is effective in translating repetitive structures. However, improvements to the grammar and parsing rules are recommended to address translation errors and further enhance system accuracy.
Aho, A. V, Lam, M. S., Sethi, R., & Ullman, J. D. (2007). Compilers: Principles, techniques and tools, 2nd editio. United States of America: Pearson Education Limited.
Biermann, A. W., Ballard, B. W., & Sigmon, A. H. (1983). An experimental study of natural language programming. International Journal of Man-Machine Studies, 18(1), 71–87.
Budiharto, W., & Suhartono, D. (2014). Artificial Intelligence Konsep dan Penerapannya. Yogyakarta: Andi.
Desiani, A., & Arhami, M. (2006). Konsep kecerdasan buatan. Penerbit Andi, Yogyakarta.
Dirgahayu, T., Huda, S. N., Zukhri, Z., & Ratnasari, C. I. (2017). Automatic translation from pseudocode to source code: A conceptual-metamodel approach. 2017 IEEE International Conference on Cybernetics and Computational Intelligence (CyberneticsCom), 122–128.
Kadir, A. (1991). Pemrograman Turbo Pascal untuk IBM PC Menggunakan Versi 5.5. Jakarta: Elex Media Komputindo.
Kohar, M. (2019). Penerjemah Bahasa Alami Dalam Bahasa Indonesia Ke Source Code Dalam Bahasa Pascal. Universitas Komputer Indonesia.
Purnamasari, K. K., & Suwardi, I. S. (2018). Rule-based Part of Speech Tagger for Indonesian Language. IOP Conference Series: Materials Science and Engineering, 407(1), 12151.
Rinaldi, M. (2011). Algoritma dan Pemrograman. Bandung: Informatika.
Utdirartatmo, F. (2005). Teknik Kompilasi. Yogyakarta: Graha Ilmu.