From 612c33ba93820d3b4b08d57a9a7a7d1ad979adc8 Mon Sep 17 00:00:00 2001 From: wilson Date: Sat, 18 Apr 2026 17:27:32 +0100 Subject: [PATCH] feat: [script] Fix how non-verb words are imported, as they were missing a wordform entry for the "default" lemma (i.e. masculine, singular form) --- api/scripts/import_dictionary.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/scripts/import_dictionary.py b/api/scripts/import_dictionary.py index f9a0e06..579da21 100644 --- a/api/scripts/import_dictionary.py +++ b/api/scripts/import_dictionary.py @@ -278,6 +278,20 @@ def _parse_entry(record: dict, lang_code: str) -> dict | None: } ) + # Verbs have a dedicated kaikki entry for each conjugated form (including + # the infinitive itself), so the headword is already covered. For all other + # POS (nouns, adjectives, …) no such entry exists, so we add the headword + # form explicitly here. + if pos_raw != "verb": + wordforms.append( + { + "id": _wordform_uuid(lemma_id, word, []), + "lemma_id": lemma_id, + "form": word, + "tags": [], + } + ) + return { "lemma": { "id": lemma_id,