Text this: The open-closed mod-minimizer algorithm