def check_categories(lines):
    """
  find out how many row and col categories are available
  """
    rcat_line = lines[0].split('\t')
    num_rc = 0
    found_end = False
    for inst_string in rcat_line[1:]:
        if inst_string == '':
            if found_end is False:
                num_rc = num_rc + 1
        else:
            found_end = True
    max_rcat = 15
    if max_rcat > len(lines):
        max_rcat = len(lines) - 1
    num_cc = 0
    for i in range(max_rcat):
        ccat_line = lines[i + 1].split('\t')
        if ccat_line[0] == '' and len(ccat_line) > 1:
            num_cc = num_cc + 1
    num_labels = {}
    num_labels['row'] = num_rc + 1
    num_labels['col'] = num_cc + 1
    return num_labels
