[Eva] B5.2: init_sentences — единый пул, сквозная нумерация 1..400
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user