def __call__(self, text):
    'Find shortest prefix of text that differentiates it from previous item (empty string if no difference)'
    assert (text >= self.lastText), 'input must have been properly sorted'
    i = 0
    for (c1, c2) in izip((self.lastText + chr(0)), text):
        i += 1
        if (not (c1 == c2)):
            self.lastText = text
            return text[:i]
    assert (text == self.lastText), ((repr(text) + '!=') + repr(self.lastText))
    return ''
Find shortest prefix of text that differentiates it from previous item (empty string if no difference)
def __call__(self, text):
    
    assert (text >= self.lastText), 'input must have been properly sorted'
    i = 0
    for (c1, c2) in izip((self.lastText + chr(0)), text):
        i += 1
        if (not (c1 == c2)):
            self.lastText = text
            return text[:i]
    assert (text == self.lastText), ((repr(text) + '!=') + repr(self.lastText))
    return 