Coverage for src/wiktextract/extractor/en/inflection_kludges.py: 15%

11 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-15 05:18 +0000

1import re 

2 

3 

4def ka_decl_noun_template_cell(alts: list[str]) -> list[tuple[str, str, str]]: 

5 orig, roman = re.split(r" \(", alts[0], maxsplit=1) 

6 orig = orig.strip() 

7 roman = roman.strip().removesuffix(")") 

8 if "(" not in orig: 

9 nalts = [(orig, roman, "")] 

10 else: 

11 nalts = [] 

12 nalts.append( 

13 ( 

14 re.sub(r"\(.*?\)", "", orig), 

15 re.sub(r"\(.*?\)", "", roman), 

16 "", 

17 ) 

18 ) 

19 nalts.append( 

20 ( 

21 re.sub(r"\(|\)", "", orig), 

22 re.sub(r"\(|\)", "", roman), 

23 "", 

24 ) 

25 ) 

26 return nalts