 Hey everyone welcome back to another Python programming tutorial so looking at the pie enchant module and this is the last video That I'm going to do on this Module here. It's been really simple a really kind of an easy thing to go through I hope you guys have been able to tolerate the like five videos on such a simple concept But the last thing that I want to show off to you is these two kind of small applications that pie enchant actually offers There are major tools that are kind of intended as functionality demos But they're also kind of useful and they take advantage of the way that Pie enchant actually uses everything that it finds as an error in its spell check Its loop and its iterator that iterator kind of allows you to do a lot when you are Actually spell checking like a larger piece of text. So this WX spell checker dialogue uses a Python's WX GUI graphic user interface kind of environment I'm not going to write this code out, but I did kind of copy and paste it so I can show you guys What it does and how it looks so this is it really I'm just going to run this I installed WX so you guys can see it and see how it works So I'll make this a little bit bigger So it takes a segment of the text that you that we give it and note that This text is what we're passing to the spell checker and You know that spell checker object and the dialogue is just a WX kind of GUI it sits on top of it So it'll find all the unrecognized words and then highlight them and then you can replace them with Things here or you can ignore the words ignore every single occurrence of that word You can replace just this occurrence or replace all occurrences of the word with anything that you specify Or you could add it to your dictionary or you could just give up So I want to replace this with some because I know that's what it should be This is some text with a FW which would be few and I know there's another FW later on here So few and then I'll replace all spelling we'll place it with spelling and Test is right here that we can replace and then it wait on here Or of course we'll get added to our dictionary or do anything else we want to do with it And then we're done. So that's kind of a nifty thing Just a GUI interface and there's a command line thing that does a very very similar Setup command line checker wait on here the module enchant checker command line checker provides the class command line checker Which can be used to interactively check the spelling of some text They use a standard input and standard output to interact with the user through obviously kind of like a command line interface And here's the code to build it. So I will write this one with you. I think we can do it in idle So it's not a problem. I'll actually create a new idle window so It's a little bit cleaner for us But I want to be able to see the code. So I'll try and be quick here So the reason that I found the import. I'm sorry the the checker Module trying to do two things at once here a little bit harder to do The reason that I found this module is because I wanted to in case I ever Was going through some encryption or decryption kind of Cryptography stuff if case there's ever a moment where I do loop through something like I'm trying to brute force something And I actually retrieve some English text that I know it okay Maybe in this iteration of the loop of the brute force attack Maybe I've actually found something worthwhile because I'm seeing actual English stuff, right? So and I see that with a lot of cryptography. So I wanted a module that allowed me to do that So actually test whether or not this is an English word and I was thinking okay I could probably write this on my own if I had like a dictionary Like file right? So I would need a dictionary file and then I'd have to loop through every single word in what I'm trying to test And then look through the dictionary every single time as well and test is this actually English is it in the dictionary for me and That was I don't know obviously that sounds like a terrible thing because you've looping your loops upon loops upon loops You know, but for some reason I don't know this Being a lower level framework, and I guess something that someone else actually built it makes sense They do a good job of it, and it's I don't know it works very well for us so there's all the code to actually build the command line one and It's running right now. It found the spell error and the spelling error misspelling SME for some so if You need help you enter help here, and it'll tells you these are the commands and things that you can use Zero or the number index will give you will replace it with that index in the how about suggestions Or right in front of it will always replace so all the other recurrences of this SME will be replaced with that I have to ignore this word capital I'd always ignore this word a to add at the dictionary E to edit the word Q to quit checking and that sort of thing So I wonder what E does new word it can be some and The text would also be text. So we'd say zero replacing text with text. Okay now now that I've got the checker Can I see did actually modify this can I actually see Get text of course. That's a function that I need to call and Yeah, it does change the text within the checker So that's pretty cool kind of how it works And it's just a simple command line small I think utility that takes advantage of the loop and iterator paradigm that Enchant offers allows you to play with it as a simple input and output command line thing So there we go. That's that's all I really wanted to show off with this series really the best stuff that This thing offers that Enchant the module offers is the spell checker object being able to look through a boatload of text Which is what probably we'll be doing or just checking for individual words and finding different suggestions So there's a lot of options with this module I hope you guys had a good time with it and now know how to use it and know it well We'll be able to think of this as a proper tool in your toolkit and a good ammunition in your arsenal So thanks everybody. I will see you in the next tutorial