<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="78"/><title>T-code compression for Arabic computational morphology</title><author surname="Yaghi" givenname="Jim"><org  name="University of Sfax" country="Tunisia" city="Sfax"/></author><author surname="Titchener" givenname="Mark R."><org  name="University of Sfax" country="Tunisia" city="Sfax"/></author><author surname="Yagi" givenname="Sane"><org  name="University of Sfax" country="Tunisia" city="Sfax"/></author></firstpageheader><frontmatter><p><b>T-Code Compression for Arabic Computational Morphology</b></p><p><b>Jim Yaghi </b>and <b>Mark R. Titchener</b></p><p>Department of Computer Science University of Auckland. jyag001@ec.auckland.ac.nz, mark@tcode.auckland.ac.nz</p><p><b>Sane Yagi</b></p><p>Department of Linguistics University of Sharjah. saneyagi@yahoo.com</p></frontmatter><abstract>It is impossible to perform root-based searching, concordancing, and gram­mar checking in Arabic without a method to match words with roots and vice versa. A comprehensive word list is essential for incremental searching, predictive SMS messaging, and spell checking, but due to the derivational and inflectional nature of Arabic, a comprehensive word list is taxing on storage space and access speed. This paper describes a method for com­pactly storing and efficiently accessing an extensive dictionary of Arabic words by their morphological properties and roots. Compression of the dictionary is based on T-Code encoding, which follows the Huffman encoding model. The special characteristics inherent in the recursive augmentation method with which codes are created allow compact storage on disk and in mem­ory. They also facilitate the efficient use of bandwidth, for Arabic text transmission, over intranets and the Internet. </abstract></header><body><section number="1" title="Introduction"><subsection number="1.1" title="Challenges of Arabic"><p>Arabic poses a formidable challenge for compu­tational linguists due to its derivational nature. Word generation requires moulding three- and oc­casionally four-consonant roots into a range of morphosemantic template patterns, where the root radicals intersperse between a templates' letters to produce a new word with a new meaning that still shares the basic meaning of the root. Often these templates augment the root by lengthening its me­dial radical, inserting a long vowel between the radicals, and/or adding consonantal prefixes. The generated words are what is termed <i>'stems' </i>in the English language, but they are not actual words; they are mere semantic abstractions. To become actual words, the stems are moulded into mor-phosyntactic patterns that will indicate whether a word is a verb or noun, present or past, active or passive voice, etc.</p><p>The process of root extraction from actual words, on the other hand, is not a simple reversal of the process of word generation because the root radicals would have been disguised by the application of morphological patterns.</p><p>Although Arabic morphology is systematic, it has remained a challenge to produce, for example, useful spell checkers, grammar checkers, search engines, and indexers that are not based on exact matching. The missing ingredient at the base of this problem is an accurate root-based morpho­logical analyser. Spell-checkers, normally, do not contain a large enough word list to accommodate the inflectional variation words undergo when affixed because these may run in millions. Few grammar checkers exist for Arabic, because it is difficult to parse a sentence if its words are not correctly interpreted by a morphological parser. Various types of Arabic search engines are significantly impaired because of the inability to find character-to-character correspondence between search terms and variant match items such as differing tense, voice, person, number, or gender.<page local="2" global="79"/></p></subsection><subsection number="1.2" title="T-Code Technique"><p>Finite State Transducers (FSTs) have been estab­lished as a standard way to encode morphologi­cal alterations (Karttunen et al., 1997). However, FSTs are normally compiled from rules written in a special FST generator language. FST compilers like PC-KIMMO (Antworth, 1990) and 2lc (Kart­tunen, 1993; Karttunen and Beesley, 1992) use a specialised language to generate lexical transduc­ers. On the other hand, our implementation uses the standard PERL regular expressions (Friedl, 2002) but in a specialised manner.</p><p>Beesley (2001) describes a system that gener­ates FSTs using <i>2lc </i>for lexical transformations of Arabic words. When generating words, the system uses the compiled FSTs to achieve mor­phological and phonological letter alterations and then uses them in reverse to perform derivation. Our approach uses, like Beesley, the compiled FSTs for word generation, but it does not use it for root derivation.</p><p>Our approach produces a list of Arabic stems, inflected affixed forms along with their roots and complete morphological classifications; this list facilitates the direct regeneration of words. Our root derivation technique requires this extensive list or dictionary of stems to be stored in a search-friendly manner.</p><p>The dictionary of stems would ordinarily oc­cupy a large amount of disk storage space, but we propose here a technique that finds an acceptable balance between compression and lookup speed, T-Code (Titchener, 1984). T-Code compression is similar in style to Huffman encoding, as T-Codes are a subset of all possible Huffman code sets (Gunther, 1998). T-Code has the advantage of statistical synchronisation, or the ability to self-synchronise (Titchener, 1997), making it ideal for transmission over networks, especially where information loss is inevitable (eg., wireless networks).</p><p>We begin with basic roots and morphosemantic, morphosyntactic, and inflectional affixation rules to generate all possible stems. After some simple affix removal rules are applied, any valid lookup word should be found in the comprehensive list of stems. Internally, Arabic words are encoded with their roots and morphological classification so that the original word may be regenerated when needed.</p><p>In this paper, we discuss the system we have built for verb generation which can be used either in whole or in part for root-to-word and word-to-root lookups. We begin with a description of how the word list was generated, followed by a discus­sion of the dictionary format and how it was com­pressed, we then describe how the compressed dictionary was searched and decoded, and finally conclude with some suggestions for simple appli­cations.</p></subsection></section><section number="2" title="Word Generation"><subsection number="2.1" title="Word Data Creator Environment"><p>The Word Data Creator Environment (WCE) was built to assist in creating and debugging the gen­eration database. This software provides a graphi­cal user interface facilitating data entry and exper­imentation.</p><p>WCE allowed us to edit the <i>MainDictionary Table. </i>For each entry, we were able to supply a root radical, a root classification identification number, and two numbers identifying the mor-phosemantic pattern and a morphosyntactic vari­ant that a derived word would follow. Unlike tra­ditional root-type classifications in Arabic mor­phology, our root classifications identify a root by the type and location of alterable letters it con­tains, for example, j (w), &lt;_£ (y), and &gt; Q<footnote anchor="1"/>. Al­terable letters are those that usually undergo rule-based transformation if followed or preceded by certain other letters.</p><p>In addition to entry editing, WCE allowed us to edit related template entries from the <i>Templates Table. </i>A <i>Templates Table </i>entry is indexed by a pattern and variant identifier and a tense and voice combination. Every entry specifies a general template string which, for the given voice and tense, causes derived words to have a certain meaning. Entries also identify a set of inflection and spelling transformation rules and an affix list number. Transformation rules are dependent</p><p>'For    readability,     this    paper    uses Buckwal-ter's    Arabic    orthographical    transliteration scheme (http://www.cis.upenn.edu/~cis639/arabic/info/translit-chart.html).</p><page local="3" global="80"/><p>on a combination of the template string letters and the root radicals. The template strings of each entry are, in fact, the combined result of a morphosemantic and a morphosyntactic pattern, transformed for the tense and voice of the entry. The possible tenses are past and present, the voices are passive and active, and the modes are indicative and imperative.</p><p>Affix lists, which were also editable from within WCE, contain patterns for generating 17 different morphosyntactic forms specifying combinations of gender, number, and person for each voice and tense. Both affixation and trans­formation rules are specified using the language of PERL regular expressions.</p></subsection><subsection number="2.2" title="Word Generation Engine"><p>Within WCE is an implementation of the Word Generation Engine (WGE), which allowed us to debug our classifications and transformation rules, and to ensure the correct spelling of generated words. While making modifications to root rad­icals, word classifications, template strings, and transformation and affixation rules, we were able to preview the result of any of the 17 word types on the main screen for the selected <i>MainDictionary Table </i>entry.</p><p>The three components, <i>Stem Transformer, Affixer, </i>and <i>Slotter, </i>activated in sequence, make up WGE. <i>Stem Transformer </i>applies the appro­priate transformation rules to the stem template, <i>Affixer </i>adds an affix to the transformed template, and finally <i>Slotter </i>applies the transformed radi­cals to the affixed template to produce the final affixed word.</p><p>WGE begins with a stem ID from the <i>MainDic-tionary Table </i>as input. The root and entry associ­ated with the stem ID are used to identify the radi­cals of the root, the stem template string, the set of transformation rules that apply, and an affix list.</p><p><i>Stem Transformer </i>is applied incrementally us­ing radicals, a template string, and one transfor­mation rule per pass, as in Figure 1. The output of each pass is fed back into <i>Stem Transformer </i>as a modified template string and modified radicals, along with the next transformation rule. When all rules associated with the template are exhausted, the resultant template string and radicals are out­put to the next phase.</p><doubt alpha="14.3" length="7" tooSmall="True" monospace="0.0">!_____L</doubt><p><u>final when i=n </u><b><i><u>I </u></i></b>template_string</p><doubt alpha="78.6" length="14" tooSmall="True" monospace="0.0">final when i=n</doubt><doubt alpha="100.0" length="7" tooSmall="True" monospace="0.0">FjMiMiR</doubt><figure caption="Figure 1: Stem Transformation Phase"></figure><p>A template string marks the positions at which radicals belong in the template by using the Ro­man letters F, M, L, and R. These may be viewed as the variables in the template; all other char­acters are Arabic constants. Stem Transformer begins by inserting the root radicals directly after their position markers. For example, a template, I F o M L (&lt;i<b>F</b>ota<b>M</b>a<b>L</b>a)<footnote anchor="2"/>, with a radical set {j &gt;d &lt;j } ({*,k,r}), becomes I Fj o Mi Lj, (&lt;i<b>F</b>*ota<b>M</b>ka<b>L</b>ra). The result is then decomposed back into the template form, and the root radicals are updated if altered. For the same example, the stem template is transformed by an ordered sequence of rules {1,12}. The text of rule 1 is: F(.)([ " " ]*)(o) F$1$2$1. The first part specifies the match pattern and the second specifies the replace string. Rule 1 removes the infix letter o (t) and replaces it with a copy of the first radical which should directly follow the radical's diacritic. The result is the string, I F j j Mi Lj (&lt;i<b>F</b>*o*a<b>M</b>ka<b>L</b>ra).</p><p><i>Stem Transformer </i>concludes by decomposing the updated template into template text and radicals. The altered template and radical set are then passed back into <i>Stem Transformer, </i>where another rule from the rule sequence may be applied. For the example above, the decomposed template becomes I F j M L (&lt;iFo*aMaLa), while the root radical set remains unchanged. During this second pass, <i>Stem Trans­former </i>uses the altered template and radical set as input together with rule 12, whose text is, ([FMLR]?<page local="4" global="81"/>)([A " ]*)([" ]*)([FMLR]?) (\2) $1$2 . Rule 12 is a gemination rule, and uses a backreference in the search pattern, in order to match any repeated letter. With its replace string, the second of the duplicate letters is replaced by the gemination diacritic, / / (~).  The decomposed result is the template,</p><footnote label="2">The letters F, M, L, and R in bold are radical position markers, not transliterations.</footnote><p>I F M L , and the untransformed radical set, <i>{j&lt;é&lt;</i><i> </i>j} ({*,k,r}), which can produce the word jSji (&lt;i*~akara).</p><p>templatestring from Stem Transformer replace_string (affix)</p><doubt alpha="75.0" length="4" tooSmall="False" monospace="0.0">M IM</doubt><doubt alpha="100.0" length="4" tooSmall="False" monospace="0.0">LijR</doubt><p><b>C</b>
<b>_ ^\ I </b>Generic Intermediate</p><p>Compose   JI      stem Match</p><doubt alpha="25.0" length="4" tooSmall="False" monospace="0.0">__]j</doubt><doubt alpha="20.0" length="5" tooSmall="False" monospace="0.0">_ J_1</doubt><p>J-<u>Transform ^</u></p><p>Intermediate Word</p><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">I</doubt><p>Transformed <b><u>I </u></b><u>Decompose </u><b><u>J</u>«-<u>1  </u></b><u>Intermediate Stem</u> template_string</p><doubt alpha="100.0" length="5" tooSmall="False" monospace="0.0">final</doubt><doubt alpha="83.3" length="6" tooSmall="False" monospace="0.0">final!</doubt><doubt alpha="100.0" length="7" tooSmall="False" monospace="0.0">Affixer</doubt><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">][</doubt><figure caption="Figure 2: The Affixer Phase"></figure><p>In brief, the final output of <i>Stem Transformer </i>is a root-transformed template and a template-transformed radical set. These outputs are used as input to the affixation phase which succeeds stem transformation. <i>Affixer, </i>which is applied itera-tively on the result of <i>Stem Transformer, </i>outputs 17 different affixed morphosyntactic forms for every stem. <i>Affixer </i>is run with different replace strings specific to the type of affix being produced. It modifies copies of the transformed stem from the previous phase, as in Figure 2. For example, I F M L is passed to Affixer, with radical set, j} ({*,k,r}), and the past active feminine singular affix replace string, $1$6M$7 L$11o. Figure 3 shows the generic transformed-template match string and indicates the back-reference groupings, which are used in the replace string for the affix. The result of applying the affix transformation above is the affixed template string, I F M L o (&lt;i<b>F</b>~a<b>M</b>a<b>L</b>ato).</p><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">F</doubt><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">M</doubt><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">L</doubt><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">R</doubt><doubt alpha="80.6" length="31" tooSmall="True" monospace="0.0">[replace R literal with R value</doubt><doubt alpha="83.3" length="30" tooSmall="True" monospace="0.0">replace L literal with L value</doubt><doubt alpha="83.3" length="30" tooSmall="True" monospace="0.0">replace M literal with M value</doubt><doubt alpha="83.3" length="30" tooSmall="True" monospace="0.0">replace F literal with F value</doubt><p>Transform</p><p><b>I </b>template string</p><p>Transform 1-</p><p><b>[S</b><b>lotter !</b></p><doubt alpha="62.5" length="8" tooSmall="False" monospace="0.0">final ^_</doubt><p>Affixed Word</p><figure caption="Figure 4: The Slotter Phase"></figure><p>In <i>Slotter, </i>the last stage of word generation, transformed radicals replace the Roman position markers in the transformed template, to produce the final form of the word. For the example above, the result is OjSji (&lt;i*~akarato) which is the past active feminine singular form of the word.</p></subsection></section><section number="3" title="T-Code Encoding"><p>Using a format that allows searching the database, we output an alphabetically sorted list of each of the 2 million words that WGE generated. Since diacritics are optional in written Arabic, we wanted to facilitate the matching process by having the possibility of ignoring diacritics or only matching those diacritics that a search item specifies.<page local="5" global="82"/> In order to achieve this, we indexed our list for lookup using bare words, words without diacritics. For each entry, we included the root, template, and affix type identifiers as numbers. This gave the capability of generating the actual word after lookup in order to pinpoint an exact diacritic match if necessary.</p><table caption="Figure 3: The generic transformed-template match string" class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>2</p><p>(([AFMLRJ*</p></td><td class="cell"><p>F</p></td><td class="cell"><p>3</p><p>([' '   " ]*)</p></td><td class="cell"><p>4</p><p>:i * "°*»</p></td><td class="cell"><p>6</p><p>(([AFMLR]*)</p></td><td class="cell"><p>M</p></td><td class="cell"><p>7</p><p>([ ' ]*)</p></td><td class="cell"><p>8</p><p>([" "']*))</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>1</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>5</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>L</b></p></td><td class="cell"><p><b>R</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>ni i-Mi.K 1* 1 i.ii ' r&gt;</p></td><td class="cell"><p>12</p></td><td class="cell"><p>14</p><p>(([AFMLR]*)</p></td><td class="cell"><p>R</p></td><td class="cell"><p>15</p><p>([' '   "° ]*)</p></td><td class="cell"><p>16</p><p>i ' "r»</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>9</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>13</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>template_string <b>1</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>rom</p></td><td class="cell"><p>Affixer</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><i>m</i></p></td><td class="cell"><p>1 M !</p></td><td class="cell"><p>U i R !</p><p><b>r 'r I</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p>Indexing the complete word list from WGE and storing it in a disk-based B-Tree data structure yields files larger than 100 MB<footnote anchor="3"/> Since our dictio­nary only represents the verbs of Arabic, adding the nouns would at least double its size; therefore, it would be advantageous to keep the dictionary's disk size minimal.</p><p>T-Code encoding, like Huffman encoding, is a variable length coding scheme. The basis of T-Code text compression is that shorter codes are assigned to frequently repeated items. Since un­compressed text is normally represented by fixed length codes in software, T-Code is capable of achieving a large compression factor for text be­cause it has low entropy. For the word database produced by WGE, a great amount of redundancy exists since the 2 million words are based on only 5,500 verb roots. T-Code has the advantage of self-synchronisation; that is, a series of bits from a code will only be recognised as being members of the T-Code set if they constitute a valid code word. If a series of bits does not belong to the T-Code set, it will not be valid until all the bits of the code arrive. This is useful because no additional code length information needs to be stored in the data.</p><p>The T-Codes used to encode the database are obtained by first calculating a target distribution of code bit-lengths, then creating an adjusted T-Code distribution based on the target, and finally assigning the shortest codes to the most frequent data items.</p><subsection number="3.1" title="Calculating a Target Distribution"><p>A target distribution for the dictionary database was calculated using the frequencies of its unique items. The equation below was used to calculate the code's target bit-length <b>t </b>for each data item <b>i</b> in the database using the item's average frequency <i>Û</i></p><footnote label="3">The file size being so large is explainable by the fact that Unicode UTF-16 uses 16-bits per Arabic character (Consor­tium, 2003), which causes output to be twice as large as it may have been for Roman characters.</footnote><doubt alpha="37.5" length="24" tooSmall="False" monospace="0.0">ti = -[log2fi \,i= 0...n</doubt><p>We grouped the frequencies of unique root, template, and affix type identifier numbers for each word entry. Additionally, a slightly different frequency count for the letters of the lookup words was performed in order to take into ac­count their compressed form. Special attention was given to the compression of the low entropy lookup words whose efficient access is essential.</p><p>The bare words forming the lookup entries have a one-to-many relationship with actual words. That is, many different generated words with diacritics may become the same lookup entry when diacritics are removed. Therefore, if it is possible to distinguish between one bare word and the next, repetition of lookup entries is unnecessary. A bit-skip field is used in the encoded database to mark the end of an entry; details of this and the encoded database format are discussed in Section 3.2. During this phase, we were only concerned with the frequency of the letters of the lookup items in the final database, so unique entries had their letters counted only once.</p><p>Another source of redundancy in lookup items appears in their alphabetically sorted form. Of­ten, an entry shares initial letters with following entries.<page local="6" global="83"/> While the dictionary format handles this, calculation of a target distribution only counts let­ters not sequentially shared between consecutive entries, as may be seen in Table 1.</p><table caption="Table 1: Eliminating redundancy by not counting repeated letters." class="main" frame="box" rules="all" border="0" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Original</p></td><td class="cell"><p></p></td><td class="cell"><p>Letters Counted</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Entry</b></p></td><td class="cell"><p><b>Transliteration</b></p></td><td class="cell"><p><b>Entry</b></p></td><td class="cell"><p><b>Transliteration</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>V<footnote anchor="1"/></p></td><td class="cell"><p>Ab</p></td><td class="cell"><p></p></td><td class="cell"><p>Ab</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>LI</p></td><td class="cell"><p>AbA</p></td><td class="cell"><p>I..</p></td><td class="cell"><p>..A</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>LU</p></td><td class="cell"><p>AbAbA</p></td><td class="cell"><p></p></td><td class="cell"><p>...bA</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>cûLI</p></td><td class="cell"><p>AbAtt</p></td><td class="cell"><p>ol..</p></td><td class="cell"><p>tt</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>^LI</p></td><td class="cell"><p>AbAtmtm</p></td><td class="cell"><p></p></td><td class="cell"><p>....mtm</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>(^jjLI</p></td><td class="cell"><p>AbAtntn</p></td><td class="cell"><p>CK....</p></td><td class="cell"><p>....ntn</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>oLI</p></td><td class="cell"><p>AbAv</p></td><td class="cell"><p>a...</p></td><td class="cell"><p>...v</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>&lt;jiLI</p></td><td class="cell"><p>AbAvn</p></td><td class="cell"><p><i>à----</i></p></td><td class="cell"><p>.... n</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>AbAj</p></td><td class="cell"><p>rr-..</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>ULI</p></td><td class="cell"><p>AbAjA</p></td><td class="cell"><p>I</p></td><td class="cell"><p>.... A</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>AbAjn</p></td><td class="cell"><p><i>à----</i></p></td><td class="cell"><p>.... n</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>bAjwA</p></td><td class="cell"><p></p></td><td class="cell"><p>bAjwA</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><doubt alpha="100.0" length="6" tooSmall="True" monospace="0.0">Header</doubt><doubt alpha="81.5" length="27" tooSmall="True" monospace="0.0">data_start_pos data_end_pos</doubt><table caption="Table 2: A T-Code distribution from the target dis­tribution for the dictionary."></table></subsection><subsection number="3.2" title="Encoding the Dictionary"><p>A T-Code distribution was calculated based on the target distribution, as in Table 2. Its codes were created and sorted from shortest to longest then as­signed to the unique data items of the database in order of most frequent to least frequent. The un­compressed dictionary's data items were then T-Code encoded.</p><p>Figure 5 depicts the encoded dictionary struc­ture. A header is used to identify the positions of the start and end of the encoded data. The T-Code encoded data is represented as a continuous bit stream written in byte-sized units.</p><subsubsection number="3.2.1" title="Indexing and Accessing the Dictionary"><p>Access to the dictionary is required to be sequential. Without a proper indexing system lookups would be inefficient, having potential complexity of order <i>O(N). </i>To facilitate efficient lookups, a simple first letter lookup was used to give direct access to the byte position of the first entry using the first letter of the lookup word.</p><doubt alpha="93.8" length="16" tooSmall="True" monospace="0.0">Alphabetic Index</doubt><doubt alpha="86.4" length="22" tooSmall="True" monospace="0.0">— letter Startposition</doubt><doubt alpha="64.5" length="31" tooSmall="True" monospace="0.0">Encoded Data♦[bit -stream   - -</doubt><figure caption="Figure 5: The encoded dictionary structure."></figure><p>While the first-letter-lookup gives a reasonable efficiency advantage, the rest of the lookup pro­cess is required to sequentially read the entries starting with the first letter. In order to address this, we added a two-byte fixed width field at the start of every entry, and distributed their bits as in Figure 6. An example in Table 3 illustrates how the fixed width fields are used.</p><table caption="Table 3: An example illustrating how the next en­try bit-skip and shared letter fields are used."></table><p>The first 12 bits store the distance in bits to the next test entry. If the word being searched for in the dictionary does not have a partial match with the test word at the current entry, the bit-skip field points to the next entry that does not begin with all the same letters. If a partial match is found, then only words between the current position and the bit-skip position may match the lookup word.</p><p>The remaining 4 bits store information on the<page local="7" global="84"/></p><table caption="Table 2: A T-Code distribution from the target distribution for the dictionary." class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Code</b></p></td><td class="cell"><p><b>Target</b></p></td><td class="cell"><p><b>Modified</b></p></td><td class="cell"><p><b>T-Code</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Length</b></p></td><td class="cell"><p><b>Frequency</b></p></td><td class="cell"><p><b>Target</b></p></td><td class="cell"><p><b>Distribution</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>5</p></td><td class="cell"><p>9</p></td><td class="cell"><p>5</p></td><td class="cell"><p>5</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>6</p></td><td class="cell"><p>5</p></td><td class="cell"><p>9</p></td><td class="cell"><p>9</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>7</p></td><td class="cell"><p>-</p></td><td class="cell"><p>-</p></td><td class="cell"><p>0</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>8</p></td><td class="cell"><p>2</p></td><td class="cell"><p>2</p></td><td class="cell"><p>2</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>9</p></td><td class="cell"><p>-</p></td><td class="cell"><p>-</p></td><td class="cell"><p>0</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>10</p></td><td class="cell"><p>4</p></td><td class="cell"><p>4</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>11</p></td><td class="cell"><p>3</p></td><td class="cell"><p>3</p></td><td class="cell"><p>3</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>12</p></td><td class="cell"><p>9</p></td><td class="cell"><p>9</p></td><td class="cell"><p>9</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>13</p></td><td class="cell"><p>10</p></td><td class="cell"><p>10</p></td><td class="cell"><p>10</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>14</p></td><td class="cell"><p>2</p></td><td class="cell"><p>2</p></td><td class="cell"><p>2</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>15</p></td><td class="cell"><p>-</p></td><td class="cell"><p>-</p></td><td class="cell"><p>0</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>16</p></td><td class="cell"><p>16378</p></td><td class="cell"><p>3836</p></td><td class="cell"><p>3836</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>17</p></td><td class="cell"><p>2750</p></td><td class="cell"><p>7232</p></td><td class="cell"><p>7233</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>18</p></td><td class="cell"><p>-</p></td><td class="cell"><p>8059</p></td><td class="cell"><p>14159</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>19</p></td><td class="cell"><p>-</p></td><td class="cell"><p>-</p></td><td class="cell"><p>27308</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>20</p></td><td class="cell"><p>3</p></td><td class="cell"><p>3</p></td><td class="cell"><p>52009</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><table caption="Table 3: An example illustrating how the next entry bit-skip and shared letter fields are used." class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Pos.</b></p></td><td class="cell"><p><b>Entry</b></p></td><td class="cell"><p><b>Transliteration</b></p></td><td class="cell"><p><b>Next Pos.</b></p></td><td class="cell"><p><b>Shared</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>0</p></td><td class="cell"><p>vI</p></td><td class="cell"><p>Ab</p></td><td class="cell"><p>11</p></td><td class="cell"><p>0</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>1</p></td><td class="cell"><p>LI</p></td><td class="cell"><p>AbA</p></td><td class="cell"><p>11</p></td><td class="cell"><p>2</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>2</p></td><td class="cell"><p>LLI</p></td><td class="cell"><p>AbAbA</p></td><td class="cell"><p>3</p></td><td class="cell"><p>3</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>3</p></td><td class="cell"><p>cûLI</p></td><td class="cell"><p>AbAtt</p></td><td class="cell"><p>4</p></td><td class="cell"><p>3</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>4</p></td><td class="cell"><p>^Ll</p></td><td class="cell"><p>AbAtmtm</p></td><td class="cell"><p>5</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>5</p></td><td class="cell"><p>(^jjLI</p></td><td class="cell"><p>AbAtntn</p></td><td class="cell"><p>6</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>6</p></td><td class="cell"><p>oLI</p></td><td class="cell"><p>AbAv</p></td><td class="cell"><p>8</p></td><td class="cell"><p>3</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>7</p></td><td class="cell"><p>&lt;jiLI</p></td><td class="cell"><p>AbAvn</p></td><td class="cell"><p>8</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>8</p></td><td class="cell"><p></p></td><td class="cell"><p>AbAj</p></td><td class="cell"><p>11</p></td><td class="cell"><p>3</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>9</p></td><td class="cell"><p>ULI</p></td><td class="cell"><p>AbAjA</p></td><td class="cell"><p>10</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>10</p></td><td class="cell"><p></p></td><td class="cell"><p>AbAjn</p></td><td class="cell"><p>11</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>11</p></td><td class="cell"><p></p></td><td class="cell"><p>bAjwA</p></td><td class="cell"><p>12</p></td><td class="cell"><p>4</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><doubt alpha="84.0" length="50" tooSmall="True" monospace="0.0">next entry bit skip_shared letter count_entry info</doubt><p>Figure 6: An entry using 12 bits for number of bits to skip to next entry and 4 bits for the number of shared letters.</p><p>number of letters shared between the current word and the next word. This allows the decoder to compare only the codes of the letters that have not been tested earlier, reducing the number of com­parisons needed to make a match.</p></subsubsection><subsubsection number="3.2.2" title="Results"><p>Using T-Codes and the indexing system de­scribed in this section, the dictionary disk-size was reduced to a mere 8 megabytes. The cur­rent dictionary size includes search and lookup information, which is over 90% smaller than the uncompressed B-Tree version with a comprable lookup speed.</p><p>Two devices may use a copy of the dictionary in order to communicate using T-Code transmission. A device may encode and transmit every Arabic word in a message into three codes containing the root, template, and affix identifiers for the word. The bandwidth used to transmit an Arabic word becomes a fraction of the equivalent T-Code en­coded word.</p><p>For example, consider a word such as (yaktubwna), which consists of the root, template, and affix identifier set {12884,460,30}. The T-Code lengths will depend only on the statistical frequency of each of these identifiers for all the words in an Arabic corpus so as to provide maxi­mum efficiency; in this case the word may be rep­resented as {0010101, 001001, 10100} and trans­mitted as 18 bits. Compare this size with the same word transmitted in Unicode. This 9 letter word would normally require 2,592 bits to be transmit­ted in raw Unicode(16-bit per character x 9 char­acters). If, instead, the raw identifier set was trans­mitted, it would require 48 bits (16-bit per inte­ger x 3 integers), which is still significantly higher than the T-Code encoded form.</p></subsubsection></subsection></section><section number="4" title="A Simple Application: A Root Extractor and Word Parser"><p>To demonstrate the efficiency of the dictionary, we created a PERL based implementation of the decoder, and wrote a web CGI that derives and parses Arabic words. This particular implemen­tation, although very simple, also functions as an accurate root extractor.</p><doubt alpha="60.4" length="111" tooSmall="False" monospace="0.0">QiSack.Q -[*?]  [^] £J)I^Search ^Favorites Add esshttp://localhost:1080/cgi-bin/extract.cgi?™rd=%D8%B3%D97o8A%D</doubt><p><b>jSiiw </b>(sydkr)</p><p><b><i>Ôkr - sayaddaklru</i></b> <b><i>Ökr - sayuddakaru</i></b></p><doubt alpha="83.3" length="24" tooSmall="True" monospace="0.0">PrefiK:Future particle +</doubt><doubt alpha="77.8" length="54" tooSmall="True" monospace="0.0">Imperfect Indicative Active,tie(3rd pers. masc. sing.)</doubt><doubt alpha="78.2" length="55" tooSmall="True" monospace="0.0">Imperfect Indicative Passive,He(3rd pers. rnasc. sing.)</doubt><p>Figure 7: Example output from the word-parser Web CGI using the T-Code encoded dictionary of Arabic words.</p><p>A UTF-8 Unicode-encoded HTML webpage accepts Arabic words in a simple form. The CGI is invoked with the input stripped of diacritics. Next, the CGI removes combinations of conjunc­tion, prefix, and suffix letters that it finds in a pre-supplied list of affixes and it begins with the longest to the shortest sequences. The original word and each of its stripped forms are T-Code en­coded and pushed into a queue. Entry codes that match any of the items in the queue are retrieved with their identifier lists from the dictionary and decoded. Identifiers are used in order to generate the words with diacritics that the entry identifies.<page local="8" global="85"/> Also, the identifier information is used to morpho­logically classify the entered word and the affixes that are used with it. The various possible mor­phological parsings are then output to HTML, as in Figure 7.</p><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>_</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>_</p></td><td class="cell"><p>_</p></td><td class="cell"><p></p></td><td class="cell"><p>_</p></td><td class="cell"><p>_</p></td><td class="cell"><p><b>2</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>2-</p></td><td class="cell"><p>byte</p></td><td class="cell"><p>fixed</p></td><td class="cell"><p>width</p></td><td class="cell"><p>field</p></td><td class="cell"><p></p></td><td class="cell"><p>variable length t-code sequence</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table></section><section number="5" title="Further Work"><p>We have described a system that uses T-Code to compress and access a comprehensive list of Ara­bic verbs by their morphological properties. Word generation here is restricted to verbs, but further research must extend the coverage to verbs and rootless words such as particles and loan words.</p><p>Once data has been obtained for word gen­eration of nouns, the implementations of many of the applications discussed in the introduction become feasible. For example, a spell checker can be instructed to recognise conjunction, prefix, and suffix letter combinations, as de­scribed in Section 4. Since these letters do not cause alteration to adjacent letters, they may be removed and the remaining stem looked up in the dictionary. If a match is not found, a spelling error may be reported. Suggested spellings may come from the word-generation and transformation rules of the closest matching word or words. The closest match, like in English spell-checkers, would be the words that have reasonable character-correspondence.</p><p>Using the root-extraction algorithm in Sec­tion 4, root-based searching becomes possible. Both the search term and search text will undergo root extraction before a match is found.</p><p>Incremental searches such as that used in pre­dictive text messaging only need to have a list of the conjunctions and affixes added to the dic­tionary list. The implementation can then allow combinations of conjunctions and affixes to at­tach to dictionary entries. Since the dictionary list now includes all forms affixed, transformed, and disguised, valid Arabic words will always find a match in the dictionary.</p><p>In the near future, we hope to increase the lookup and decoding speed by creating a T-Code Finite State Automaton (FSA) for the dictionary as described in (Nithyaganesh, 1998), which will be able to read an entire byte or two and output several code words.    Currently, the decoding process tests if a code belongs to the T-Code set; if it does not match, another bit is added to the T-Code before it is tested once more. This continues until the code matches a code from the valid T-Code set. With a T-Code FSA, a significant improvement in the decoding speed will be witnessed, since bytes are looked up rather than bits.</p></section><references><p>Evan L Antworth. 1990. PC-KIMMO: a two-level processor for morphological analysis. <i>Occasional Publications in Academic Computing, </i>16.</p><p>Kenneth R Beesley. 2001. Finite-state morpholog­ical analysis and generation of arabic at xerox re­search: Status and plans in 2001. In <i>ARABIC Lan­guage Processing: Status and Prospects. </i>Arabic NLP Workshop at ACL/EACL 2001, July.</p><p>The Unicode Consortium, 2003. <i>The Unicode Stan­dard, Version 4.0, </i>chapter 2, page 29. Addison-Wesley, Reading, MA. ISBN 0-321-18578-1.</p><p>Jeffery E. F. Friedl. 2002. <i>Mastering Regular Expres­sions. </i>O'Reilly, 2nd edition, July.</p><p>Ulrich Gunther. 1998. <i>Robust Source Coding With Generalised T-Codes. </i>Ph.D. thesis, University of Auckland.</p><p>Lauri Karttunen and Kenneth R Beesley. 1992. Two-level rule compiler. Technical Report ISTL-92-2, Xerox, Xerox Palo Alto Research Center, Palo Alto, California.</p><p>L. Karttunen, J-P. Chanod, G. Grefenstette, and A. Schiller. 1997. Regular expressions for language engineering. In <i>Natural Language Engineering, </i>pages 238-305. February 5.</p><p>Lauri Karttunen. 1993. Finite-state lexicon compiler. Technical Report ISTL-NLTT-1993-04-02, Xerox, Xerox Palo Alto Research Center, Palo Alto, Cali­fornia, April.</p><p>Kirubalaratnam Nithyaganesh. 1998. <i>The Talk-Net Project Real-Time Speech Communication Using T-Codes. </i>MSc thesis, University of Auckland.</p><p>Mark R Titchener. 1984. Digital encoding by means of new t-codes to provide improved data synchroniza­tion and message integrity. In <i>Technical Note, IEE Proceedings, </i>volume 131 of <i>4, </i>pages 51-53, July.</p><p>Mark R Titchener. 1997. The synchronization of variable-length codes. <i>IEEE Transactions on Infor­mation Theory, </i>43:683-691, March.</p></references></body></article>