tasks/vowels/preprocess.py
def create_dictionary(files_list):
    """
    Create a dictionary of unique lexicons in the dataset and their mapping to numbers.
    :param files_list: the list of files to scan through.
    :return: the constructed dictionary of lexicons
    """

    lexicons_dict = {}
    id_counter = 0

    llprint("Creating Dictionary ... 0/%d" % (len(files_list)))
    for indx, filename in enumerate(files_list):
        with open(filename, 'r') as fobj:
            for line in fobj:
                word = line.strip()
                if not word.lower() in lexicons_dict:
                    lexicons_dict[word.lower()] = id_counter
                    id_counter += 1

        llprint("\rCreating Dictionary ... %d/%d" % ((indx + 1), len(files_list)))

    print("\rCreating Dictionary ... Done!")
    print(lexicons_dict)
    return lexicons_dict

    Create a dictionary of unique lexicons in the dataset and their mapping to numbers.
    :param files_list: the list of files to scan through.
    :return: the constructed dictionary of lexicons
    
Create a dictionary of unique lexicons in the dataset and their mapping to numbers.
Create a dictionary of unique lexicons in the dataset and their mapping to numbers .
def create_dictionary(files_list):
    lexicons_dict = {}
    id_counter = 0
    llprint("Creating Dictionary ... 0/%d" % (len(files_list)))
    for indx, filename in enumerate(files_list):
        with open(filename, 'r') as fobj:
            for line in fobj:
                word = line.strip()
                if not word.lower() in lexicons_dict:
                    lexicons_dict[word.lower()] = id_counter
                    id_counter += 1
        llprint("\rCreating Dictionary ... %d/%d" % ((indx + 1), len(files_list)))
    print("\rCreating Dictionary ... Done!")
    print(lexicons_dict)
    return lexicons_dict
def create_dictionary ( files_list ) : lexicons_dict = { } id_counter = 0 llprint ( "Creating Dictionary ... 0/%d" % ( len ( files_list ) ) ) for indx , filename in enumerate ( files_list ) : with open ( filename , 'r' ) as fobj : for line in fobj : word = line . strip ( ) if not word . lower ( ) in lexicons_dict : lexicons_dict [ word . lower ( ) ] = id_counter id_counter += 1 llprint ( "\rCreating Dictionary ... %d/%d" % ( ( indx + 1 ) , len ( files_list ) ) ) print ( "\rCreating Dictionary ... Done!" ) print ( lexicons_dict ) return lexicons_dict
Create a dictionary of unique lexicons in the dataset and their mapping to numbers.
Create a dictionary of unique lexicons in the dataset and their mapping to numbers .
"""
    Create a dictionary of unique lexicons in the dataset and their mapping to numbers.
    :param files_list: the list of files to scan through.
    :return: the constructed dictionary of lexicons
    """
the constructed dictionary of lexicons
the constructed dictionary of lexicons
files_list
the list of files to scan through.
the list of files to scan through .