leaf_focus/report/processing/normalise.py
def correction_first(self, value: str, category: str):
        """Apply the first correction that makes a change."""
        if not value or not value.strip():
            return ""

        result = value
        for correction in self._corrections:
            if correction.category != category:
                continue
            if not correction.is_regex and correction.find not in result:
                continue
            result = correction.regex.sub(correction.replace, result)
            if result != value:
                return result

        return result
Apply the first correction that makes a change.
Apply the first correction that makes a change.
Apply the first correction that makes a change .
def correction_first(self, value: str, category: str):
        if not value or not value.strip():
            return ""
        result = value
        for correction in self._corrections:
            if correction.category != category:
                continue
            if not correction.is_regex and correction.find not in result:
                continue
            result = correction.regex.sub(correction.replace, result)
            if result != value:
                return result
        return result
def correction_first ( self , value : str , category : str ) : if not value or not value . strip ( ) : return "" result = value for correction in self . _corrections : if correction . category != category : continue if not correction . is_regex and correction . find not in result : continue result = correction . regex . sub ( correction . replace , result ) if result != value : return result return result
Apply the first correction that makes a change.
Apply the first correction that makes a change .
"""Apply the first correction that makes a change."""
self
value
str
category
str