def normalized_str(token):
    if isinstance(token, spacy_token):
        return token.text if preserve_case(token) else token.lemma_
    elif isinstance(token, spacy_span):
        return ' '.join(subtok.text if preserve_case(subtok) else subtok.lemma_
                        for subtok in token)
    else:
        msg = 'Input must be a spacy Token or Span, not {}.'.format(type(token))
        raise TypeError(msg)
Create a NutchUrlTrails instance for visualizing a running Nutch crawl in real-time using Bokeh
dataset/ETHPy150Open chartbeat-labs/textacy/textacy/spacy_utils.py/normalized_str--crossover with--dataset/ETHPy150Open memex-explorer/memex-explorer/source/apps/crawl_space/viz/stream.py/NutchUrlTrails.__init__