Skip to content

Commit

Permalink
Handle Ukrainian words in database
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaublitz committed Nov 20, 2024
1 parent c6f9004 commit 0721ed3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions language_practice/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ def update_word(self, entry: Entry, scraped: list[list[list[str]]] | None):
values.append(f"'{val}'")
self.insert_into(table_uuid, ", ".join(columns), ", ".join(values))

word = word.replace("'", "''")

set_statements = [
f"word = '{word}'",
f"definition = '{definition}'",
Expand Down Expand Up @@ -413,6 +415,7 @@ def update_config(self, word: str, repetition: WordRepetition):
in_n_days = repetition.get_in_n_days()
date_of_next = str(repetition.get_date_of_next())
review = 1 if repetition.get_review() else 0
word = word.replace("'", "''")
self.update(
SqliteHandle.WORD_TABLE_NAME,
f"easiness_factor = {easiness_factor}, num_correct = {num_correct}, "
Expand Down

0 comments on commit 0721ed3

Please sign in to comment.