From 8c85c5dee6b921316b504e44dd6f0d7efda8e6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Ba=C3=B1ados=20Schwerter?= Date: Sat, 21 Dec 2024 00:45:53 +0000 Subject: [PATCH] Changed search entry --- src/morphodict/phrase_translate/types.py | 2 +- src/morphodict/search/runner.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/morphodict/phrase_translate/types.py b/src/morphodict/phrase_translate/types.py index f0f345eb4..fa039b432 100644 --- a/src/morphodict/phrase_translate/types.py +++ b/src/morphodict/phrase_translate/types.py @@ -29,7 +29,7 @@ class PhraseAnalyzedQuery: def __init__(self, query: str, add_verbose_message=None): self.query = query self.has_tags = False - self.filtered_query = None + self.filtered_query: str | None = None self.tags = None phrase_analyses: list[str] = source_phrase_analyses(query) diff --git a/src/morphodict/search/runner.py b/src/morphodict/search/runner.py index 7dbf86bf9..b92dcd947 100644 --- a/src/morphodict/search/runner.py +++ b/src/morphodict/search/runner.py @@ -167,6 +167,10 @@ def wordnet_search(query: Query) -> list[tuple[WordnetEntry, SearchResults]] | N espt_search.convert_search_query_to_espt() espt_search.inflect_search_results() find_pos_matches(espt_search, wn_results) + if wordnet_search.analyzed_query.filtered_query: + wn_entry.original_str = str( + wordnet_search.analyzed_query.filtered_query + ) results.append((wn_entry, wn_results)) return results