def read_file(file):
    """
    Extracts the entries from a word list that is formatted like the ones from
    NorthEuraLex. It should be a CSV file with table headers, including
    'concept_id' and 'raw_ipa'. Each word should be on a separate row.

    Keyword arguments:
    file: the word list

    Returns:
    concepts: list(list(str))
              where concepts[x+1] contains the words for concept x
    """
    concepts = []
    with open(file, 'r', encoding='utf-8') as f:
        header = next(f).split(',')
        concept_index = header.index('concept_id')
        ipa_index = header.index('raw_ipa')
        for line in f:
            cells = line.split(',')
            concept_id = int(cells[concept_index]) - 1
            ipa = cells[ipa_index]
            try:
                concepts[concept_id].append(ipa)
            except IndexError:
                concepts.append([ipa])
    return concepts