1. vendor2 = conds.map do |key, value|
  2. [ msg.split.find_index { |e| e.match value }, key ]
  3. end.find(&:first)