import string
import re


def consonant_sounds(word: str):
    """Return a set with all the consonant sounds in word.
       Ex: chatting -> {'ch', 't', 'ng'}. Note that 'tt' becomes 't'."""

    consonants = ''.join([c for c in string.ascii_lowercase if c not in 'aeiou'])
    pattern = f'[aeiou]*([{consonants}]+)'
    match = set(re.findall(pattern, word.lower()))
    for cluster in match.copy():  # substitute 'tt' with 't'
        if len(cluster) > 1 and len(set(cluster)) == 1:
            match.update(cluster[0])
            match.remove(cluster)
    return match