r There are 28 letters in Arabic which are represented using approximately 40 characters in the transliteration of Modern Standard Arabic orthography of Buckwalter (2002).
we are unaware of any set of rules which attempts to address this task, or of the chances of solving this problem deterministically.