Skip to main content

Posts

Showing posts from July, 2015

Small Nifty Dictionary in Python

We all have to look up words in a dictionary at some point or other. Whatever the reason it might be --  maybe because their jobs are text intensive, maybe because they a non-native speaker looking for the right pronunciation dictionaries are indispensible. There used to be some really good dictionary apps 6 years back. Now with google acting as the dictionary, a stand-alone dictionary app is kind of redundant. However these quick visits to google.com can slowly eat into our productive time. So I thought it will behelpful if a small little app sits in the corner of my screen not using any space which can act as a dictionary. So I wrote this app. The full app can fetch word meanings, IPA pronunciation guide and the actual pronunciation audio. The following code snippet implements the pronunciation part only.

I have written this to work exclusively in Linux -- the Python code calls a Bash script to grab the pronunciation files from the internet. The choice of bash script is to perform …