[Eva] Ева, привет! Новая задача: игра «Составь #52

Merged
Drobysh merged 4 commits from eva/chat-ec3e05-backend into main 2026-10-16 11:59:55 +00:00
Showing only changes of commit 5810eccde1 - Show all commits
+4 -2
View File
@@ -65,6 +65,7 @@ async def init_sentences():
("B1", "sentences_b1.csv"), ("B1", "sentences_b1.csv"),
] ]
offset = 0
for level, filename in level_files: for level, filename in level_files:
sentences = load_sentences_from_csv(filename) sentences = load_sentences_from_csv(filename)
for i, s in enumerate(sentences): for i, s in enumerate(sentences):
@@ -74,11 +75,12 @@ async def init_sentences():
await conn.execute( await conn.execute(
"""INSERT INTO sentences (sentence_number, sentence_pl, translation_ru, translation_uk, translation_en, difficulty, level) """INSERT INTO sentences (sentence_number, sentence_pl, translation_ru, translation_uk, translation_en, difficulty, level)
VALUES ($1, $2, $3, $4, $5, $6, $7) VALUES ($1, $2, $3, $4, $5, $6, $7)
ON CONFLICT (level, sentence_number) DO NOTHING""", ON CONFLICT (sentence_number) DO NOTHING""",
i + 1, s["sentence_pl"], offset + i + 1, s["sentence_pl"],
s["translation_ru"], s["translation_uk"], s["translation_en"], s["translation_ru"], s["translation_uk"], s["translation_en"],
difficulty, level difficulty, level
) )
offset += len(sentences)
def normalize_word_for_display(word: str) -> str: def normalize_word_for_display(word: str) -> str: