Q uran T ree.jl: A J ulia Package for Q uranic A rabic Corpus (2021)

Abstract: QuranTree.jl is an open-source package for working with the Quranic Arabic Corpus (Dukes and Habash, 2010). It aims to provide Julia APIs as an alternative to the Java APIs of JQuranTree. QuranTree.jl currently offers functionalities for intuitive indexing of chapters, verses, words and parts of words of the Qur’an; for creating custom transliteration; for character dediacritization and normalization; and, for handling the morphological features. Lastly, it can work well with Julia’s TextAnalysis.jl and Python’s CAMeL Tools.

## introduction the quranic arabic corpus @xcite provides a complete annotation of the morphological features of the qur'an. these features include part-of-speech tags, morphological segments, semantic ontology, and syntactic analysis using dependency graph. the corpus can be accessed through either the java package, jqurantree, or by downloading it as a text (.txt) file from: https://corpus.quran.com/ the corpus was made to produce a resource that enables further analysis of the qur'an, the 1,400 year old central religious text of islam. the 77,430 words of the qur'an form a distinct genre difficult to compare to other texts of arabic; and processing quranic arabic is a unique challenge from a computational point of view, since it differs significantly from modern standard arabic (msa) @xcite . in an effort to make the corpus accessible computationally, @xcite developed the java package, jqurantree. it includes apis for accessing and analyzing the said corpus in its arabic form, through the uthmani distribution of the tanzil foot_1 project. this distribution is encoded as a orthographic object model, that is immutable and follows the following hierarchy: @xmath0. the package uses extended 3 buckwalter @xcite encoding as transliteration for the qur'an's arabic texts, whilst also offering simple encoding foot_3 as another type of arabic to roman mapping. lastly, jqurantree supports apis for search and analysis table for analyzing the corpus. while jqurantree provides all the fundamental functionalities for working with the corpus, it is, however, not easily accessible to researchers with little to no experience in programming. this is mainly due to the programming language used for the apis, which is java. indeed, it is a powerful language but is only taught to engineering and computer science students, and rarely used in other non-engineering or non-it courses. as such, it is therefore safe to assume, that most nonengineering or non-it researchers who started coding for their research papers, are likely to be users of a high-level programming languages (relative to java), like r, python or julia. high-level languages are, by design, easier to learn compared to low-level languages. this is because high-level languages are often, if not always, aimed at abstracting some complexities of a low-level languages. on top of that, algorithms and models for scientific computing are often implemented in high-level programming languages. this is the motivation of qurantree.jl, by providing apis on a high-level language as an alternative module to jqurantree's java apis, without com-promising on the speed and robustness of the latter library. while the availability of the text file for the quranic arabic corpus meant that anyone can load it into their favorite programming languages for analysis, it requires, however, heavy text processing on the morphological features, an advanced task for non-engineering researchers. it is, therefore, part of this project to abstract these complexities by providing intuitive high-level apis. lastly, the fact that there are other libraries (see discussions in section 2) dedicated for handling the quranic datasets, simply suggests that there are growing interest for such tool, especially with the proliferation of computational approaches to learning from the data. ## related work there have been efforts on bringing the qur'an into packages of a high-level languages for accessible analyses. for r language, for example, @xcite came up with the quran library. the said library provides four types of datasets encoded as r data frames for the qur'an: two in arabic texts (with and without diacritics), and two as english translations (saheeh international and yusuf ali). each data frame contains columns describing the descriptive feature of the surah or chapter; for example, features like surah id, ayah id, surah title, etc.; and other indicator features like if a sajdah is obligatory for the verse, or if it is recommended. as such, quran lacks columns for morphological features of the qur'an, which is useful for further analysis of the linguistic style of the said scripture. for python, on the other hand, @xcite came up with pyquran, which unlike quran, this package provides extra utilities for analyses. for example, apis for character dediacritization; buckwalter transliteration; other functionalities like grouping letters based on its diacritics; and, search functionalities. however, like the quran, pyquran is not using the quranic arabic corpus @xcite , and thus lacking morphological features as well, which again are useful for the analysis of the linguistic style of the qur'an, a step further than just the descriptive part. ## design and implementation qurantree.jl is an open-souce library consisting of a set of julia apis for working with the quranic arabic corpus @xcite , and in this section, we are going to discuss the design and implementation of the package. ## installation qurantree.jl is a registered julia package with source code available on github foot_4 , and can be installed in the julia repl as follows: ## package features at the time of writing, qurantree.jl has the following features: ## conclusion and future work in conclusion, qurantree.jl provides the nuts and bolts for doing arabic text analysis for the quranic arabic corpus in julia, with the main advantage of being able to work seamlessly with existing julia's general nlp toolkit, textanalysis.jl; and seamlessly interoperate with other packages outside julia, like camel tools. this modularity has indeed been part of the main design principles of the package, along with the robustness provided by the expressive type system of julia, and of course the inherited speed -still a work-in-progress for the package. there are still room for improvements, however, given the fact that qurantree.jl was just recently added to julia's package registry, at the time of writing. among the future works, the first one is the standardization of the mappings for dediacritization and normalization functionalities. specifically, to align qurantree.jl to jqurantree and camel tools to avoid confusion and unnecessary adjustments; second, the binary encoding of the text (.txt) files of the raw data in the backend; third, the development of a pure julia library for universal arabic nlp, with close integration to qurantree.jl. this is a huge effort but will indeed complete the arabic nlp toolkit for julia; and lastly, any suggestions to further improve the package are welcome, simply open an issue in the github repository foot_9 .