from typing import Counter


def parameters_sampled(dataset):
    """Check which parameters are given for which languages.

    Return the dictionary mapping all language ids present in the dataset's
    primary table to the set of parameter ids with values for that language.

    Parameters
    ----------
    dataset: pycldf.Dataset

    Returns
    -------
    dict

    """
    languageReference = dataset[dataset.primary_table, "languageReference"].name
    parameterReference = dataset[dataset.primary_table, "parameterReference"].name
    return Counter(row[languageReference] for row in dataset[dataset.primary_table])