Hey, guys.
Welcome to day 31 of 100 Days of Code.
And you've been learning quite a lot of things.
Now, we've been looking at handling exceptions using the JSON data format, parsing and reading Csvs,
using pandas, opening and writing to files, and a whole lot more.
So it's time for your capstone project.
And in this capstone project, we're going to be building a flashcard program to help you study.
And it's especially great with studying for languages.
Now, when I was in school, I studied French, and it was a lot of vocab that we had to learn for tests.
Pomme is apple and I would memorize all these words, all of the grammar tables.
And yet after 4 or 5 years, I couldn't really speak much French.
So I decided to go for immersive language learning.
I went to France, I hung out with friends and I tried to immerse myself in the language and culture,
but that also failed.
I had a lot of fun, but my French didn't seem to improve all that much.
But then I discovered a new way of learning languages, and it all started with looking at Chinese characters.
There's a lot of Chinese characters out there.
There's something like 50,000 Chinese characters in total from history to now.
There's a lot of characters that you could learn that each have a different meaning, and they each
have a different pronunciation.
Imagine that.
Trying to learn 50,000 characters, that's no easy feat.
But then a friend told me that actually, you don't really need 50,000 characters.
Your average professor who is very eloquent, who can write a lot of the characters and use them with
ease, only knows about 10,000, and your average person probably only uses about 8000 in their day
to day lives.
And if you basically just want to get by in life, you can pretty much rely on the 3000 words that an
average teenager would know.
And finally, if you actually just want to be able to watch some simple movies, read some simple books,
then you could use the average kid vocabulary of about 1000 characters.
And at this point, I think to myself, 1000.
That's quite doable.
I could do 1000 if I learned just ten characters a day.
That will take me less than a year to learn all of these characters.
But it's not just 1000 random characters either.
There's such a thing as a frequency dictionary.
So a dictionary that's not listed by A, B, C, D, but it's actually listed by the frequency that
a particular word occurs in common usage.
For example, if you take the first 1000 characters that are most commonly used, then you can pretty
much read most of the newspapers.
You can watch most of the TV shows because these are the words that are the bread and butter of the
language.
It's like in English the a, the of from y.
Yes, no.
These are words that we use every day again and again.
The crazy words like anti-establishment or glioblastoma.
These are not words that you need to really know for day to day life.
So let me show you the program that you will build where you can learn the most frequently used words
in any language.
It's a flashcard program, and it shows you the front and the back of the card.
So for example, French demand in English means request.
After three seconds, the card flips and I can check whether if I knew the right answer, if I got it
right, I'll press the tick.
And if I got it wrong, I'll press the cross.
So let's try another word.
Party means Left or to leave a train means to wait.
And I think I knew that word.
So I'm going to click the check mark.
And what that's going to do is it's going to take the flash card out of all of the list of flash cards.
So it doesn't show me the things I already know, and instead it only shows me the things I don't know
so I can review it and say, oh, I'm not sure what LA means.
So I'll say cross, and that will go back into the deck and it might come up again at some point.
So this beautiful piece of software is what we're going to be creating.
But more specifically you're going to be creating because after all, this is your capstone project.
But don't worry, I've divided up into four steps and I've got some step by step instructions for you
in the next lesson.
Now, if you're wondering, how did you get the most frequent words for the flashcard app in the first
place?
Well, let me show you There's a wiki for the frequency lists of different languages, and it lists
most of the common languages.
If we go to French, you can see that there are loads of different lists that people have compiled that
list the top most frequently occurring words.
And one of the ones that I thought was really relevant is the words that are based on subtitles.
These subtitles come from all sorts of shows and movies that are relevant to modern culture.
And when you look at one of the subtitles, this is one of my favorite shows, by the way.
You can see that the subtitles are listed by language, and if we pick out one, which is in English
and we take a look at it, then you can see it's basically just all the words that are spoken in the
movie or in the show, and it's been transcribed into subtitles.
Now then, if we take all of these words that are from the most commonly watched movies and shows.
We end up with these frequency lists.
So if we take a look here, it shows the most frequent words from 1 to 5000.
And at the very beginning it's your eye of is.
All of these things are really common.
And then as you scroll down, you get to some longer words.
And if you scroll to the bottom, you can see you're getting some more and more niche words.
These frequency lists are compiled by a user called hermit D, and hermit D is Hermit Dave, and he
has a GitHub repository where he's compiled all of the frequency words.
And you can see the latest version from 2018.
Now he's got all of the frequency words for many languages, and it's listed by the language code.
So French would be fr for example.
And here you can see the top 50,000 most frequent lists or the full entire list.
We're probably not going to learn more than 1000.
And I'm certainly not going to get to 50,000.
But this data here lists all the words that he found in these subtitles and the frequency that they
occurred.
And once they've been sorted in order of frequency, this is what you end up with.
So I've already studied some of the first 200 words.
So if I take 100 words from this frequency dictionary and I put it into a Google sheet, then I end
up with something like this.
Now what I want to be able to do is to create a flashcard where the front of the flashcard is the word
in French, and then on the back of the flashcard is the answer in English for what that word means.
Instead of having to flip through a dictionary, finding out the meaning of each of these words, there's
actually a really neat trick in Google Sheets that I want to show you.
if you hit equals to start a new formula and you type in Google Translate, you can see it expects some
inputs.
First is the piece of text that you want to translate.
So I'm going to click on this cell.
And then it's the source language.
So this is the language as a code.
So for example Spanish is es and French is fr.
And then the final input it expects is the language code that you want to translate it to.
So in this case I want to translate it to English.
So I'm going to use n and then we can close off the parentheses.
Hit enter.
And after a little while with good internet you'll see the English translation for this word.
And of course because we're in Excel, we can simply just drag this across all the way down to all of
our words.
And after a little while, bam!
It's translated all of those words into English.
So this is a really neat trick, and I'll link to the docs for this particular formula.
And also you can take a look at the language support that Google's translation service has.
And you can see the language code for each of these languages.
So if you want to try learning Macedonian or Malay, then this is going to be your best bet.
So now that I've created my Excel sheet essentially of French and English words, I've got potentially
100 flashcards with the front and back data already saved inside this Google sheet.
Now all I have to do is simply download it as a CSV, and we'll be able to work with it very easily.
Now you don't have to worry about downloading this or getting hold of this, because I've already included
the final CSV data in the starting project for you to be able to use.
So head over to the next lesson and get started building your very own study aid the flashy flashcard
app.