from string import punctuation
from collections import Counter


def load_text(input_file):
    """Load text from a text file and return a string"""
    with open(input_file, "r") as file:
        text = file.read()
    return text


def clean_text(text):
    """Lower case and remove punctuation from the text"""
    text = text.lower()
    for p in punctuation:
        text = text.replace(p, "")
    return text


def count_words(text):
    """Count unique words in a string"""
    text = load_text(text)
    text = clean_text(text)
    words = text.split()
    return Counter(words)
