kmike/DAWG — pull request #12 by fnl (2013-06-19 17:00:31+00:00)
Title: scanning query strings with offsets

Added a ``offset`` kw-paramter to ``dawg.prefixes()`` (and ``.iterprefixes()``) to make it possible to iteratively scan a string for prefixes without having to take slices of each prefix of the query. I.e., before::

dwag = DWAG([...])

def scan(query:str):
for i in range(len(query)):
yield dawg.prefixes(query[i:])

New behavior::

def scan(query:str):
for i in range(len(query)):
yield dawg.prefixes(query, i)