Translate into segments and baseline join by sed