Professional Documents
Culture Documents
Project 6 Speak Meaning of The Word
Project 6 Speak Meaning of The Word
Project 6 Speak Meaning of The Word
•ABSTRACT
• INTRODUCTION
• PROJECT PREREQUISITES
• STEPS TO IMPLIMENTATION
• FINAL CODE
• SAMPLE OUTPUT
• CONCLUSION
• REFERENCE
ABSTRACT
Python Project – Speak the Meaning of Word.All of us would have searched for a
meaning of a word at some point. Languages have multiple complex words whose
meanings are hard for many of us to remember. This is where a dictionary comes
into play.
dictionary we use by searching on the internet. I think you understood what we are
going to build in this project. Yes, a dictionary that speaks out the meaning of the
user. Then finds the meaning of the input and speaks out the output while
We will implement this project in Python using the modules Tkinter, pyttsx3, and
PyDictionary. We use the Tkinter to build the GUI to take input and display
1. PyDictionary: It is a Module for Python 2-3 that plays the role of Dictionary. It
for implementing these functionalities and has dependencies on other modules like
2. pyttsx3: It is a text to speech Python library. Here we use this to give the voice
It is expected that the developer has an idea of Python and basic knowledge of
Tkinter. The above mentioned modules can be installed using the below
commands:
pip install tk
3. After this, we write a function to find the meaning, give the audio input by
#Importing modules
from tkinter import *
import pyttsx3
from PyDictionary import PyDictionary
Here we create the function to speak the data given as input. We first
Create the constructor of pyttsx3
Then get call the getter and then the setter
And finally, give the audio output using the say() function.
def speak(audio):
# Having the initial constructor of pyttsx3 with
sapi5 in it as a parameter
engine = pyttsx3.init('sapi5')
In this function, we
First, create the PyDictionary() instance and then take the word input from
the text entry
After this, we find the meaning using the object ‘dic’ created
And finally, display it in different lines on the screen while giving the
auditory.
def meaning():
dic = PyDictionary()
# Taking the string input
query = str(text.get())
word = dic.meaning(query)
res=''
for state in word:
res+=(str(word[state][0]))+'\n'
spokenText.set(res)
speak("the meaning is" + str(word[state]))
Phonetics
Definitions
Synonyms
Antonyms, etc.
First, create the window and set the properties title, and size.
Then we create two string variables one for the input and the other for the
output
After we add the components to take input and also give the audio output
asking to enter the word.
Finally, we have a button for user to press to find the meaning that runs the
meaning() function.
Entry(wn,textvariable=text,
width=35,font=('calibre',13,'normal')).place(x=20,y=110
)
def speak(audio):
# Having the initial constructor of pyttsx3
# and having the sapi5 in it as a parameter
engine = pyttsx3.init('sapi5')
#Creating the variables to get the word and set the correct word
text=StringVar(wn)
spokenText =StringVar(wn)
Finally, we are done building the project that resembles a dictionary and also gives you audio
outputs. You can also try and extend it to make it listen to your audio inputs.