{'fraction_non_alphanumeric': 0.03804262036306235, 'fraction_numerical': 0.014490923441199684, 'mean_word_length': 4.808912525215478, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Morphotactic Modeling in an Open-source Multi-dialectal Arabic Morphological Analyzer and Generator

Arabic is a morphologically rich and complex language, with numerous dialectal variants. Previous efforts on Arabic morphology modeling focused on specific variants and specific domains using a range of techniques with different degrees of linguistic modeling transparency. In this paper we propose a new approach to modeling Arabic morphology with an eye towards multi-dialectness, resource openness, and easy extensibility and use. We demonstrate our approach by modeling verbs from Standard Arabic and Egyptian Arabic, within a common framework, and with high coverage.


Introduction
There has been a lot of work on Arabic computational morphology in the last three decades (Beesley et al., 1989;Kiraz, 1994;Al-Sughaiyer and Al-Kharashi, 2004;Graff et al., 2009;Boudchiche et al., 2017;Taji et al., 2018). These efforts were motivated by Arabic's many challenges, namely, its morphological richness and complexity, its orthographic ambiguity and noise, and its numerous dialectal variants. The work on Arabic computational morphology has led to the development of many resources that directly model morphology (e.g., analyzers, generators) and also resources and tools that use them (Maamouri et al., 2004;Pasha et al., 2014). Morphological analyzers have consistently shown that they are still valuable components in the NLP toolbox, even as the latter increasingly shifts toward the neural modeling space, and especially in low-resource and dialectal settings (Zalmout and Habash, 2017;Baly et al., 2017;Inoue et al., 2022).
The range of techniques explored for morphological modeling has been quite large, from finitestate machines to procedural and functional programming languages, covering different degrees of depth in different linguistic representations, different variants, and different domains and genres.
However, a common challenge among these approaches is the inconsistent coverage of different linguistic features. For example, the Standard Arabic Morphological Analyzer (SAMA, v3.1) (Graff et al., 2009), which was developed in conjunction with work on Modern Standard Arabic (MSA) newswire text in the Penn Arabic Treebank (PATB) (Maamouri et al., 2004), has only 65 imperative verb forms, while it has over 13 thousand perfective verb forms. SAMA also has only 15 instances of the interrogative proclitic Âa 1 which in principle can attach to any word. Another example is the Calima-ARZ system for Egyptian Arabic (EGY) (Habash et al., 2012), which used automatically generated stem classes making it very hard to linguistically generalize and extend. Many of the Arabic morphology resources are not freely available, easy to augment, or ready to plug-and-play in open-source public libraries.
The work presented in this paper is part of a larger effort on the CAMELMORPH Project. 2 CAMELMORPH's goal is to build large open-source morphological models for Arabic and its dialects across many genres and domains. The focus in this paper is on the core components that define lexical and morphological information and the tools to convert them into models that are readily usable within an existing Python open-source suite for Arabic NLP, Camel Tools (Obeid et al., 2020). We demonstrate the effectiveness of our approach by modeling MSA and EGY verbs using a shared representation, and showing improved coverage compared to publicly available analyzers. Our data and code are publicly available. 2 Next we present some related work ( §2), a discussion of Arabic linguistic background ( §3), and our approach ( §4). We then present the MSA and EGY verbal models ( §5) and evaluate them ( §6).

Related Work
There has been a considerable amount of work on Arabic morphological analysis (Al-Sughaiyer and Al-Kharashi, 2004;Habash, 2010). Altantawy et al. (2011) organized the various Arabic morphology processing efforts along a continuum of approaches that is characterized by two poles: on one end, very abstract and linguistically rich representations and rules are used to derive surface forms; while on the other end, simple and shallow techniques focus on efficient search in a space of pre-compiled (tabulated) solutions. The first type is typically but not strictly implemented using finite-state technology, and was one of the earliest efforts undertaken (Beesley et al., 1989;Kiraz, 1994;Beesley, 1996;Habash and Rambow, 2006;Smrž, 2007). These models can be rather complex and have many internal dependencies among the rules used for modeling sub-word structure and morphotactic and orthographic forms. The second type is typically not implemented in finite-state technology. Examples include the Buckwalter Arabic Morphological Analyzer (BAMA) (Buckwalter, 2004) and extensions of it (Graff et al., 2009;Taji et al., 2018). These systems do not represent the morphemic, phonological and orthographic rules directly, and instead compile their effect into the lexicon itself. Hulden and Samih (2012) demonstrated a method of mapping from the pre-compiled tabulated approaches to finite-state representation; and Altantawy et al. (2011) demonstrated the reverse process of going from finite-state to the tabulated representation.
In this paper we present an approach that is a middle ground between these two poles. In lieu of generative solutions employing rewrite rules to map from underlying forms (morphemes) to surface forms (allomorphs), we enumerate, in a limited pre-compiled manner, the various allomorphic forms, and indicate the different context conditions that select for their realization. Our morphological specifications also include information about how to order these different morphemes. Then, in an offline process, we convert our morphological specifications into a full pre-compiled tabulated format in the style of BAMA (Buckwalter, 2004) and CALIMA Star (Taji et al., 2018) databases (DBs) used in the open-source Python toolkit Camel Tools (Obeid et al., 2020). Camel Tools's morphological engines enable the use of the same morphological DB for analysis, generation, and reinflection.
Our approach is closest to Hockett (1954)'s Item-and-Arrangement approach, linguistically speaking; however, we do make use of post-processing transformations (a la Item-and-Process) in a limited way for phonological and orthographic phenomena that do not change the basic letter spelling of the Arabic word, but can change its diacritics. Also, to maximize the utility of our models, we use lemmas and features that allow us to relate our output to Word and Paradigm approaches (Bram, 2012). Finally, while we do not explicitly rely on roots and patterns to derive our forms, as was done by Beesley (1996), and Habash and Rambow (2006), we plan, in future efforts, to abstract from existing entries templatic patterns that allow us to back off intelligently to unseen words if needed.

General Challenges
Arabic orthography, morphology, and dialectal variation pose a number of challenges for NLP.
Orthographic Ambiguity Arabic is typically written without the optional diacritical marks that are used for short vowels and consonantal gemination, leading to a high degree of ambiguity. MSA has upwards of 12 analyses per word (Pasha et al., 2014). A subtask of morphological analysis is producing the correct diacritization for each analysis.
Morphological Richness Arabic inflects for gender, number, person, aspect, mood, case, state and voice. In addition, Arabic orthography cliticizes a number of pronouns (direct object, possessive) and particles (conjunctions, prepositions, definite article, etc.). This results in thousands of forms for each verbal lemma. Because of orthographic ambiguity, words with analyses that differ in the presence of clitics are not uncommon, e.g., wHd can be analyzed as wa+Had∼a 'and he limited' or waH∼ada 'he united', among other readings.
Morphological Complexity Arabic uses a combination of templatic morphemes (roots and patterns) and concatenative affixes and clitics. There are also many complex morphotactic rewriting operations that cause these morphemes to surface in different ways (allomorphs) in different contexts. We present a more detailed set of examples in Section 3.2 to motivate the approach in this paper.
Dialectal Variation In addition to MSA, the de facto official language in the Arab World, there is a number of different local dialects (e.g., Egyptian,  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  FALSE  22  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  38  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  TRUE  TRUE  FALSE  FALSE  FALSE  TRUE  TRUE  TRUE  FALSE  FALSE  FALSE  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  TRUE  TRUE  TRUE  FALSE  FALSE  TRUE  TRUE  TRUE  TRUE FALSE FALSE Levantine, and Gulf) that are commonly used on a daily basis. These dialects differ significantly from each other and from MSA in terms of phonology, morphology and lexicon although they share many similar aspects that support joint modeling. In Section 3.2, we present a more detailed example for MSA and EGY and compare them with each other.
Orthographic Inconsistency There is a high degree of orthographic inconsistency and variety in both MSA and dialectal Arabic (Zaghouani et al., 2014;. For MSA there are standard guidelines with some minor regional differences; but dialectal Arabic has no official spelling rules.  put forth a system for conventional orthography for dialectal Arabic (CODA), which has been used in some Arabic NLP resources. We consider CODA for EGY as our 'reference spelling,' but recognize its limitations. 3 We do not target modeling spelling variations in this work; and follow the philosophy that spelling errors need to be handled in components outside of the morphological analyzer. This is an important future research direction we plan to pursue.
3 To allow comparing with previous work on Egyptian Arabic, we include a limited number of non-CODA-compliant phenomena, namely the negation and indirect object clitics, which CODA separates. This is simply a modeling decision that is independent of the framework.

Motivating Linguistic Phenomena
We describe in this section the linguistic facts relevant to this paper and approach. Arabic morphology includes a combination of templatic and concatenative morphemes, both with many allomoprhic variants. 4 Table 1 (MSA) contrasts parts of the verbal paradigm for five verbs, all of which have triliteral roots, but four are in Form I (1a2a3); and one is in Form III (1A2a3 in MSA, 1A2i3 in EGY). We consider a few subject suffixes and one pronominal clitic; and we indicate the verbal citation form (or Lemma). 5 The table marks all default morpheme realizations in gray, and indicates in underlined black font allomorph changes. For example the word katab+at+hu (cell Table 1.(4d)) simply composes the morphemic forms of the templatic root k.t.b. and pattern 1a2a3 with the suffix +at (P3FS, perfective 3 rd person feminine singular) and the enclitic pronoun +hu (direct object 3 rd person masculine singular Geminate Verbs Verbs with geminate roots (equal second and third radicals) have an allomorph stem with an elided vowel in the context of vowelinitial suffixes (v-suff) in MSA, e.g. Table 1.(7c-8h) shows two variants: ranan (morpheme) and ran . The same phenomenon happens in EGY, but stems before consonant-initial suffixes (c-suff) also have a form different from the default interdigitation of root and pattern: a stem buffer vowel is inserted before the suffix, see Table 1. (19c-20h).
Defective Verbs Verbs with defective roots (third radical is w or y) have three allomorph stems that depend on the nature of the suffix in both MSA and EGY: vowel-initial, orthographically represented with a diacritic only (zero-letter suffix or z-suff), or being followed by an enclitic, e.g. Table 1.(9c-10h;21c-22h) shows four variants: ramay (morpheme), ramaY, ramA, and ram.
t-ending Verbs Suffixes starting with the letter t in both MSA and EGY have orthographic allomorphs that replace the initial t with a letter gemination diacritic, Shadda ∼, when following verbs ending with the letter t (#t), e.g. Table 1.(5f-6h).
Masculine Plural Suffixes The masculine plural suffixes (+uwA, +tum and +tuwA in Table 1.(e;h) also have multiple forms that depend on the presence of enclitics and the verbal stem ending.
hu Enclitic The MSA clitic +hu has an allomorphic variant +hi that harmonizes with suffixes ending with the high front vowel i, e.g. Table 1.(g4).

Short Vowel Elision
The short vowel in EGY verb stem kAt[i]b (in brackets) is elided when the stem is followed by a vowel, whether from a suffix or an enclitic, e.g. Table 1. (23;24). Similarly, the vowel of the EGY enclitic +[u]h is elided after vowel-ending base words (stem+suffix), e.g. Table 1.(22c;22e;22g-h). Such transformations which only change word diacritics are ideally modeled as orthographic rewrites (reflecting phonological and morpho-phonological adjustments).
It should be noted that words can be composed completely of allomorphs of the underlying morphemes, e.g. EGY word ran∼ay+tuw+h in Table 1.(20h). These phenomena are only part of the complete list of phenomena we model, but are typical in terms of complexity. In the next section we will refer specifically to all of these phenomena and how we model them and their interactions.
4 The CAMELMORPH Approach Figure 1 presents the overall approach we take in the CAMELMORPH project. The leftmost three boxes (CAMELMORPH Specs, DB Maker and DB) represent the offline process to create a Camel Tools-compatible morphological database (CAMELMORPH DB) from CAMELMORPH Specifications (Specs). The rightmost part of the figure represents the online process of using the DB in the Camel Tools morphological analysis and generation engines, where an input word results in a number of possible analyses, and an analysis can result in one or more words.
While we focus in this paper on the process of creating Camel Tools-compatible DBs, the overall approach can be used to generate other repre-  sentations, e.g., finite-state machinery (directly or indirectly as Hulden and Samih (2012) has previously demonstrated). We chose to work with Camel Tools because it is a Python toolkit with growing popularity, and its morphological engine is relatively efficient. Next, we describe the various components of the CAMELMORPH DB making process.

The CAMELMORPH Specifications
The morphological specifications (Specs) are the core of the CAMELMORPH project. There are four types of Specs: Order, Lexicon, various morphological units (Morph) -Affixes, Clitics, and Buffers, and Regular Expression Substitutions (Regex). An example of the set of Order, Lexicon and Morph Specs needed to model the MSA verbs in Table 1 is presented in Figure 2. We also present a Regex example to handle EGY verbs in Figure 2.

Morph Order
The Morph Order specifies the arrangement of all the morphemes that can appear in a word. It only indicates the order of the morphemes, but not their morphotactic interactions. In Figure 2.(MO) (at the top of the figure), a minimal order is specified to form a perfective verb stem with a stem buffer, suffix, and pronominal clitic. The Prefix conjunction is allowed, but is not included in this example. Inside the Morph Order, the morphemes are specified by their class, e.g., [PVStem] refers to all the perfective verb stems.
The Morph Order also specifies which morpheme classes fall together to make the CAMEL-MORPH DB stem, and DB complex prefix and complex suffix sequences (sets of prefixes or suffixes that precede or follow the stem, respectively). In this example, a complex suffix sequence would include the resulting concatenation and rewriting of the perfective verb suffix and enclitic. The DB stem is created by concatenating the perfective verb stem and its buffer.
Different Morph Order lines are needed for the specifications of imperfect and command verb aspects. The number of specific Morph Order lines can vary depending on the choices of the linguist designing it.
Finally, since Arabic dialects and MSA all share the same morpheme order (with minor exceptions), we can use a common Morph Order for them all. This paves the way toward models of intra-word code-switching, which we leave for future work.
Lexicon, Buffers, Affixes, and Clitics All the morphemes used in the model are specified in a common style regardless of their type as lexical stem, inflectional affix, or attached clitic (syntactically independent, by phonological or orthographically dependent morpheme). The specification of any morphemes includes six elements.
(1) Class specifies the set of morphemes that the morpheme in question belongs to. The Class is the link between the Morph Order and the specific morphemes. It determines the position of the morpheme in the word.
(2) Lemma (in Lexicon) or Morpheme (in Affixes and Clitics) specifies the morpheme. For the Lexicon, the lemma is an abstraction over all the inflectional forms of a word's morphological inflection family. For the affixes and clitics, we use a functional specification. For example, Suff.P3MP refers to the perfective 3 rd person masculine plural suffix. Stem Buffers, as in the class [PVBuffer], are not morphemes per se, but rather fragments of stems that vary highly in different contexts. As such Stem Buffers have no proper morpheme form defined; but their class specifies their position in the word. This concept is an innovation that allows us to refer to specific parts of the word form where complex morphotactic interactions happen and isolate it from the rest of the verbal patterns. There are two advantages to this approach. First, it reduces the total number of stems needed to be specified. So, for the defective verb in Table 1.(9-10;21-22), instead of listing four stems, ramaY, ramA, ram, and ramay, we only specify ram with a condition term (see below) marking its class as #-ay, i.e. defective. A second advantage of the buffer concept is that it allows us to relate dialect and MSA stems to each other, e.g. by treating the stems of geminate EGY verbs ran∼ and ran∼ay as the same (ran∼) with different conditioned buffer values.
Obviously, more complex non-suffixing or prefixing stem changes cannot be handled meaningfully using the buffer concept. Nevertheless, the current method is able to handle all Arabic-related concatenative phenomena perfectly.
(3) Form specifies the actual realized form of the morpheme. Each of the allomorphs of a morpheme gets a different Form line. For example, the two forms of the clitic Pron.3MS (hu and hi) share the same Morpheme and Class but have different forms. When multiple forms appear for the same morpheme, they need to be distinguished through different Required Conditions (Conds), which specify their complementary distribution.
(4) Gloss specifies the English meaning of the morpheme. It is not an essential feature of the model, but still useful to distinguish and explain any semantic differences.
(5) Set Conds and (6) Required Conds are a collection of terms that allow us to specify which allomorphs are compatible. Each form (allomorph) both sets and requires zero or more conditions to be true to be validated for use. Effectively, these conditions define the various contexts of co-occurrence and control the complementary distribution of the allomoprhs. In the example in Figure 2, there are nine condition terms: (1-2) trans (transitive) and obj (object pronoun) license the use of pronominal clitics with transitive verbs. The obj condition also interacts with some suffix and verb buffer forms, e.g., Figure 2.(B2b;A6b;A6d).
(3-5) v-suff, c-suff, and z-suff specify the form of the suffixes: vowel-initial, consonant-initial or zero letter suffixes. They interact with verb stems and buffer forms.
(6-7) #-ay and #t specify the type of the verb as defective or t-ending, respectively.
(9) Finally, the term else is not a condition in itself, but it allows specifying the negation of a condition or set of conditions to model complementary distributions. The scope of an else is the column it appears in the Required Conds field. For example, in Figure 2.(C2a), the else indicates the negation of the suff-i in Figure 2.(C2b).
The right-hand side of Figure 2 presents five word examples from Table 1 and highlights the specific allomorphs which are selected to form them. Here, the order of the allomorphs is determined by  the Morph Order, and their compatibility through the set and required condition terms. For instance, in the second example, naHat+∼umuw+hu, the selected stem sets the conditions #t and trans. The Suff.P2MP has four allomorphs, and the Pron.3MS enclitic has two. Two of the Suff.P2MP allomophs are compatible with the stem's #t; and only one of these two (requiring #t and obj) is compatible with one of the Pron.3MS allomorphs (setting obj and requiring trans and not suff-i).

Regex Substitution Rules
The last component of the CAMELMORPH Specs is the regex substitution rules. These rules can be used to model orthographic and phonological rewrite phenomena that involve morpheme diacritics. Table 2 illustrates how three rules can be used to model the vowel elision phenomena in EGY verbs in Table 1. (23;24). While the rules are implemented in the system with regex substitutions over orthographic forms, we represent them in the headers of Table 2 in SPEtype rule form (Chomsky and Halle, 1968) for readability. 6 To control the scope of the rules, we also extend the EGY verb stem and enclitic entries by marking elision candidates in the morphemes directly using a ! character. Only marked vowel diacritics in elision contexts are deleted. In Table 2, we use two rules (R1) and (R2), applied in sequence, followed by a final cleanup step to remove the ! marker for vowels that were not deleted. The morpheme boundary (+) is maintained for illustrative purposes. The grayed out cells indicate where a rule is applied, and the bolding indicates the affected morpheme.
To allow us to use regex substitution rules within Camel Tools, we needed to make some extensions, which we plan on releasing in future Camel Tools releases.

The CAMELMORPH DB
We describe next the format of the CAMELMORPH DB, which we want to generate from the CAMEL-MORPH Specs. The CAMELMORPH DB has the same basic structure as the Buckwalter Arabic Morphological Analyzer (BAMA) (Buckwalter, 2004): it consists of (a) three lexical tables for complex prefixes (sequences of all possible cooccurring proclitics and prefixes), complex suffixes (sequences of all possible co-occurring suffixes and enclitics), and stems, and (b) three compatibility tables that specify allowed co-occurrences of complex prefixes with stems, stems with complex suffixes, and complex prefixes with complex suffixes (see Figure 1). During the analysis of a word, all combinations of allowable prefixes, stems, and suffixes matching the input in undiacritized space are considered and checked for existence in the lexical tables, and if so, their lexical categories are checked for compatibility in compatibility tables. Only valid and compatible combinations are output. This representation, which was pioneered by Buckwalter (2002) has been used by many other systems since then (Habash, 2004;Taji et al., 2018;Obeid et al., 2020) with numerous extensions. Habash (2004) demonstrated how to extend the algorithm with the same DB to perform generation. And Taji et al. (2018) demonstrated its use for reinflection and more complex gender/number modeling.
In our work, we extend Obeid et al. (2020)'s version by factoring out some hard-coded components to handle regex-based post-processing, and include them in the DB files. Our extensions will be integrated in Camel Tools once the full morphological models are finalized for all parts-of-speech.

The CAMELMORPH DB Maker
The CAMELMORPH DB Maker takes the CAMEL-MORPH Morph Specs as input and generates a BAMA-like CAMELMORPH DB. The basic algorithm behind this conversion is to identify all the unique condition terms set and required from all the instances of the classes ordered in the Morph Order. Each such combination is checked for compatibility (i.e., morphotactic validation) and incompatible combinations are discarded. Surface strings and features associated with compatible combina-  tions are split into complex prefix, complex suffix and stem sequences and added into the lexical tables. Also, compatibility categories are created for the complex morpheme sequences, and are added to the compatibility tables. Memoization is used to speed up this process and make it efficient. As for the Regex substitution rules, they are simply copied into the DB with minimal processing.

Modeling Arabic Verbs
We developed two morphological models for MSA and EGY verbs. This effort made use of publicly available resources and tools, together with extensive reformulation, quality assessment, and reference cross-checking by a team of linguists and computer scientists.
For MSA in particular, we filled many known gaps in previous models, namely, adding passive and imperative forms, and the interrogative proclitic. We also added some admittedly archaic forms from Classical Arabic: energetic and extra energetic moods and indirect object pronominal clitics used with ditransitive verbs. For EGY, we paid special attention to completing verbal paradigms and modeling phono-orthographic phenomena. The total number of lemmas in CAMELMORPH, and in Calima MSA and Calima EGY is generally comparable, although Calima EGY has more lemmas, presumably because automatic methods of lexicographic population were used in that effort. However, the number of lemmas does not indicate the modeling of their full paradigm.
The total number of morphological specifications outside the lexicon (Table 3.(b)) is two orders of magnitude smaller than the forms compiled into CAMELMORPH DB (Table 3.(c)). MSA Specs are 2.6 times the number of those in EGY (Table 3.(b)), which is expected given MSA's richer inflectional features space.
Looking at the stem counts in both MSA and EGY (Table 3.(d)), we notice that the number of forms in CAMELMORPH DB is higher than those in Specs by 26% and 52% for MSA and EGY, respectively. This increase is because of the pre-and post-buffer merging with the stems. Additionally, MSA Passive and CV (Command) forms were enriched to match the size of other verb forms. This is a major coverage increase resulting in more complete verbal paradigms. EGY on the other hand has no passive stems in CAMELMORPH, as by design, we consider them to be unaccusative derivational forms and not inflectional passives. This is a de-7 For MSA, we compared with the calima-msa-s31_0.4.2.utf8.db version (Taji et al., 2018) based on SAMA (Graff et al., 2009). For EGY we only compared to the calima-egy-c044_0.2.0.utf8.db entries (no MSA extensions) based on Habash et al. (2012). sign choice of our Specs and not a limitation of the framework. We also note the large increase in EGY IV stems which is due to pre-stem buffers that interact with some of the person and number prefixes. One advantage of the CAMELMORPH framework is the ease of configuring the specifications of the DB being generated while considering tradeoffs in efficiency.
In terms of the total number of analyses (Table 3.(e)), CAMELMORPH has 2.9 times and 5.4 times the number of analyses in Calima MSA and Calima EGY, respectively. The total number of unique CAMELMORPH EGY full analyses is remarkably twice that of MSA, while the respective number of analyses without clitics is one-tenth. This is consistent with MSA having a richer inflection space; while EGY has a richer enclitic space, which includes negation clitics and indirect and benefactive object pronouns.

Evaluation
We present two recall-based evaluations to measure the quality of the new verb morphological models we developed.

MSA Recall Evaluation and Error Analysis
To evaluate the quality of our CAMELMORPH MSA verb model in terms of recall of correct morphological analyses, we used manually annotated verbal entries in the training portion of the PATB (latest versions of parts 1,2,3) (Maamouri et al., 2004) as defined by Diab et al. (2013). There are 47,691 verb tokens (14,786 unique analyses). Out of all verb tokens, 98.4% of their full analyses were recalled successfully, and 0.3% were out-of-vocabulary. Of the remainder 1.4% with no perfect matches, we randomly selected 100 unique verb analysis examples and manually analyzed the results. In 93% of the cases, the PATB annotation was suboptimal or incorrect: 64% (absolute) of the cases come from the use of a li/PREP clitic with verbs instead of li/CONJ_SUB, which seems like a consistent annotation choice, albeit odd for verbs. In 29% of the cases, the PATB annotation did not specify a lemma or diacritization (13%), or had an incorrect lemma or diacritization (16%). In 6% (absolute) of the latter, the lemma was incorrectly specified in the passive voice. Our CAMELMORPH MSA system failed to produce matches in 7% of the sample. Most of the cases were missing lexical entries or alternative spellings of some clitic combinations, e.g., fa+li as fa+l.

EGY Recall Evaluation and Error Analysis
Similar to our MSA recall evaluation, we conducted a recall evaluation for EGY using the verbal entries in the training portion of the LDC's ARZATB (Maamouri et al., 2012) as defined by Diab et al. (2013). Given the inconsistencies in some of the ARZATB entries, we used a version of ARZATB that was automatically synchronized with a combination of EGY and MSA analyzers as our reference. This version was reported on in previous publications (Pasha et al., 2014;Zalmout and Habash, 2019;Inoue et al., 2022). For recall evaluation, we also use CAMELMORPH EGY and MSA together in a similar manner, with preference towards EGY if an imperfect (i.e., not all analysis features match) tie is reached. To deal with the common spelling variations in the input words, we use the a dediacritized version of the correct answer, which is intended to mimic a more CODAcompliant spelling. Of the original token count of 20,339 verbs, 69.9% of the full analyses are recalled successfully. In 1.4%, no analysis is generated, and in 24.2%, no single analysis matches the reference analysis perfectly. 4.5% of the reference analyses were not usable due to synchronization issues. We took a sample of 100 unique verb analyses from the set with no matches, and analyzed them manually. Almost half of the sample (47%) was due to reference errors. Another third (37%) involved valid alternative diacritizations reflecting different pronunciations (e.g. misik vs masak 'to hold'). 10% were due to missing entries; and 6% were due to diacritization errors that can be fixed with regular expressions.
The difference in recall between MSA and EGY is striking but completely understandable given the differences in standardization traditions and the maturity of existing resources.

Conclusion and Future Work
We presented a new approach to modeling Arabic morphotactics and demonstrated its usefulness by creating a large-scale verbal analyzer for MSA and EGY using a common framework. All of our models and code will be publicly available. In the future, we plan to extend our work to all other POS classes in MSA and EGY, as well as target other dialects of Arabic. Some of the interesting challenges we want to address are noisy spelling, dialect-MSA intra-word code switching, and template-based backoff modeling.