Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/nameparser/util.py: 80%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

5 statements  

1"""v1 normalization, kept for the 1.x compatibility layer. 

2 

3Removed in 3.0 with the rest of that layer. The 2.0 core does NOT use 

4this: :func:`nameparser._lexicon._normalize` is its fold, which 

5NFC-composes and strips edge full stops to a fixed point where 

6``lc()`` strips ASCII periods once. 

7""" 

8 

9 

10def lc(value: str) -> str: 

11 """Lowercase and strip leading/trailing periods to normalize for comparison.""" 

12 if not value: 

13 return '' 

14 return value.lower().strip('.')