From d7a67c7e4a274846dff3c836ab3f86148ccb7a92 Mon Sep 17 00:00:00 2001 From: AthulyaMS Date: Mon, 8 Jan 2024 19:18:15 +0530 Subject: [PATCH] added crud/nlp_crud.py --- app/crud/nlp_crud.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/crud/nlp_crud.py b/app/crud/nlp_crud.py index cb49c319..6bbd5a4e 100644 --- a/app/crud/nlp_crud.py +++ b/app/crud/nlp_crud.py @@ -84,7 +84,7 @@ def get_project_tokens(db_:Session, project_id, books, sentence_id_range, senten raise NotAvailableException(f"Project with id, {project_id}, not found") sentences = projects_crud.obtain_project_source(db_, project_id, books, sentence_id_range, sentence_id_list) - sentences = sentences['db_content'] + # sentences = sentences['db_content'] args = {"db_":db_, "src_language":project_row.sourceLanguage, "sentence_list":sentences, 'trg_language':project_row.targetLanguage, "use_translation_memory":use_translation_memory, "include_phrases":include_phrases, @@ -93,12 +93,12 @@ def get_project_tokens(db_:Session, project_id, books, sentence_id_range, senten args['stopwords'] = project_row.metaData['stopwords'] if "punctuations" in project_row.metaData: args['punctuations'] = project_row.metaData['punctuations'] - # return get_generic_tokens( **args) - response = { - 'db_content':get_generic_tokens( **args), - 'project_content':project_row - } - return response + return get_generic_tokens( **args) + # response = { + # 'db_content':get_generic_tokens( **args), + # 'project_content':project_row + # } + # return response ###################### Token replacement translation ###################### def replace_bulk_tokens_gloss_list(token_translations, updated_sentences):