def read_item_dict(item_file):
  """Reads an source/rir dict from a tab separated source/rir file."""
  item_dict = {}
  with open(item_file, 'r') as f:
    for line in f:
      line = line.rstrip('\n')
      fields = line.split('\t')
      item_key = fields[0]
      items = fields[1:]
      subfolder = items[0].split('/')[0]
      if subfolder not in item_dict:
        item_dict[subfolder] = {}
      item_dict[subfolder][item_key] = items
  return item_dict