From 8eeb5d3bccf831681b2cad5c3b322e6a08f596df Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Jan 2023 18:00:16 +0300 Subject: feat(corp/data-import): add import of OR 'words_forms' table This is the full morphological set table for all the words from the lemmata table, which they don't call it that. Change-Id: I6f5be673c5f59f11e36bd8c8c935844a7d4fd170 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7894 Tested-by: BuildkiteCI Reviewed-by: tazjin --- corp/russian/data-import/src/main.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'corp/russian/data-import/src/main.rs') diff --git a/corp/russian/data-import/src/main.rs b/corp/russian/data-import/src/main.rs index 11387539ab84..18bc0238e7e0 100644 --- a/corp/russian/data-import/src/main.rs +++ b/corp/russian/data-import/src/main.rs @@ -210,12 +210,23 @@ fn open_russian(conn: &Connection, args: &Args) { db_setup::initial_or_schema(conn); - let tx = conn - .unchecked_transaction() - .ensure("failed to start transaction"); + { + let tx = conn + .unchecked_transaction() + .ensure("failed to start transaction"); + + db_setup::insert_or_words(&tx, parser.words()); + tx.commit().ensure("OpenRussian words commit failed"); + } + + { + let tx = conn + .unchecked_transaction() + .ensure("failed to start transaction"); - db_setup::insert_or_words(&tx, parser.words()); - tx.commit().ensure("OpenRussian words commit failed"); + db_setup::insert_or_word_forms(&tx, parser.words_forms()); + tx.commit().ensure("OpenRussian word forms commit failed"); + } info!("finished OpenRussian import"); } -- cgit 1.4.1