# Path: broca/common/util.py
# def gram_size(term):
#     """
#     Convenience func for getting n-gram length.
#     """
#     return len(term.split(' '))


from broca.common.util import gram_size


def prune(tdocs):
    """
    Prune terms which are totally subsumed by a phrase

    This could be better if it just removes the individual keywords
    that occur in a phrase for each time that phrase occurs.
    """
    all_terms = set([t for toks in tdocs for t in toks])
    terms = set()
    phrases = set()
    for t in all_terms:

# Path: broca/common/util.py
# def gram_size(term):
#     """
#     Convenience func for getting n-gram length.
#     """
#     return len(term.split(' '))


# Path: broca/tokenize/util.py
from broca.common.util import gram_size



def prune(tdocs):
    """
    Prune terms which are totally subsumed by a phrase

    This could be better if it just removes the individual keywords
    that occur in a phrase for each time that phrase occurs.
    """
    all_terms = set([t for toks in tdocs for t in toks])
    terms = set()
    phrases = set()
    for t in all_terms:

        if gram_size(t) > 1: