def get_head_ngrams(mention, axis=None, attrib="<STR_LIT>", n_min=<NUM_LIT:1>, n_max=<NUM_LIT:1>, lower=True):
spans = _to_spans(mention)<EOL>axes = (axis,) if axis else ("<STR_LIT>", "<STR_LIT>")<EOL>for span in spans:<EOL><INDENT>if span.sentence.is_tabular():<EOL><INDENT>for axis in axes:<EOL><INDENT>if getattr(span.sentence, _other_axis(axis) + "<STR_LIT>") == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>for sentence in getattr(<EOL>_get_head_cell(span.sentence.cell, axis), "<STR_LIT>", []<EOL>):<EOL><INDENT>for ngram in tokens_to_ngrams(<EOL>getattr(sentence, attrib), n_min=n_min, n_max=n_max, lower=lower<EOL>):<EOL><INDENT>yield ngram<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
Get the ngrams from the cell in the head of the row or column.

    More specifically, this returns the ngrams in the leftmost cell in a row and/or the
    ngrams in the topmost cell in the column, depending on the axis parameter.

    Note that if a candidate is passed in, all of its Mentions will be searched.

    :param mention: The Mention whose head Cells are being returned
    :param axis: Which axis {'row', 'col'} to search. If None, then both row
        and col are searched.
    :param attrib: The token attribute type (e.g. words, lemmas, poses)
    :param n_min: The minimum n of the ngrams that should be returned
    :param n_max: The maximum n of the ngrams that should be returned
    :param lower: If True, all ngrams will be returned in lower case
    :rtype: a *generator* of ngrams