import os, sys
DICTIONARY_FILE = os.path.join(sys.prefix, 'dictionaries/ice_pron_dict_standard_clear.csv')
HEAD_FILE = os.path.join(sys.prefix, 'data/head_map.csv')
MODIFIER_FILE = os.path.join(sys.prefix, 'data/modifier_map.csv')
VOWELS_FILE = os.path.join(sys.prefix, 'data/vowels_sampa.txt')
CONS_CLUSTERS_FILE = os.path.join(sys.prefix, 'data/cons_clusters_sampa.txt')


def read_map(filename):
    with open(filename) as f:
        file_content = f.read().splitlines()
    dict_map = {}
    for line in file_content:
        arr = line.split('\t')
        if len(arr) > 1:
            values = arr[1:]
        else:
            values = []
        key = arr[0]
        dict_map[key] = values
    return dict_map


def read_dictionary(filename):
    with open(filename) as f:
        file_content = f.read().splitlines()
    pronDict = {}
    for line in file_content:
        word, transcr = line.split('\t')
        pronDict[word] = transcr
    return pronDict


def read_list(filename):
    with open(filename) as f:
        file_content = f.read().splitlines()
    return file_content


def get_head_map():
    return read_map(HEAD_FILE)


def get_modifier_map():
    return read_map(MODIFIER_FILE)


def get_dictionary():
    return read_dictionary(DICTIONARY_FILE)


def get_vowels():
    return read_list(VOWELS_FILE)


def get_cons_clusters():
    return read_list(CONS_CLUSTERS_FILE)

[((2, 18, 2, 91), 'os.path.join', 'os.path.join', ({(2, 31, 2, 41): 'sys.prefix', (2, 43, 2, 90): '"""dictionaries/ice_pron_dict_standard_clear.csv"""'}, {}), "(sys.prefix, 'dictionaries/ice_pron_dict_standard_clear.csv')", False, 'import os, sys\n'), ((3, 12, 3, 57), 'os.path.join', 'os.path.join', ({(3, 25, 3, 35): 'sys.prefix', (3, 37, 3, 56): '"""data/head_map.csv"""'}, {}), "(sys.prefix, 'data/head_map.csv')", False, 'import os, sys\n'), ((4, 16, 4, 65), 'os.path.join', 'os.path.join', ({(4, 29, 4, 39): 'sys.prefix', (4, 41, 4, 64): '"""data/modifier_map.csv"""'}, {}), "(sys.prefix, 'data/modifier_map.csv')", False, 'import os, sys\n'), ((5, 14, 5, 63), 'os.path.join', 'os.path.join', ({(5, 27, 5, 37): 'sys.prefix', (5, 39, 5, 62): '"""data/vowels_sampa.txt"""'}, {}), "(sys.prefix, 'data/vowels_sampa.txt')", False, 'import os, sys\n'), ((6, 21, 6, 77), 'os.path.join', 'os.path.join', ({(6, 34, 6, 44): 'sys.prefix', (6, 46, 6, 76): '"""data/cons_clusters_sampa.txt"""'}, {}), "(sys.prefix, 'data/cons_clusters_sampa.txt')", False, 'import os, sys\n')]