Update Version of Code in Asep Project
Update Version of Code in Asep Project
iin red are library that should be download so please check and try to run the update
code is in last and red sentence is tip so please note that also that it should be added or
not ---------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
import tkinter as tk
import pyttsx3
import folium
import os
import argostranslate.package
import argostranslate.translate
import webbrowser
argostranslate.package.update_package_index()
installed_languages = argostranslate.package.get_installed_packages()
# Initialize TTS
engine = pyttsx3.init()
def text_to_speech(text):
engine.say(text)
engine.runAndWait()
return R * c
c = canvas.Canvas(filename, pagesize=letter)
c.save()
def open_map():
m = folium.Map(location=map_center, zoom_start=5)
map_file = "map.html"
m.save(map_file)
webbrowser.open(map_file)
def ask_query():
user_input = user_entry.get()
response = "Processing..."
if "translate" in user_input:
open_map()
text_to_speech(response)
user_entry.delete(0, tk.END)
# GUI Setup
root = tk.Tk()
root.geometry("600x500")
frame.pack(fill=tk.BOTH, expand=True)
chat_area.pack(pady=5)
chat_area.tag_config("user", foreground="blue")
chat_area.tag_config("bot", foreground="green")
pdf_button.pack(side=tk.BOTTOM, pady=5)
root.mainloop()
--------------------------------------------------------------------------------------------------------------
-----------------------------------RUN THIS CODE------------------------------------------------------
Here’s a breakdown of the Smart Travel Assistance Application (STAA) code, including
all the major sections and their functionalities:
1. Offline Translation
2. Text-to-Speech (TTS)
• Feature: Converts text into speech for accessibility and ease of communication.
• Feature: Allows users to view city data from PDFs and add new city information.
• Implementation: Reads PDFs using PyMuPDF (fitz) and allows appending data
dynamically.
• Libraries: PyMuPDF for PDF reading and writing.
4. Improved UI