Combine and group patterns by slot name.