Source code for maha.processors.utils

from dataclasses import dataclass
from functools import wraps
from typing import Any, Callable


@dataclass
[docs]class ObjectGet: """Used with get function in :class:`~.BaseProcessor`""" # function to use
[docs] func: Callable
# initial value
[docs] prev: Any
# name of the operation (argument name)
[docs] name: str
# Function to apply at end # Defaults for post_fn, return the input
[docs] post_fn: Callable = lambda input: input