teil25 vom develop

This commit is contained in:
2024-03-12 15:54:48 +01:00
parent 0d63af7bbc
commit b655926202
7 changed files with 14 additions and 0 deletions

21
teil25/filter_vornamen.py Normal file
View File

@@ -0,0 +1,21 @@
from vornamen_reader import read_vornamen
import re
def print_vornamen_simple(vornamen):
for vorname in vornamen:
print(vorname)
def print_vornamen_filtered(vornamen,regex):
pattern = re.compile(regex)
for vorname in vornamen:
# print(f"{type(r)}: {r}")
# s = re.findall(regex,vorname)
# if s[0] != '':
is_match = pattern.match(vorname).span()[1] >0
if is_match:
print(f'{is_match}: {vorname}')
vornamen = read_vornamen('./Vornamen_Wuppertal_2020.csv')
#print_vornamen_simple(vornamen)
print_vornamen_filtered(vornamen,'O*')