from typing import List
import re


def create_shingles(text: str, window: int = 4) -> List[str]:
    """
    Create shingles/ngrams from the given text. This uses character-ngrams to be language agnostic.

    Parameters
    ----------
    text : str
        Input text string
    window : int, optional
        The size of the window, by default 4

    Returns
    -------
    List[str]
        List of shingles

    Examples
    --------
    >>> create_shingles("This is a test message", window=3)
    ['thi', 'his', 'isi', 'sis', 'isa', 'sat', 'ate', 'tes', 'est', 'stm', 'tme', 'mes', 'ess', 'ssa', 'sag', 'age']
    """
    if len(text) <= window:
        return [text]

    text = re.sub(r"[^\w]+", "", text.lower())
    return [text[i : i + window] for i in range(len(text) - window + 1)]