"""Base classes for text normalizers."""

from abc import ABC, abstractmethod


class Normalizer(ABC):
    """
    Abstract base class for Yakut text normalizers.

    All normalizers should inherit from this class and implement
    the normalize() method.
    """

    @abstractmethod
    def normalize(self, text: str) -> str:
        """
        Normalize Yakut text by converting denormalized characters
        to normalized Yakut characters.

        Args:
            text: Input text without Yakut characters (or partially normalized)

        Returns:
            Normalized text with Yakut characters

        Example:
            >>> normalizer = MyNormalizer()
            >>> normalizer.normalize("МАННАЙГЫ")
            "МАҤНАЙГЫ"
        """
        pass

    def __call__(self, text: str) -> str:
        """
        Allow normalizer to be called as a function.

        Args:
            text: Input text to normalize

        Returns:
            Normalized text
        """
        return self.normalize(text)
