12 lines
354 B
Python
12 lines
354 B
Python
|
import seminar.models as m
|
||
|
from various.utils import bez_diakritiky_translate
|
||
|
import re
|
||
|
|
||
|
def normalizuj_jmeno(o: m.Osoba) -> str:
|
||
|
# FIXME: Možná není potřeba vázat na model?
|
||
|
cele_jmeno = f'{o.jmeno} {o.prijmeni}'
|
||
|
cele_jmeno = cele_jmeno.translate(bez_diakritiky_translate)
|
||
|
cele_jmeno = re.sub(r'[^a-zA-Z- ]', '', cele_jmeno)
|
||
|
return cele_jmeno
|
||
|
|