Update app.py
Browse files
app.py
CHANGED
@@ -36,22 +36,23 @@ lemmas = load_data()
|
|
36 |
|
37 |
def create_noun_table(lemma, forms):
|
38 |
table_data = {
|
39 |
-
'
|
40 |
-
'
|
41 |
-
'
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'ncmpd': '', 'ncmpd==duu': '', 'ncmpg': '', 'ncmpg==dou': ''
|
47 |
}
|
48 |
-
|
49 |
for form in forms:
|
50 |
ppos = form['PPOS'].lower() # Normalize to lowercase
|
51 |
word = form['word']
|
52 |
key = ppos.split('==')[0] # Extracting relevant part of PPOS with the full form for binding info
|
53 |
if key in table_data:
|
54 |
table_data[key] = word
|
|
|
|
|
55 |
|
56 |
print(f"Final table data for {lemma}: {table_data}") # Debugging output
|
57 |
|
@@ -94,6 +95,30 @@ def create_noun_table(lemma, forms):
|
|
94 |
<td>{table_data['npgs']}</td>
|
95 |
<td>{table_data['npgs==dou']}</td>
|
96 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
</tbody>
|
98 |
</table>
|
99 |
"""
|
@@ -120,4 +145,4 @@ iface = gr.Interface(
|
|
120 |
)
|
121 |
|
122 |
if __name__ == "__main__":
|
123 |
-
iface.launch(
|
|
|
36 |
|
37 |
def create_noun_table(lemma, forms):
|
38 |
table_data = {
|
39 |
+
'nsmns': '', 'nsmns==duu': '', 'nsmsn': '', 'nsmsn==duu': '',
|
40 |
+
'nsns': '', 'nsns==duu': '', 'nsas': '', 'nsas==duu': '',
|
41 |
+
'nsds': '', 'nsds==duu': '', 'nsgs': '', 'nsgs==dou': '',
|
42 |
+
'npns': '', 'npns==duu': '', 'npas': '', 'npas==duu': '',
|
43 |
+
'npds': '', 'npds==duu': '', 'npgs': '', 'npgs==dou': '',
|
44 |
+
'ncmpns': '', 'ncmpns==duu': '', 'ncmpas': '', 'ncmpas==duu': '',
|
45 |
+
'ncmpds': '', 'ncmpds==duu': '', 'ncmpgs': '', 'ncmpgs==dou': ''
|
|
|
46 |
}
|
47 |
+
|
48 |
for form in forms:
|
49 |
ppos = form['PPOS'].lower() # Normalize to lowercase
|
50 |
word = form['word']
|
51 |
key = ppos.split('==')[0] # Extracting relevant part of PPOS with the full form for binding info
|
52 |
if key in table_data:
|
53 |
table_data[key] = word
|
54 |
+
else:
|
55 |
+
print(f"Unmatched key: {key} for word: {word} with PPOS: {ppos}")
|
56 |
|
57 |
print(f"Final table data for {lemma}: {table_data}") # Debugging output
|
58 |
|
|
|
95 |
<td>{table_data['npgs']}</td>
|
96 |
<td>{table_data['npgs==dou']}</td>
|
97 |
</tr>
|
98 |
+
<tr>
|
99 |
+
<td>{table_data['nsmns']}</td>
|
100 |
+
<td>{table_data['nsmns==duu']}</td>
|
101 |
+
<td>{table_data['ncmpns']}</td>
|
102 |
+
<td>{table_data['ncmpns==duu']}</td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<td>{table_data['nsmsn']}</td>
|
106 |
+
<td>{table_data['nsmsn==duu']}</td>
|
107 |
+
<td>{table_data['ncmpas']}</td>
|
108 |
+
<td>{table_data['ncmpas==duu']}</td>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<td>{table_data['ncmsa']}</td>
|
112 |
+
<td>{table_data['ncmsa==duu']}</td>
|
113 |
+
<td>{table_data['ncmpd']}</td>
|
114 |
+
<td>{table_data['ncmpd==duu']}</td>
|
115 |
+
</tr>
|
116 |
+
<tr>
|
117 |
+
<td>{table_data['ncmsd']}</td>
|
118 |
+
<td>{table_data['ncmsd==duu']}</td>
|
119 |
+
<td>{table_data['ncmpg']}</td>
|
120 |
+
<td>{table_data['ncmpg==dou']}</td>
|
121 |
+
</tr>
|
122 |
</tbody>
|
123 |
</table>
|
124 |
"""
|
|
|
145 |
)
|
146 |
|
147 |
if __name__ == "__main__":
|
148 |
+
iface.launch()
|