Last Updated : 23 Jul, 2025
The following article shows how by the use of two modules named, pyttsx3 and PyDictionary, we can make our system say out the meaning of the word given as input. It is module which speak the meaning when we want to have the meaning of the particular word.
Modules neededBoth modules can be installed by using pip in the following way:
pip install PyDictionary pip install pyttsx3Working
As mentioned above, by the combination of two modules we will generate the functionality required and to do that the following steps were taken:
Below is the Implementation.
Python3
import pyttsx3
from PyDictionary import PyDictionary
class Speaking:
def speak(self, audio):
# Having the initial constructor of pyttsx3
# and having the sapi5 in it as a parameter
engine = pyttsx3.init('sapi5')
# Calling the getter and setter of pyttsx3
voices = engine.getProperty('voices')
# Method for the speaking of the assistant
engine.setProperty('voice', voices[0].id)
engine.say(audio)
engine.runAndWait()
class GFG:
def Dictionary(self):
speak = Speaking()
dic = PyDictionary()
speak.speak("Which word do u want to find the meaning sir")
# Taking the string input
query = str(input())
word = dic.meaning(query)
print(len(word))
for state in word:
print(word[state])
speak.speak("the meaning is" + str(word[state]))
if __name__ == '__main__':
GFG()
GFG.Dictionary(self=None)
Output:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4