[Eva] B5.2: init_sentences — единый пул, сквозная нумерация 1..400

This commit is contained in:
2026-10-16 11:58:53 +00:00
parent 1df1119d11
commit 5810eccde1
+4 -2
View File
@@ -65,6 +65,7 @@ async def init_sentences():
("B1", "sentences_b1.csv"),
]
offset = 0
for level, filename in level_files:
sentences = load_sentences_from_csv(filename)
for i, s in enumerate(sentences):
@@ -74,11 +75,12 @@ async def init_sentences():
await conn.execute(
"""INSERT INTO sentences (sentence_number, sentence_pl, translation_ru, translation_uk, translation_en, difficulty, level)
VALUES ($1, $2, $3, $4, $5, $6, $7)
ON CONFLICT (level, sentence_number) DO NOTHING""",
i + 1, s["sentence_pl"],
ON CONFLICT (sentence_number) DO NOTHING""",
offset + i + 1, s["sentence_pl"],
s["translation_ru"], s["translation_uk"], s["translation_en"],
difficulty, level
)
offset += len(sentences)
def normalize_word_for_display(word: str) -> str: