Lost in Variation: An Unsupervised Methodology for Mining Lexico-syntactic Patterns in Middle A rabic Texts (2025)

Abstract: While MSA and some dialects of Arabic have been extensively studied in NLP, Middle Arabic is still very much unknown to the field. However, Middle Arabic holds issues that are still not covered: it is characterized by variation since it mixes standard features, colloquial ones, as well as features that belong to neither of the two. Here, we introduce a methodology to identify, extract and rank variations of 13 manually retrieved formulas. Those formulas come from the nine first booklets of S ̄IRAT AL-MALIK AL-Z. ̄AHIR BAYBAR S., a corpus of Damascene popular literature written in Middle Arabic and composed of 53,843 sentences. In total, we ranked 20, sequences according to their similarity with the original formulas on multiple linguistic layers. We noticed that the variations in these formulas occur in a lexical, morphological and graphical level, but in opposition, the semantic and syntactic levels remain strictly invariable.

## introduction as described in @xcite , three main types of arabic have been covered by nlp research: classical arabic, modern standard arabic (msa) and dialects (egyptian, gulf, ...). while classical arabic has been the subject of only a few works, msa and dialects have been the focus of a fair number of studies. this is not the case for middle arabic, which, to the best of our knowledge, has not been studied from a nlp perspective. however, middle arabic study in nlp is interesting on its own. middle arabic is "distinguished by its linguistically (and therefore stylistically) mixed nature, as it combines standard and colloquial features with others of a third type, neither standard nor colloquial" @xcite . as a result, middle arabic texts tend to have a wide range of possible variations for a given structure @xcite . by studying middle arabic in nlp, we would be able to produce and process new resources which take into account numerous varieties of arabic simultaneously. this would be useful for better understanding text processing in arabic, as arabic texts are rarely written with a single variety of arabic @xcite . studying a corpus of middle arabic can be challenging for both linguists and nlp experts, being of mixed nature and prone to variation, as discussed in section 2.1. for instance, formulas like " " ("he leaped jumping on his feet") can also be written as " " ("he got up jumping on his feet") or with the graphical variation " " (fd ¯d ¯instead of fzz). this challenge is compounded by other difficulties specific to arabic processing in nlp, including orthographic ambiguity, morphological richness and orthographic noise @xcite . here, we aim to provide a new methodology to study a corpus with multiple varieties of arabic. our goal is the identification of all possible variations for a given formula. to do so, we introduce a corpus of middle arabic, s īrat al-malik al-z . āhir baybars . , composed of 53,843 sentences along with 13 formulas that were manually retrieved by a linguist expert and whose variations we want to study. we plan to use token alignment techniques, lexico-syntactic patterns as well as similarity measures in order to extract and rank each possible variation of a given formula. we find that our study is similar to the ones dealing with multiword expressions (mwes) in nlp. mwes are generally seen as conventionalized and idiomatic sequences @xcite . in mwe processing, the identification task, whose goal is to identify mwes in a text, shares a lot of similarities with the work we try to achieve @xcite . for this reason, we plan to use the methodology presented in @xcite , created for the identification and the extraction of mwes and unfrozen mwes, i.e. mwes which have undergone lexical, syntactic and/or semantic changes. we first introduce the notion of middle arabic in section 2. we then introduce the corpus and the formulas we used to test our methodology in section 3. those formulas correspond to short and frequently occurring instances in our corpus. hereafter, we show the different steps that led to the identification and extraction of those formulas and their look-alikes in section 4. finally, we discuss the variations we observe between the original formulas and their newly-found variations in section 5. further research has defined these varieties that lay between the two poles of diglossia under the term middle arabic @xcite . middle arabic can thus be described as a set of intermediate registers that mixes both standard and colloquial features, and also has features of its own, that are not standard nor colloquial and that belong to a third pole @xcite . a whole area of arabic literature has been written in middle arabic, and it was shown that it had nothing to do with poor language skills in fus . h . ā (classical arabic). we have examples of texts written by the same scholars both in perfect fus . h . ā and in middle arabic; and popular literature is, for a large part, written in some varieties of middle arabic, just as the thousand and one nights @xcite . the damascene version of s īrat baybars . , which we work on, is another example, and one should keep in mind that even though the text seems close to levantine dialects, not only does it have standard features, but it also has very specific features that belong to neither of the two poles. for instance, the relative pronoun allad ¯ī in its masculine singular form remains invariable regardless of the gender and number of its antecedent @xcite . thus, middle arabic can be distinguished by its mixed nature: it combines features from both standard and dialects. given this situation, it makes it complex to use either standard or dialect tools such as part-of-speech taggers on a middle arabic corpus. middle arabic being a mixed, hybrid set of varieties of arabic that tends to play on the linguistic continuum, it creates an important amount of linguistic variation throughout the text. isolating manually all the variations of the same formulas in our corpus can be difficult given the language of the text and the size of the corpus. a closer look into arabic nlp research could help us develop an automatic approach on middle arabic texts that might be expanded to other languages with frequent variations. ## discussion the variations we observed appear mainly on three levels : graphical, morphological and lexical. on the graphical level, we noticed that some letters and diacritics are not always indicated. for instance, the hamza in d . yā (3) is most of the time absent, despite it being written in some variants of the same formula. this feature was already described by lentin in @xcite : "final hamza is generally absent". this graphical flexibility is also visible within the preposition fī, sometimes written without the two points of the yā , as well as the double vowels of the tanwīn in (1) which are not systematically indicated. on a morphological level, one of the most variable elements is the verb, which can be conjugated at any person and in any number or gender, as in (2) where sm ↩ depends on the subject, and can become sm ↩ t or sm ↩ ū . it is also the case in (3) where ġd . b can be ġd . bū as well as ġd . bt. we also found many variants of 3 with ↩ ynīh in the dual form instead of ↩ ynh (see 7). fi-nally, variations can occur on a lexical level, either on verbs or nouns that are synonyms or describe a very close image, preserving the meaning of the formula. in (3) ↩ yn ("eye") becomes wjh ("face"), and qlb ("turned to") can be replaced by s . ār ("became"), as well as ġd . b ("to get angry") by frh . ("to get happy") in (1). for the last two, one could argue that they are not synonyms. in fact, as we will show in the next paragraphs, they still belong to the same lexical field (emotions, for instance): they do not affect the core meaning of the formula, and the landmark effect that we explained in 3.2 is preserved. nevertheless, some of these variations do change completely the meaning of the formula, to the point of consisting of another formula. for instance, if sm ↩ (to hear) and fhm (to understand), a verb that we found in one of the variants of the formula (2), are exchangeable, it is because the meaning of the two verbs -at least in this context -is very close; whereas the variant with frġ mn in " " ("and when he had said those words") affects way too much the formula, and thus consists in another formula. indeed, we noticed that the formula (2) is systematically used in the context of dialog, right after one character has said something that affects another character. in opposition, the same formula with frġ has its own specific context: it is only used after a character has recited a poem. following the same logic, ġd . b can be substituted by frh . in (1), because both indicate emotions or feelings that overwhelm a character. the variant with qātl " " ("the muslims fought very hard"), which does not denote an emotion, gives another meaning to the formula. in fact, it has its own context of use, which is the battle scenes that happen within the s īra. all these examples show that linguistic variation in our corpus and within the specific context of the formulas do not occur randomly. some variants pass the threshold of comprehension, which indicates that they no longer belong to the same formula. the fact that they have their own context of use supports this idea. in fact, some elements are strictly invariable, and they all happen to be syntactic and semantic. the syntactic structure of the formula stays unchanged: in (1), the maf ↩ ul mut . laq structure is constant in all the variants of the formula, regardless of any graphical, lexical or morphological changes. we can also note that there is at least one static word in each formula: a word that never changes graphically, morphologically or lexically, with a fixed position in the formula, and which is hardly ever used in unrelated found sequences. for instance, šdīd occurs 75 times within the formula (1), and only 8 outside of it; z . lām has 47 occurrences within the formula (3), and only 5 outside of it. the formulas also follow a semantic pattern: as we explained in the previous paragraph, (2) has a specific context of occurrence which cannot be replaced by another without changing a strong parameter in the formula (as when sm ↩ becomes frġ). in (1), regardless of the lexical changes, all the variants of the formula describe a very strong feeling, whether it is anger (ġd . b), joy (frh . ), love (h . bb) or torment ( ↩ d ¯b). when the lexical variation exceeds this meaning, as in the variant with qātl ("to kill"), the semantic level is not reached, and this meaning shift leads to an unfreezing process, as defined by @xcite . al-though we did not find any variant that underlines an unfreezing process in formula (3), such as in ( 1 ) and ( 2 ), we can guess that any lexical variation that involves a meaning shift will not be considered as part of the same formula. ## conclusion in this paper, we presented a methodology for the identification and extraction of formulas likely to be subject to variations in a middle arabic corpus. we extracted 20,386 sequences resembling these formulas. we ranked those sequences according to their similarity with the searched formulas on various linguistic layers. in total, 813 segments with a score of 0.7 or more were found. this process helped us get an overview of the variants of each formula. we noticed that some elements of a formula can easily vary whereas others are strictly invariable. variations may occur at the lexical, morphological and graphical level but never on a syntactic nor semantic level. if any kind of variation happens on the last two levels mentioned, it changes completely the essence of the formula, consisting in another formula of another type which is used in its own specific context. in future work, we aim to build improved nlp tools for processing middle arabic. it would help us to analyze more formulas, than the set we studied in this paper. we also plan to work with linguists experts in damascene in order to annotate a sample of the sequences found. this would help us to propose further analysis of the performances of the methodology we presented here. we hope this work will be helpful for further research on non-standard arabic variants.