def ngram(string: str, n: int) -> tuple:
    """
    constructs all possible ngrams from the given string. If the string is shorter then
    the n then the string is returned

    Parameters
    ----------
    string
    n : int
        value must be larger at least 2

    Returns
    -------
    tuple of strings

    Examples
    --------
    >>> ngram('this', 2)
    ('th', 'hi', 'is')
    """
    N = len(string)
    if n > N:
        return string,
    if n < 2:
        raise ValueError('n for a ngram must be 2 or larger')
    return tuple(string[i:i+n] for i in range(N-n+1))