def tag(self, sent):
        """Tagger with output a la Stanford (no start/end markers).
        """
        entities = self.entities(sent)
        # dummy entity for nicer code:
        entities.append(((len(sent), len(sent)), 'X'))
        next_entity = entities.pop(0)
        result = []
        for i, t in enumerate(sent):
            if i >= next_entity[0][1]:
                # assert entities
                next_entity = entities.pop(0)

            if i < next_entity[0][0]:
                result.append((t, 'O'))
            elif i < next_entity[0][1]:
                result.append((t, next_entity[1]))

        return result
dataset/ETHPy150Open machinalis/iepy/iepy/preprocess/ner/literal.py/LiteralNER.tag/original