Spaces:
Running
Running
Update modules/morphosyntax/morphosyntax_interface.py
Browse files
modules/morphosyntax/morphosyntax_interface.py
CHANGED
|
@@ -130,7 +130,8 @@ def display_morphosyntax_results(result, lang_code, t):
|
|
| 130 |
advanced_analysis = result['advanced_analysis']
|
| 131 |
|
| 132 |
# Mostrar leyenda (c贸digo existente)
|
| 133 |
-
st.markdown(f"##### {t['legend']}")
|
|
|
|
| 134 |
legend_html = "<div style='display: flex; flex-wrap: wrap;'>"
|
| 135 |
for pos, color in POS_COLORS.items():
|
| 136 |
if pos in POS_TRANSLATIONS[lang_code]:
|
|
@@ -140,12 +141,12 @@ def display_morphosyntax_results(result, lang_code, t):
|
|
| 140 |
|
| 141 |
# Mostrar an谩lisis de palabras repetidas (c贸digo existente)
|
| 142 |
word_colors = get_repeated_words_colors(doc)
|
| 143 |
-
with st.expander(
|
| 144 |
highlighted_text = highlight_repeated_words(doc, word_colors)
|
| 145 |
st.markdown(highlighted_text, unsafe_allow_html=True)
|
| 146 |
|
| 147 |
# Mostrar estructura de oraciones
|
| 148 |
-
with st.expander(
|
| 149 |
for i, sent_analysis in enumerate(advanced_analysis['sentence_structure']):
|
| 150 |
sentence_str = (
|
| 151 |
f"**{t['sentence']} {i+1}** "
|
|
|
|
| 130 |
advanced_analysis = result['advanced_analysis']
|
| 131 |
|
| 132 |
# Mostrar leyenda (c贸digo existente)
|
| 133 |
+
#st.markdown(f"##### {t['legend']}")
|
| 134 |
+
st.markdown(f"##### {morpho_t.get('legend', 'Legend: Grammatical categories')}")
|
| 135 |
legend_html = "<div style='display: flex; flex-wrap: wrap;'>"
|
| 136 |
for pos, color in POS_COLORS.items():
|
| 137 |
if pos in POS_TRANSLATIONS[lang_code]:
|
|
|
|
| 141 |
|
| 142 |
# Mostrar an谩lisis de palabras repetidas (c贸digo existente)
|
| 143 |
word_colors = get_repeated_words_colors(doc)
|
| 144 |
+
with st.expander(morpho_t.get('repeated_words', 'Repeated words'), expanded=True):
|
| 145 |
highlighted_text = highlight_repeated_words(doc, word_colors)
|
| 146 |
st.markdown(highlighted_text, unsafe_allow_html=True)
|
| 147 |
|
| 148 |
# Mostrar estructura de oraciones
|
| 149 |
+
with st.expander(morpho_t.get('sentence_structure', 'Sentence structure'), expanded=True):
|
| 150 |
for i, sent_analysis in enumerate(advanced_analysis['sentence_structure']):
|
| 151 |
sentence_str = (
|
| 152 |
f"**{t['sentence']} {i+1}** "
|