import string
import re
import hashlib


def get_hash(text):
    """Generate a hashkey of text using the MD5 algorithm."""

    punctuation = string.punctuation
    punctuation = punctuation + "’" + "“" + "?" + "‘"
    text = [c if c not in punctuation else ' ' for c in text]
    text = ''.join(text)
    text = re.sub(r'\s+', ' ', text)
    text = text.lower()
    text = text.strip()
    return hashlib.md5(text.encode()).hexdigest()[:10]