Group segments by type