import re


def _ngrams(string, n=3):
    """
    Calculate n-grams for the input string.
    """
    string = re.sub(r"[,-./]|\sBD", r"", string)
    ngrams = zip(*[string[i:] for i in range(n)])
    return ["".join(ngram) for ngram in ngrams]