(sentences)
return trigram2idx
Create a trigram index from the list of tokenized sentences.

    :param sentences: list of list of tokens
    :return: trigram to index mapping
    >>> len(get_trigram_index([['who', 'played', 'whom']]))
    11
Create a trigram index from the list of tokenized sentences.
Create a trigram index from the list of tokenized sentences .
def get_trigram_index(sentences):
    """
    Create a trigram index from the list of tokenized sentences.

    :param sentences: list of list of tokens
    :return: trigram to index mapping
    >>> len(get_trigram_index([['who', 'played', 'whom']]))
    11
    """
    trigram_set = {t for tokens in sentences for t in tokens_to_trigrams(tokens)}
    trigram2idx = {t: i for i, t in enumerate(trigram_set, 1)}
    trigram2idx[all_zeroes] = 0
    trigram2idx[unknown_el] = len(trigram2idx)
    return trigram2idx
def get_trigram_index ( sentences ) : trigram_set = { t for tokens in sentences for t in tokens_to_trigrams ( tokens ) } trigram2idx = { t : i for i , t in enumerate ( trigram_set , 1 ) } trigram2idx [ all_zeroes ] = 0 trigram2idx [ unknown_el ] = len ( trigram2idx ) return trigram2idx