Skip to content

Commit

Permalink
Synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
vmonakhov committed Jun 5, 2023
1 parent 9c82151 commit 654db29
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
18 changes: 10 additions & 8 deletions lingvodoc/schema/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@

# Setting up logging.
log = logging.getLogger(__name__)
logging.disable(level=logging.INFO)


# Trying to set up celery logging.
celery_log = get_task_logger(__name__)
Expand Down Expand Up @@ -13056,7 +13054,11 @@ def export_dataframe(result_pool, distance_data_array, bundles):
group_num = entry['group']
entry_text = f"{entry['swadesh']} [ {entry['transcription']} ] {entry['translation']}"
if group_num and group_num in bundles:
groups.loc[group_num, dict_name] = entry_text
value = ""
if dict_name in groups:
cell = groups[dict_name].get(group_num)
value = cell if pd.notnull(cell) else value
groups.loc[group_num, dict_name] = f"{value}\n{entry_text}".strip()
else:
singles.loc[row_index, dict_name] = entry_text
row_index += 1
Expand Down Expand Up @@ -13295,8 +13297,7 @@ def split_lex(lex):
for group_index, group in enumerate(group_list):
# Select etimologically linked entries
linked = entries & group
if linked:
entry_id = linked.pop()
for entry_id in linked:
result_pool[perspective_id][entry_id]['group'] = group_index
swadesh = result_pool[perspective_id][entry_id]['swadesh']
# Store the correspondence: perspective { means(1/2/3) { etimological_groups(1.1/1.2/2.1/3.1)
Expand Down Expand Up @@ -13349,9 +13350,10 @@ def split_lex(lex):
del result_pool

xlsx_url = SwadeshAnalysis.export_xlsx(result, base_language_name, storage)
result_tables = (build_table(result['Distances'], 'orange_light', width="300px", index=True),
build_table(result['Cognates'], 'blue_light', width="300px"),
build_table(result['Singles'], 'green_light', width="300px"))
result_tables = (
build_table(result['Distances'], 'orange_light', width="300px", index=True),
build_table(result['Cognates'], 'blue_light', width="300px").replace("\\n","<br>"),
build_table(result['Singles'], 'green_light', width="300px"))

# Control output size
huge_size = 1048576
Expand Down
2 changes: 2 additions & 0 deletions server-requirements-1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ numpy==1.22.0
odfpy==1.4.0
openpyxl==2.6.4
packaging==20.3
pandas==1.4.3
passlib==1.6.5
PasteDeploy==2.0.1
pathvalidate==0.8.3
pretty_html_table==0.9.16
promise==2.1
psycopg2==2.8.6
pycparser==2.16
Expand Down
3 changes: 0 additions & 3 deletions server-requirements-final.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
matplotlib==1.5.3
pandas==1.4.3
pretty_html_table
xlsxwriter

0 comments on commit 654db29

Please sign in to comment.