import re


def read_table(tablestr):
    """
    Take a table of the form "repr lemma, repr lemma, ..."
    and return a dictionary of representations to lemmas.

    Split on commas (ignoring adjacent whitespace), then on spaces.
    """
    entry_str_list = re.split("\s*,\s*", tablestr)
    entry_dict = dict([entry.split() for entry in entry_str_list])
    return entry_dict