thak123 commited on
Commit
cbf082a
·
1 Parent(s): 8bc3093

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +160 -19
app.py CHANGED
@@ -2,24 +2,165 @@ import gradio as gr
2
 
3
  # # Define a list of word and translation pairs
4
  word_translations = [
5
- {
6
- "word": "željeti",
7
- "image_url": "https://example.com/image1.jpg",
8
- "translation": "want",
9
- "link": "https://sh.wiktionary.org/wiki/%C5%BEeljeti"
10
- },
11
- {
12
- "word": "World",
13
- "image_url": "https://example.com/image2.jpg",
14
- "translation": "Mundo",
15
- "link": "https://en.wikipedia.org/wiki/World"
16
- },
17
- {
18
- "word": "Goodbye",
19
- "image_url": "https://example.com/image3.jpg",
20
- "translation": "Adiós",
21
- "link": "https://en.wikipedia.org/wiki/Bat"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ]
24
 
25
  # Initialize an index to keep track of the current word
@@ -40,7 +181,7 @@ def display_word():
40
  iface = gr.Interface(
41
  fn=display_word,
42
  live=True,
43
- title="Word Translation App",
44
  description="Click 'Next' to view the next word and translation.",
45
  inputs=[],
46
  outputs=["html"],
 
2
 
3
  # # Define a list of word and translation pairs
4
  word_translations = [
5
+ {"word":"kupovati",
6
+ "image_url":"",
7
+ "translation":"buy",
8
+ "link":"https://sh.wiktionary.org/wiki/kupovati"
9
+ },
10
+
11
+
12
+ {"word":"misliti",
13
+ "image_url":"",
14
+ "translation":"to think",
15
+ "link":"https://sh.wiktionary.org/wiki/misliti"
16
+ },
17
+
18
+
19
+ {"word":"sjediti",
20
+ "image_url":"",
21
+ "translation":"sit",
22
+ "link":"https://sh.wiktionary.org/wiki/sjediti"
23
+ },
24
+
25
+
26
+ {"word":"jesti",
27
+ "image_url":"",
28
+ "translation":"to eat",
29
+ "link":"https://sh.wiktionary.org/wiki/jesti"
30
+ },
31
+
32
+
33
+ {"word":"biti",
34
+ "image_url":"",
35
+ "translation":"be",
36
+ "link":"https://sh.wiktionary.org/wiki/biti"
37
+ },
38
+
39
+
40
+ {"word":"voziti se",
41
+ "image_url":"",
42
+ "translation":"to drive",
43
+ "link":"https://sh.wiktionary.org/wiki/voziti"
44
+ },
45
+
46
+
47
+ {"word":"letjeti",
48
+ "image_url":"",
49
+ "translation":"fly",
50
+ "link":"https://sh.wiktionary.org/wiki/letjeti"
51
+ },
52
+
53
+
54
+ {"word":"živjeti",
55
+ "image_url":"",
56
+ "translation":"to live",
57
+ "link":"https://sh.wiktionary.org/wiki/"
58
+ },
59
+
60
+
61
+ {"word":"trčati",
62
+ "image_url":"",
63
+ "translation":"run",
64
+ "link":"https://sh.wiktionary.org/wiki/trčati"
65
+ },
66
+
67
+
68
+ {"word":"obožavati",
69
+ "image_url":"",
70
+ "translation":"worship",
71
+ "link":"https://sh.wiktionary.org/wiki/obožavati"
72
+ },
73
+
74
+
75
+ {"word":"uživati",
76
+ "image_url":"",
77
+ "translation":"to enjoy",
78
+ "link":"https://sh.wiktionary.org/wiki/uživati"
79
+ },
80
+
81
+
82
+ {"word":"buditi se",
83
+ "image_url":"",
84
+ "translation":"Wake up",
85
+ "link":"https://sh.wiktionary.org/wiki/buditi"
86
+ },
87
+
88
+
89
+ {"word":"skuhati",
90
+ "image_url":"",
91
+ "translation":"cook",
92
+ "link":"https://sh.wiktionary.org/wiki/skuhati"
93
+ },
94
+
95
+
96
+ {"word":"slušati",
97
+ "image_url":"",
98
+ "translation":"listen",
99
+ "link":"https://sh.wiktionary.org/wiki/slušati"
100
+ },
101
+
102
+
103
+ {"word":"opuštati",
104
+ "image_url":"",
105
+ "translation":"relax",
106
+ "link":"https://sh.wiktionary.org/wiki/opuštati"
107
+ },
108
+
109
+
110
+ {"word":"doručkovati",
111
+ "image_url":"",
112
+ "translation":"have breakfast",
113
+ "link":"https://sh.wiktionary.org/wiki/doručkovati"
114
+ },
115
+
116
+
117
+ {"word":"ne biti",
118
+ "image_url":"",
119
+ "translation":"not to be",
120
+ "link":"https://sh.wiktionary.org/wiki/biti"
121
+ },
122
+
123
+
124
+ {"word":"slaviti",
125
+ "image_url":"",
126
+ "translation":"celebrate",
127
+ "link":"https://sh.wiktionary.org/wiki/slaviti"
128
+ },
129
+
130
+
131
+ {"word":"željeti",
132
+ "image_url":"",
133
+ "translation":"want",
134
+ "link":"https://sh.wiktionary.org/wiki/željeti"
135
+ },
136
+
137
+
138
+ {
139
+ "word":"ne voljeti",
140
+ "image_url":"",
141
+ "translation":"dislike",
142
+ "link":"https://sh.wiktionary.org/wiki/voljeti"
143
+ },
144
+
145
+
146
+ # {
147
+ # "word": "željeti",
148
+ # "image_url": "https://example.com/image1.jpg",
149
+ # "translation": "want",
150
+ # "link": "https://sh.wiktionary.org/wiki/%C5%BEeljeti"
151
+ # },
152
+ # {
153
+ # "word": "World",
154
+ # "image_url": "https://example.com/image2.jpg",
155
+ # "translation": "Mundo",
156
+ # "link": "https://en.wikipedia.org/wiki/World"
157
+ # },
158
+ # {
159
+ # "word": "Goodbye",
160
+ # "image_url": "https://example.com/image3.jpg",
161
+ # "translation": "Adiós",
162
+ # "link": "https://en.wikipedia.org/wiki/Bat"
163
+ # }
164
  ]
165
 
166
  # Initialize an index to keep track of the current word
 
181
  iface = gr.Interface(
182
  fn=display_word,
183
  live=True,
184
+ title="Practise Words Croatian Verbs App",
185
  description="Click 'Next' to view the next word and translation.",
186
  inputs=[],
187
  outputs=["html"],