from typing import List
import random


def generate_word_list(filename: str, count: int) -> List[str]:
    """
    Generate a list of unique words in random order.

    @param filename Test file to open
    @param count The number of unique words to return.

    Open the file and split it into words.  Then convert it into a dictionary
    and back to a list to get the unique words only.  Finally, slice the list
    up to count items.  May return a list shorter than count if there are not
    enough unique words in the input text file.

    @return List of strings
    """

    words = []

    with open(filename, 'r') as f:
       data = f.read()
       data = data.lower()
       data = data.replace(',', ' ')
       data = data.replace('.', ' ')
       data = data.replace(';', ' ')
       data = data.replace('\r', ' ')
       data = data.replace('\n', ' ')
       data = data.replace('"', ' ')
       data = data.replace('“', ' ')
       data = data.replace('”', ' ')
       words = data.split()

       # Make all the words unique
       words = list(dict.fromkeys(words))

    words = words[0:count]
    random.shuffle(words)
    return words