def _find_seeks_bookmarks(fileobj, queries, debug=False):
    timer = Timer()
    locs = Counter()
    endlocs = {}
    if debug:
        print "  Searching bookmarks..."
    for query in sorted(queries):
        start, end = fileobj.find_bookmark(query.encode('utf-8'),
                                           give_range=True)
        #print "Got",start,end,"for",query.encode('utf-8')
        if not end:
            endlocs[start] = None   # None = EOF
        elif start not in endlocs or endlocs[start] < end:
            endlocs[start] = end
        #print '  ',endlocs[start]
        locs.update((start,))

    # Because of the inexact nature of bookmarks, we need to normalize
    # the locations to a non-overlapping set of ranges, some of which
    # may be infinite.
    start = 0
    end = 0
    nresults = 0
    for nextstart, nextnresults in sorted(locs.items()):
        nextend = endlocs[nextstart] if nextstart in endlocs else None
        assert(nextnresults > 0)
        #print "Got",startloc,endloc
        if end is None or nextstart <= end:
            # Previous range ends after start of this range (or the
            # previous range is infinite). Extend the previous range
            # to include this one.
            if nextend is None or (end is not None and nextend > end):
                end = nextend
            nresults += nextnresults
        else:
            # The ranges do not overlap. Return the previous range and
            # then save the current range.
            if nresults > 0:
                #assert(end is None or end > start)
                yield (start, end, nresults)
            start = nextstart
            end = nextend
            nresults = nextnresults
    if nresults > 0:
        #assert(end is None or end > start)
        yield (start, end, nresults)
    if debug:
        print '  Completed in', timer, 'seconds.'


# Parser objects
Append 'item' to the list at 'key'.  If no list exists for 'key', then
dataset/ETHPy150Open nandhp/python-imdb/imdb/parsers.py/_find_seeks_bookmarks--crossover with--dataset/ETHPy150Open nltk/nltk/nltk/sem/lfg.py/FStructure.safeappend