Coverage for src/wiktextract/extractor/en/inflection_kludges.py: 88%
12 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-03 06:55 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-03 06:55 +0000
1import re
4def ka_decl_noun_template_cell(alts: list[str]) -> list[tuple[str, str, str]]:
5 nalts = []
6 for alt in alts:
7 orig, roman = re.split(r" \(", alt, maxsplit=1)
8 orig = orig.strip()
9 roman = roman.strip().removesuffix(")")
10 if "(" not in orig: 10 ↛ 11line 10 didn't jump to line 11 because the condition on line 10 was never true
11 nalts.append((orig, roman, ""))
12 else:
13 nalts.append(
14 (
15 re.sub(r"\(.*?\)", "", orig),
16 re.sub(r"\(.*?\)", "", roman),
17 "",
18 )
19 )
20 nalts.append(
21 (
22 re.sub(r"\(|\)", "", orig),
23 re.sub(r"\(|\)", "", roman),
24 "",
25 )
26 )
27 return nalts