From 65af538c92fba2b82b2a949eb7a3be1bc3263576 Mon Sep 17 00:00:00 2001 From: Gulesh Date: Tue, 11 May 2021 17:59:13 -0400 Subject: [PATCH] working with column as some columns filter are giving uncaught error --- FastBridgeApp/DefinitionTools.py | 2 +- FastBridgeApp/routers/export.py | 6 ++++-- FastBridgeApp/static/assets/js/export.js | 2 +- FastBridgeApp/static/assets/js/select-restult.js | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FastBridgeApp/DefinitionTools.py b/FastBridgeApp/DefinitionTools.py index 20f01e4..b8f036b 100644 --- a/FastBridgeApp/DefinitionTools.py +++ b/FastBridgeApp/DefinitionTools.py @@ -35,7 +35,7 @@ def get_lang_data(words : list, dictionary: str, local_defs_bool : bool = False, word_list = deque() #has more effieceint appends, and is just as good to iterate over later #if local_defs: #we want this to be protected because it will take an extra round of iterating over all the words in the INTIAL selction. #local definitions are hard, because the same word could show up in the section multiple times, so we can't use a dictionary, because then we would have multiple copies of the same key. - Word = namedtuple("Word", columnheaders + row_filters + ["Appearance", "Total_Count_in_Text", "Source_Text"]) + Word = namedtuple("Word", columnheaders + row_filters + ["Appearance", "Total_Count_in_Text", "Count_in_Selection", "Source_Text"]) #added Count_in_Selection apperances = [word[5].replace('_', ".") for word in words] if local_defs_bool and local_lem: local_defs =[word[3] for word in words] diff --git a/FastBridgeApp/routers/export.py b/FastBridgeApp/routers/export.py index 74f22b3..894a5ea 100644 --- a/FastBridgeApp/routers/export.py +++ b/FastBridgeApp/routers/export.py @@ -123,7 +123,8 @@ async def simple_result(request : Request, starts : str, ends : str, sourcetexts data = [] if 'running' in display: for word in words: - word= word[0]._asdict() + word= word[0]._asdict() + print(word) #TODO add logic to drop from results without match to current filters row = dict(word) data.append(row) @@ -132,7 +133,8 @@ async def simple_result(request : Request, starts : str, ends : str, sourcetexts else: for word in words_no_dups: - word= word[0]._asdict() + word= word[0]._asdict() + print(word) row = dict(word) data.append(row) diff --git a/FastBridgeApp/static/assets/js/export.js b/FastBridgeApp/static/assets/js/export.js index 0e0f6a5..40c0a19 100644 --- a/FastBridgeApp/static/assets/js/export.js +++ b/FastBridgeApp/static/assets/js/export.js @@ -11,7 +11,7 @@ function current_selections() { "Number", "Preposition", "Pronoun", - "Verb", + "Verb", "CONJUNCTION_Verb_1", "CONJUNCTION_Verb_2", "CONJUNCTION_Verb_3", diff --git a/FastBridgeApp/static/assets/js/select-restult.js b/FastBridgeApp/static/assets/js/select-restult.js index 28b7a78..289d6ec 100644 --- a/FastBridgeApp/static/assets/js/select-restult.js +++ b/FastBridgeApp/static/assets/js/select-restult.js @@ -117,6 +117,7 @@ var first_visible_row = document.getElementById('main_table').rows[0] function get_first_visible_row() { var rows = document.getElementById('main_table').rows; var j = 0; + console.log(rows[j]) while (isHidden(rows[j])){ j++ first_visible_row = rows[j]