Now we'll just see one function call to English check, OK, and for example, if we just go to the
interactive shell here, we have already imported this English.
Now we say is chick.
English, that is.
English, check this in capital, in Brakhage, we give Biton and just do one string in this, you know,
let's give another Cicek.
English dot is English chick.
Python and 50.
Still, it is true.
OK, so now it is evaluated in the first one of this python coma, 20 commodity 500 in the city, despite
the outcome of 50 80.
Now, if you see, for example, to check English is English, check and you'll give Python comma 50,
comma 60.
Still, it is true or if you want to give see chick English, that is English chick in Brakhage the
string and you want to go a four letter or send a star is equal to 60.
So it is evaluated now I say Biton, then 20, the default one for one person in the CIA and 60 percent
is still in this case.
OK.
So now, for example, the one which we have seen here, we are calling the function when it is called
the second and third parameter specified program use, those parameters are not the default ones.
Now, let's move back to our calculating percentages.
Now, once we know the percentages are program will use, we will need to calculate the percentage,
what the message is disastrous.
For example, let us assume that we are having C..
We just put this in the comment.
OK, so we are having the string AC Biton, then one more vote, say OK, then we take some more again.
Some more.
OK, now again, some more.
Now this particular string is having five votes, but in that case only, let's say, will make one
more.
Who is out of this?
Only three votes are English.
Now to calculate the percentage of English words in the string, you will have to divide the number
of English words by total number of votes and multiply it by a hundred.
So the percentage of English words in this case would be something like, say, three, divided by five,
multiplied by a hundred, OK, which would be, for example, 60 percent in this case.
OK, now similarly, suppose you have the number of English votes, says three or six.
Let's take it now.
Six and the number of votes.
So again, if we say here six divided by, say, 10 multiplied by hundred would also come to sixty,
or in that case they'll be gone.
Almost thirty two English votes out of eighty seven multiplied by a hundred.
This could give you something like forty six point seventy eight.
For example, or zero English words, and then total votes multiplied by 100 will give you the value
zero.
OK, so this way we may have all different percentages calculated in this case.
Now, the percentage will always be between zero percent, meaning no votes are English and 100 percent
meaning all the votes are English.
OK, so other is English or English.
Check function will consider a string English if it is at least 20 percent of the vote existing in the
dictionary and the rest.
Eighty five percent of the correct those in the string of letters.
Now this means the message will still be detected as English, even if the dictionary file is imperfect,
or if some words in the message are something other than what we define as English words.
OK, so now if we come back to our program, let us just remove this line in our program over here where
we are calculating the percentage to recognize the English words in the messages by passing the message
is start to get English comp, which does the division, and returns the floor between zero point zero
and one point zero over here.
OK, so we are seeing more majesty that is equal to get English or get English word count positive as
a gesture multiplied by hundreds, if that's more than equal to the word percent this year.
Now to get a percentage from this float multiplied by hundred if the resulting number is greater than
or equal to four percent parameter through iStore in the word match, OK, otherwise false will be stopped.
OK.
Now similarly, if we go on to the next line where we are saying no to is equal to the length of removing
one letter last year and passing the messages still to it.
OK, we have written this function to find all the letters and space characters in a string, so we
just need to reuse it.
OK, similarly, if we see call to remove letters and the only one to get a string of just the letters
and the space characters in the message is still not passing the string to the length function of the
return total number of letters in space in the message.
OK, the next line over here that we have is sending a message.
Letter percentage is still is equal to convert to flow number letters divided by the length of messages
in two hundred.
Now over here we are getting the percentage of the letters by getting a flawed version of the integer
in numbers and dividing it by the length of the message.
The return value of this will be a total number of characters in our message is still OK.
So as discussed previously, the call to float is made to make sure that this particular line performs
a regular revision instead of integer division.
Just in the case of the program to import your checking list, model is running on Python.
OK, next, we check whether the percentage in our message a little percentage is greater than or equal
to the letter percent this year.
And this expression evaluates to a boolean value that is stored in the letters match SGA.
Now we want is English check to return.
True, only if both the word match is still that is in the first line and our letter match is in the
second last line contains true.
OK, so we have combined these values into expression using an angle.
So we are saying little more magisterial and later majesty.
So if both the four match and the letter match variables are true, that is the is English check will
declare the message is English and return the value to otherwise reject it as a non English and return
the value.
Folson.
That's OK.
So in this way, we have created this particular file that is genuinely stoppie by file.
Now in the next session, we will see how to use this in another file for checking the transposition
transposition cipher in that.