This seems to be impossible to detect automatically. The only way is to read whole text before using it.
BTW What is Ackerman function?