def allRanges():
    start = docNo = 0
    while (start < len(fragments)):
        end = findEnd(start, docNo)
        sys.stderr.write(('\rSegmenting (%d/%d)' % (end, len(fragments))))
        (yield (start, end))
        start = end
        docNo += 1
def allRanges():
    start = docNo = 0
    while (start < len(fragments)):
        end = findEnd(start, docNo)
        sys.stderr.write(('\rSegmenting (%d/%d)' % (end, len(fragments))))
        (yield (start, end))
        start = end
        docNo += 1