spanifyd / app.py
Spanifyd's picture
Update app.py
30eb62a verified
Raw History Blame Contribute Delete
763 Bytes
import gradio as gr
# Basic English-to-Spanish dictionary
def translate(word):
dictionary = {
"dog": "perro",
"cat": "gato",
"house": "casa",
"hello": "hola",
"goodbye": "adiós",
"thank you": "gracias",
"please": "por favor",
"water": "agua",
"food": "comida",
"school": "escuela"
}
return dictionary.get(word.lower().strip(), "🔍 Try a different word!")
# Gradio interface
gr.Interface(
fn=translate,
inputs=gr.Textbox(label="Type an English word"),
outputs=gr.Textbox(label="Spanish Translation"),
title="📚 Spanifyd Flashcard Translator",
description="Type a word in English to learn the Spanish word. More features coming soon!"
).launch()