Review Article
A Comparative Study of Some Automatic Arabic Text Diacritization Systems
Algorithm 4
create_Distribution_Of_Letter_3-grams_Having_A_Successor.
(i) | //Extract the 3-gram letters that have a successor to form the 4-grams. | (ii) | //This method can be used when calculating the Absolute Discount Smoothing | (iii) | Input: list of diacritized 4-grams grams,//each 4-gram is a tuple | (iv) | Output: a dictionary d representing the distribution of 3-gram letters that have a successor | (v) | SET unzip EQUAL TO EMPTY LIST | (vi) | SET n_minus_one_grams EQUAL TO EMPTY LIST | (vii) | SET d EQUAL TO EMPTY DICTIONARY | (viii) | unzip: = LIST(zip(grams))//Unzip the grams into 4 tuples | (ix) | unzip.pop()//delete the last tuple | (x) | n_minus_one_grams: = zip(unzip[0], unzip [1], unzip [2]) | (xi) | d: = freqDist(list(n_minus_one_grams)) | (xii) | RETURN d |
|