def top_fragments(text, terms, analyzer, fragmenter, top = 3,
                  scorer = BasicFragmentScorer, minscore = 1):
    termset = frozenset(terms)
    tokens = copyandmatchfilter(termset,
                                analyzer(text, chars = True, keeporiginal = True))
    
    scored_frags = nlargest(top, ((scorer(f), f) for f in fragmenter(text, tokens)))
    return [sf for score, sf in scored_frags if score > minscore]
dataset/ETHPy150Open tallstreet/Whoosh-AppEngine/src/whoosh/highlight.py/top_fragments/original