AniseF commited on
Commit
dca43a5
·
verified ·
1 Parent(s): 7e03a7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -10,6 +10,26 @@ import re
10
  import unicodedata
11
  from translit import latin_to_basic_grc
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  # --- 1. INSTALAÇÃO E CARREGAMENTO ---
15
  def install_odycy():
@@ -189,7 +209,8 @@ def analisar_texto(texto):
189
  f"{ltr:.2f}", f"{ttr:.2f}", lexico_html)
190
 
191
  # --- 4. INTERFACE ---
192
- with gr.Blocks(css=css_content, title="DDGP + OdyCy") as demo:
 
193
  with gr.Row():
194
  with gr.Column(scale=1, min_width=100):
195
  gr.HTML("""
@@ -197,6 +218,7 @@ with gr.Blocks(css=css_content, title="DDGP + OdyCy") as demo:
197
  <img src="https://raw.githubusercontent.com/aniseferreira/DDGP_Plus/main/ddgp/logo.png" style="height: 80px;">
198
  </div>
199
  """)
 
200
  with gr.Column(scale=4):
201
  gr.Markdown("# Estação Filológica DDGP & OdyCy")
202
  gr.Markdown("## DDGP Plus: Análise lexical e consulta ao Dicionário Digital Grego-Português.")
 
10
  import unicodedata
11
  from translit import latin_to_basic_grc
12
 
13
+ # Código para o cabeçalho (CSS)
14
+ alpheios_css = """
15
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/style/style-components.min.css"/>
16
+ """
17
+
18
+ # Código de ativação do Alpheios (JavaScript)
19
+ alpheios_js = """
20
+ function() {
21
+ import("https://cdn.jsdelivr.net/npm/alpheios-embedded@latest/dist/alpheios-embedded.min.js")
22
+ .then(embedLib => {
23
+ const alpheios = embedLib.AlpheiosEmbedded.ImportLib();
24
+ alpheios.activate({
25
+ clientId: 'ddgp-hf-space',
26
+ authStatus: 'notLoggedIn'
27
+ });
28
+ }).catch(e => {
29
+ console.error("Alpheios failed to load", e);
30
+ });
31
+ }
32
+ """
33
 
34
  # --- 1. INSTALAÇÃO E CARREGAMENTO ---
35
  def install_odycy():
 
209
  f"{ltr:.2f}", f"{ttr:.2f}", lexico_html)
210
 
211
  # --- 4. INTERFACE ---
212
+ # Modifique esta linha para incluir head e js:
213
+ with gr.Blocks(css=css_content, head=alpheios_head, js=alpheios_js, title="DDGP + OdyCy") as demo:
214
  with gr.Row():
215
  with gr.Column(scale=1, min_width=100):
216
  gr.HTML("""
 
218
  <img src="https://raw.githubusercontent.com/aniseferreira/DDGP_Plus/main/ddgp/logo.png" style="height: 80px;">
219
  </div>
220
  """)
221
+ # ... restante do seu código ...
222
  with gr.Column(scale=4):
223
  gr.Markdown("# Estação Filológica DDGP & OdyCy")
224
  gr.Markdown("## DDGP Plus: Análise lexical e consulta ao Dicionário Digital Grego-Português.")