translate hidden_data and impl. translation print
This commit is contained in:
parent
63af3f72f8
commit
bb523e2c47
59
generate.py
59
generate.py
|
@ -49,21 +49,36 @@ in the menu 'List' (bottom right).
|
|||
# Groß-Klein-Schreibung
|
||||
date = "05.06.2024"
|
||||
hidden_data = [
|
||||
"Anna Bartel: Zweitversuch nicht bestanden.",
|
||||
"Boris Parsch: Zweitversuch nicht bestanden.",
|
||||
"Carola Winter: 2. Versuch nicht bestanden.",
|
||||
"Dennis Meier: 2. Versuch nicht bestanden.",
|
||||
"Elisa Menniz: Zweitversuch nicht bestanden.",
|
||||
f"Anna Bartel: Prüfung am {date} um 13:00.",
|
||||
f"Boris Parsch: Prüfung am {date} um 14:00.",
|
||||
f"Carola Winter: Prüfung am {date} um 13:30.",
|
||||
f"Dennis Meier: Prüfung am {date} um 10:00.",
|
||||
f"Elisa Menniz: Prüfung am {date} um 14:30.",
|
||||
f"Anna Bartel: blaue Augen.",
|
||||
f"Boris Parsch: blaue Augen.",
|
||||
f"Carola Winter: blaue Augen.",
|
||||
f"Dennis Meier: grüne Augen.",
|
||||
f"Elisa Menniz: grüne Augen.",
|
||||
"Anna Bartel: Zweitversuch nicht bestanden.\n"
|
||||
"Anna Bartel: second attempt not passed.",
|
||||
"Boris Parsch: Zweitversuch nicht bestanden.\n"
|
||||
"Boris Parsch: second attempt not passed.",
|
||||
"Carola Winter: 2. Versuch nicht bestanden.\n"
|
||||
"Carola Winter: 2nd attempt not passed.",
|
||||
"Dennis Meier: 2. Versuch nicht bestanden.\n"
|
||||
"Dennis Meier: 2nd attempt not passed.",
|
||||
"Elisa Menniz: Zweitversuch nicht bestanden.\n"
|
||||
"Elisa Menniz: second attempt not passed.",
|
||||
f"Anna Bartel: Prüfung am {date} um 13:00.\n"
|
||||
f"Anna Bartel: exam on {date}, 13:00.",
|
||||
f"Boris Parsch: Prüfung am {date} um 14:00.\n"
|
||||
f"Boris Parsch: exam on {date}, 14:00.",
|
||||
f"Carola Winter: Prüfung am {date} um 13:30.\n"
|
||||
f"Carola Winter: exam on {date}, 13:30.",
|
||||
f"Dennis Meier: Prüfung am {date} um 10:00.\n"
|
||||
f"Dennis Meier: exam on {date}, 10:00.",
|
||||
f"Elisa Menniz: Prüfung am {date} um 14:30.\n"
|
||||
f"Elisa Menniz: exam on {date}, 14:30.",
|
||||
f"Anna Bartel: blaue Augen.\n"
|
||||
f"Anna Bartel: blue eyes.",
|
||||
f"Boris Parsch: blaue Augen.\n"
|
||||
f"Boris Parsch: blue eyes.",
|
||||
f"Carola Winter: blaue Augen.\n"
|
||||
f"Carola Winter: blue eyes.",
|
||||
f"Dennis Meier: grüne Augen.\n"
|
||||
f"Dennis Meier: green eyes.",
|
||||
f"Elisa Menniz: grüne Augen.\n"
|
||||
f"Elisa Menniz: green eyes.",
|
||||
]
|
||||
|
||||
network = Network(
|
||||
|
@ -147,8 +162,18 @@ def generate_text(number_of_lines = 200):
|
|||
result = ""
|
||||
for i in range(number_of_lines):
|
||||
emissions, _ = network.choose()
|
||||
line = ''.join(emissions)
|
||||
result += line + "\n"
|
||||
german = ""
|
||||
english = ""
|
||||
for emission in emissions:
|
||||
match emission:
|
||||
case (ger, eng):
|
||||
german += ger
|
||||
english += eng
|
||||
case both:
|
||||
german += both
|
||||
english += both
|
||||
result += german + "\n"
|
||||
result += english + "\n"
|
||||
if random() < len(hidden_data) / (number_of_lines - i):
|
||||
result += pop_hidden_data() + "\n"
|
||||
return result
|
||||
|
|
Loading…
Reference in a new issue