To a first approximation, one can handle all of these cases using hand-written grammars-as in Sproat (1997) and Ebden and Sproat (2014).
different aspects of the problem are better treated using different approaches.