diff --git a/s2_a3.py b/s2_a3.py new file mode 100644 index 0000000..5d55972 --- /dev/null +++ b/s2_a3.py @@ -0,0 +1,63 @@ +import re +import json + + + +person_list = [] + +with open("Studienleistung2/Personen.txt") as input: + for lines in input: + current_line = lines.split(",") + + titel = re.findall(r"([A-Z][a-z]+\.)", current_line[0]) + + name = re.findall(r"([A-Z][a-z]+[^\.]*$)", current_line[0]) + name = re.split("\s", name[0]) + + # getting the fragments building the whole name + first_name = name[0] + + # if there are more than one second names + second_name = "" + counter = 1 + while counter