def update(self, new: 'Sentence', flags: Flags):
        """
        Erase items with the specified flags and insert the new items from
        the other sentence instead.
        """

        items = [i for i in self.items if i.flags != flags]
        items.extend(new.items)
        self.items = items
Erase items with the specified flags and insert the new items from
        the other sentence instead.