def _compute_ngrams_py(word, min_n, max_n):
    """Get the list of all possible ngrams for a given word.
    Parameters
    ----------
    word : str
        The word whose ngrams need to be computed.
    min_n : int
        Minimum character length of the ngrams.
    max_n : int
        Maximum character length of the ngrams.
    Returns
    -------
    list of str
        Sequence of character ngrams.
    """
    BOW, EOW = ('<', '>')  # Used by FastText to attach to all words as prefix and suffix
    extended_word = BOW + word + EOW
    ngrams = []
    for ngram_length in range(min_n, min(len(extended_word), max_n) + 1):
        for i in range(0, len(extended_word) - ngram_length + 1):
            ngrams.append(extended_word[i:i + ngram_length])
    return ngrams