making categories case-insensitive, using groupby and group.Last to avoid implementing equalitycomparer
will use the latest match (most recent) as category