 Hey, everyone welcome back to a bit more Python programming tutorials We're looking at a new module today. This is called a pie enchant So pie enchant is a spell checking library for Python based on the excellent enchant library Typically per my tutorial style. I'm gonna be going through the documentation Showing you how it works kind of guiding you through it and walking you through it There is a tutorial and a lot of documentation found online in fact I'm online right now at pythonhosted.org forward slash pie enchant so if you want to follow along you can definitely do that But I'll be using the documentation and the tutorial of course as a reference and we'll kind of step by step Walk through that together. So let's dive right into it Pie enchant combines all the functionality of the underlying enchant library with the flexibility of Python and a nice Pythonic object-oriented interface it also aims to provide some high-level functionality that is available in the C API So to get started you can check out the comprehensive tutorial that frequently has questions or the auto-generated API listing Or if you just want to get up and running in a hurry. Here's a quick sample of pie enchant in action So it's super simple all you have to do is import the module You can create a dictionary with the specific dictionary tag And then you can test whether or not these are words that are inside that dictionary If you see something that's not you can kind of get suggestions for what it might be or what the user might have been trying to use So let's go ahead and jump over to that tutorial And I'll use this again like I said as kind of a walkthrough to go through our actual Series here. I hope you're okay with that Just kind of holding your hand and walking you through it with you I want you to learn that the documentation is really your best bet So if there isn't any video tutorials on some stuff and you want to learn it You guys know how to read and understand what you're looking at So all right We can go ahead and just dive right in if we want to install the package of pie enchant So I'm on Linux right now If you're on Windows you might need to go through a different set of steps But of course on Linux everything is significantly easier. I'll just install pie enchant through PIP So I'm gonna get my command line open up here and I will do sudo PIP I'm actually gonna use PIP 2 to specify that I want to install to my Python 2.7 version and install pie enchant And there we go It might it might need to ask you for your password But I've already entered mine and now I've got my Python shell open up. I can go ahead and import enchant sweet So if I enter enchant dot and then use control space to kind of see everything that we can do here Here are all of our options so the thing that we noticed early on in the Initial page here was that we can set up a dictionary and I'll go into the actual Discussion here the most important object of the pie and enchant module is the dictionary object which represents a dictionary Of course these objects are used to check the spelling of words and even get suggestions for misspelled words So here's how you set it up you're gonna create an object and you're gonna set that equal to a dictionary with a Dictionary tag so it'll get more in depth about what these tags are right here So actually let's go through it and read that right now dictionaries are created using a language tag Which specifies the language to be checked in this case en underscore us signifies American English That's what I'm gonna be using. I Speak English, so if anyone else uses any other dictionaries, I recommend you check them out There is a function to view what other dictionaries are available on your system So let's play with it a little bit though. I want that D object D equals enchant.dict and if you don't pass in a tag It will try and locate and find the dictionary that's on your system by default So it's gonna try and determine it all on its own the language currently in use This is not always possible in which case an error is raised is raised. Sorry So you can see this Kind of portrayal here if there isn't a tag specified and you couldn't determine the language you'll you'll receive an error So in my case I can use it without any arguments for your system You may not be able to you may have to specify en underscore us as a string in a specific tag And then once you've created that object you can use d dot tag and that will tell you what it is that you're using Even if you didn't specify What it is that you're using it'll set that up for you once it's determined what it is And of course I mentioned earlier there are several top-level functions in the enchant module That can be used to deal with dictionaries like to test if you have a dictionary that exists What ones can we get if we? Construct in return in a dictionary it looks like that's doing the exact same thing as our dict constructor. Sorry dict constructor I should learn how to talk and List languages is another one that will list languages for which dicks are available I'm gonna say dicks this whole tutorial series. Hope you guys are okay with that Dicks. Yep. I'm never gonna be able to get over it. All right. Here we go another one like I was saying is enchant dot list dicks Dicks there's no way to say it safely. It's not possible and this will return the list available dicks I'm gonna say dictionaries from now on. Okay, Ian is EA English that thing that thing that thing of that thing and of course you can do a little bit more googling if you want to know More of what all this stuff is variations on English. I I don't know I just use Ian the underscore us because it's it does it works just fine Okay, so We'll get into a little bit more of actually checking these things if they exist or not Dictionaries for one thing if dictionaries exist exist. Is that the function here? Yeah dict exists forgot the s and They're testing if a fake dictionary exists and obviously will return a boolean yes or no true or false in this case It is false because that's of course a fake dictionary would not exist Okay, I think that's enough that I want to show you guys about right now and the next tutorial actually get into a little bit more of looking at different words and stuff because I think this is already dragging on long enough creating the dictionary object really simple stuff Of course and installing it, but I want to try and make shorter videos for you because I'm really bad at Long stuff all the time. So we're good. Thanks for watching everybody. See you in the next tutorial