fix(sonar): drop redundant regex alternatives (python:S5855)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-10-06 04:07:57 +02:00
parent 2cd14c9ddf
commit 2914f7ebe3
2 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ _SPECIES_RES = (
("d", re.compile(r"zwerg\w*|dwarf|dwarv\w*", re.IGNORECASE)),
("e", re.compile(r"\b(?:au|firn|wald|halb|hoch|nacht)?elf(?:e|en|in|isch\w*)?\b|\belben?\b|\belven\b|half-elf\b", re.IGNORECASE)),
("o", re.compile(r"\b(?:halb)?ork(?:s|en|in|isch\w*)?\b|\borcs?\b|\borcish\b", re.IGNORECASE)),
("v", re.compile(r"vampir\w*|vampire", re.IGNORECASE)),
("v", re.compile(r"vampir\w*", re.IGNORECASE)),
("h", re.compile(r"mensch\w*|human\w*", re.IGNORECASE)),
)
_NAME_HINT_RES = ( # compounds such as "Orkschamane"; "Elfriede" and "Orkan" must not match
@ -455,7 +455,7 @@ _HAIR_STYLE_WORDS = _compile((
(r"dicht\w*\s+haar|thick\s+hair", "thick"),
))
_BEARD_COLOUR_RE = re.compile(
r"\b(wei(?:ß|ss)|grau|silber|schwarz|rot|blond|braun|white|grey|gray|silver|black|red|brown|blond)\w*\s+(?:\w+\s+)?(?:bart|beard)",
r"\b(wei(?:ß|ss)|grau|silber|schwarz|rot|blond|braun|white|grey|gray|silver|black|red|brown)\w*\s+(?:\w+\s+)?(?:bart|beard)",
re.IGNORECASE)
_BEARD_COLOURS = {"weiß": "white", "weiss": "white", "white": "white", "grau": "grey", "grey": "grey", "gray": "grey",
"silber": "grey", "silver": "grey", "schwarz": "black", "black": "black", "rot": "red", "red": "red",

View File

@ -27,7 +27,7 @@ _SIGNED_END_RE = re.compile(r"\(\s*[A-Za-zÄÖÜäöü]{2,4}\s*\)\s*\S{0,4}\s*$"
_TYPE_HEADINGS = {
"contents": re.compile(r"^(inhalt|inhaltsverzeichnis|contents|table of contents)\b", re.I),
"imprint": re.compile(r"^(impressum|imprint)\b", re.I),
"editorial": re.compile(r"^(editorial|e[dg]i[bt]orial)\b", re.I), # OCR: "Ediborial"
"editorial": re.compile(r"^(e[dg]i[bt]orial)\b", re.I), # OCR: "Ediborial"
}
_LABELS = {
"de": {"advert": "Anzeige", "image_only": "Bildseite", "empty": "Leere Seite",