## 3 Proposed Work
### Emoticon Disambiguation  
Preparing the review data for emotion score calculation and for replacing the emoticon in the reviews with their corresponding meaning, in addition to detecting the emoticon in the reviews during the computation process of emoticon score for ArEmo lexicon, the study suggests an emoticon disambiguation algorithm, presented in Algorithm 2, using regular expression and recursion techniques. This algorithm removes hyperlinks from reviews to avoid considering the following part between parentheses of the hyperlink: (:\(\backslash\)) as an emoticon. Figure 1: Two variations of input Arabic review data. Figure 2: Extraction process for the modified input of Arabic review data. The emoticon disambiguation algorithm also calls the enclosed brackets removal algorithm in Algorithm 3 to remove all nested and non-nested enclosed brackets while keeping the brackets that precede or follow an emoticon, as part of it, such as (\(\_\)-) to resolve considering a colon next to a bracket whether from left or right as an emoticon, such as \(\langle\). Thus, it keeps only brackets that belong to emoticons, such as :\(\rangle\), :], or :\(\langle\). The enclosed bracket removal algorithm deals with four types of brackets, which are round brackets: \(\rangle\), angle brackets: \(\langle\)\(>\) or \(\langle\rangle\), square brackets: [], and curly brackets: \(\{\}\). They are also known as parentheses, chevrons, brackets, and braces. The case of equality at line 24 occurs with reversed brackets or with an emoticon surrounded by its brackets to stop the recursive function. ``` Input: a review. Output: an updated review after recursively removing all enclosed and nested brackets while preventing removal of the emoticons surrounded by two brackets. START
1. BrackegEx = \(\langle\)(\(\exists\))(\(\(\forall\)\



### Arabic Emoji and Emoticon Opinion Lexicon Creation

This section explains the method of generating the proposed Arabic emoji and emotion lexicon for opinion mining (ArEmo lexicon) that uniquely considers both emojis and emoticons and some new emoticons not included in other lexicons. The ArEmo lexicon has 301 emojis and emoticons. Moreover, it computes the emotion score for each emoji or emoticon, concerning five classes of reviews' ratings, instead of the common consideration of three classes in the literature. The proposed ArEmo lexicon has two versions, both made using the train part of the HARD dataset, but they differ in the type of dataset that is either unbalanced or balanced. Tables 3 and 4 show the top 10 most frequently used emojis and emoticons extracted from the train part of the unbalanced and balanced HARD dataset. The classification column labels the emoticon as Western or Eastern, also known as vertical and horizontal emoticons, respectively. \begin{table}
\begin{tabular}{c c c c} \hline
**Arabic Review** & **Translated Review into English** & **Ambiguous Emoticon** \\ \hline \"_when 35.5. The following two subsections cover emojs and emoticons' collection and scoring methods. #### 3.3.1. Emoji and Emoticon Collection

Extracting the emojs from the train part of the HARD dataset mandated utilizing an emoji pattern using regular expression. For extracting emoticons from the dataset, the following needed to be removed from the reviews' data: numbers, Arabic letters, Arabic diacritics, special Arabic letters, and English letters. Then, after obtaining each review in only symbols, the manual selection occurred for the symbols that look similar to an emoticon. Appropriately descriptive naming is given to naming the collected emojs and emoticons when no such one was found from multiple sources in [40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50]. #### 3.3.2. Emotion Score Method

For calculating the emotion score for the ArEmo lexicon, this paper adapted and extended the solution model proposed by [18] to include five opinion labels that are \(-1\), \(-0.5\), \(0\), \(0.5\), and \(1\), instead of three labels.