def __init__(self, tokens, charsbefore = 0, charsafter = 0, textlen = 999999):
        self.startchar = max(0, tokens[0].startchar - charsbefore)
        self.endchar = min(textlen, tokens[-1].endchar + charsafter)
        self.matches = [t for t in tokens if t.matched]
        self.matched_terms = frozenset(t.text for t in self.matches)
dataset/ETHPy150Open tallstreet/Whoosh-AppEngine/src/whoosh/highlight.py/Fragment.__init__/original