Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ def load_data():
|
|
24 |
}
|
25 |
lemmas[current_lemma].append(lemma_data)
|
26 |
|
|
|
27 |
return lemmas
|
28 |
|
29 |
lemmas = load_data()
|
@@ -40,9 +41,12 @@ def create_noun_table(lemma, forms):
|
|
40 |
ppos = form['PPOS']
|
41 |
word = form['word']
|
42 |
key = ppos[1:5] # Extracting relevant part of PPOS
|
|
|
43 |
if key in table_data:
|
44 |
table_data[key] = word
|
45 |
|
|
|
|
|
46 |
table = f"""
|
47 |
<table border="1">
|
48 |
<thead>
|
@@ -88,8 +92,10 @@ def create_noun_table(lemma, forms):
|
|
88 |
return table
|
89 |
|
90 |
def search_lemma(lemma):
|
|
|
91 |
results = lemmas.get(lemma, None)
|
92 |
if not results:
|
|
|
93 |
return f"No results found for {lemma}"
|
94 |
|
95 |
if 'N' in results[0]['PPOS']:
|
|
|
24 |
}
|
25 |
lemmas[current_lemma].append(lemma_data)
|
26 |
|
27 |
+
print("Loaded lemmas:", lemmas) # Debugging output
|
28 |
return lemmas
|
29 |
|
30 |
lemmas = load_data()
|
|
|
41 |
ppos = form['PPOS']
|
42 |
word = form['word']
|
43 |
key = ppos[1:5] # Extracting relevant part of PPOS
|
44 |
+
print(f"Processing: word={word}, ppos={ppos}, key={key}") # Debugging output
|
45 |
if key in table_data:
|
46 |
table_data[key] = word
|
47 |
|
48 |
+
print(f"Final table data for {lemma}: {table_data}") # Debugging output
|
49 |
+
|
50 |
table = f"""
|
51 |
<table border="1">
|
52 |
<thead>
|
|
|
92 |
return table
|
93 |
|
94 |
def search_lemma(lemma):
|
95 |
+
print(f"Searching for lemma: {lemma}") # Debugging output
|
96 |
results = lemmas.get(lemma, None)
|
97 |
if not results:
|
98 |
+
print(f"No results found for {lemma}") # Debugging output
|
99 |
return f"No results found for {lemma}"
|
100 |
|
101 |
if 'N' in results[0]['PPOS']:
|