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
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
1"""v1 normalization, kept for the 1.x compatibility layer.
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"""
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('.')