Hey! Hi again! In the previous video I did a demonstration of the program so that
you know how the program looks like and what is the output that the program
generates, and also the interface of the program which is a command line
interface. So you input the data through the interfaces, the user inputs the
data through the command line interface and you get the output again from the
command line. Now I have created a folder here somewhere and I have given it a name.
You can give it any name that you want. And inside this folder I'll be putting
all the files of this project so we're talking about the data files like data
dot JSON, this is a file that contains the vocabulary where the program will
extract, so will ask for a word and this file has the definition of that
word. And also the dot py files will be put in here. So we know the output. Now we
need to figure out the way how to go to that output and we will take the
approach step by step which means that first we're going to develop a simple
version of the program, you know just like give the program a word and the
problem will return the definition of that word. But this will be very simple
because you know the users sometimes they may pass a word that doesn't exist and
as a programmer you need to count for that word, for that not existing word so
instead of breaking, interrupting the program, showing an error to
the user, you need to show a more user-friendly message to the user. And we
will do that in the next videos but for now the very first thing we need to
think about is the data, so I did some research on the web and I found this
data set of words and definitions. Now this is around five megabytes of data so
in Atom if it takes a while to open so I clicked it and I`m still waiting for it to
open. Now it opened, so if you if your Atom freezes, then you can open this with
more lightweight editor such as Notepad, or Nano on Mac, or Vim. So anyway this is
a dot JSON file. So what is JSON? JSON is like a language. some say it's not a
language, is just a set of rules how to format some data. So JSON follows this
format. It starts with a curly bracket and then all we have is pairs of keys
and values. So this is like a Python dictionary, so the key is separated by the
value by a colon. In this particular case our values are inside square
brackets which suggests that sometimes you know you may have more than one item
inside the brackets. For instance let me search for the word ctrl F or command F
rain so that will take us in here. First let me go to view and Toggle
Soft Wrap. So what that will do is it will fit the text inside my screen so
at the moment you see precipitation is outside of the screen bounds, so this
also takes a while because we have quite a lot of data here. Now the data
looks better so let me search for rain again. Find and so this is the key rain.
Let's say the word rain and this is the definition of rain. In this case we have
two definitions because you know for some words you may have more than one
meaning. Or you have more than one form for
instance. This is the noun, rain as a noun so it's a precipitation and this is
the verb for rain. So when it rains to fall from the clouds
in drops of water. So it's a verb and a noun and they are separated by a comma.
So this is just like a Python dictionary And now we need to figure out how to
load this data into Python because you know to access data from this file you
first need to load it into Python as a specific Python data type and then
you access data from that data type. So think for a moment what Python data type
would be more appropriate for this JSON file. So think about that and I'll show
just that in the next lecture. See you there!