Finished diacritics restoration algorithm imlpementation