Commit eeaf0048 by Steven Bird

ContextIndex now pays attention to a user-supplied context_func

parent 31282ac6
......@@ -45,7 +45,9 @@ class ContextIndex(object):
def __init__(self, tokens, context_func=None, filter=None, key=lambda x:x):
self._key = key
self._tokens = tokens
if not context_func:
if context_func:
self._context_func = context_func
else:
self._context_func = self._default_context
if filter:
tokens = [t for t in tokens if filter(t)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment