def parse_form_table(dataset):
    """
    Convert the representation of a wordlist returned by pycldf
    into a more convenient form for our purposes - a tuple containing
    a set of languages, a set of meanings and a dictionary mapping
    (language, meaning) pairs to form IDs.
    """
    languages = set()
    meanings = set()
    forms = {}
    cognate_map = {}

    for form in dataset["FormTable"]:
        language = form["Language_ID"]
        languages.add(language)
        meaning = form["Parameter_ID"]
        meanings.add(meaning)
        key = (language,meaning)
        if key not in forms:
            forms[key] = []
        forms[key].append(form["ID"])

    for form in dataset["CognateTable"]:
        form_id = form["Form_ID"]
        cogset_id = form["Cognateset_ID"]
        cognate_map[form_id] = cogset_id

    return languages, meanings, forms, cognate_map