Skip to content
Snippets Groups Projects
delete_replacer.py 500 B
Newer Older
Michał Pogoda's avatar
Michał Pogoda committed
from typing import List, Tuple
Michał Pogoda's avatar
Michał Pogoda committed
from src.string_replacements import replace
from src.replacers.interface import ReplacerInterface


class DeleteReplacer(ReplacerInterface):
    def __init__(self):
        pass

    def replace(
        self, text: str, detections: List[Tuple[int, int, Detection]]
    ) -> Tuple[str, List[Tuple[int, int, Detection]]]:
Michał Pogoda's avatar
Michał Pogoda committed
        result = [(start, end, "") for start, end, _ in detections]

        return replace(text, result), []