aeat.domain.calculations.registry._text module

Text normalisation helpers for local legal and source corpora.

normalise_corpus_text(text)[source]

Normalise corpus text for citation-presence checks.

The HTML-tag stripper only matches well-formed tags whose < immediately precedes a tag-name character (letter, slash, or !/?) and whose body is short and contains no spaces — so that bare comparison operators (e.g. < 500 euros and < 3 años that AEAT’s manuals use as math notation) and other unbalanced angle brackets do not inadvertently swallow long spans of prose.

Return type:

str

Parameters:

text (str)