 Hello, everyone, and welcome back to a little bit more Python programming, looking at the pie and chant module. And now we're going to move into personal word lists. So these are kind of interesting in that they supplement your dictionary objects. So here we go. Dictionary objects can also be used to check words against a custom list of correctly spelled words known as a personal word list. This is simply a file listing the words to be considered one word per line. So the following example creates a dictionary object for the personal word list stored in this file or file name, my words dot text. Okay, so I don't know if you guys if you guys have like an Android phone or anything. I have an Android phone, I have like the Samsung Galaxy. And whenever I'm sending a text message, and the phone recognizes a word that hasn't seen before, it gives me an option to like hit this check mark. And that will add that word or whatever I just typed in whatever stupid mess I just typed in. It'll put that in. I would think my own personal word list. Like now it knows that okay, this guy's going to use this word. Stupid John uses this stupid word. So all right, let's play with this in the code. I've got idle fired up here. I'm going to import and chant. So we can work with it. And I kind of am curious what it will do, because I haven't created this my words dot text file, I haven't done that yet. So I wonder if it will actually create that on its own. I'm sure it won't. I guess I'm not sure. I'm curious. So PWL is what they're doing a personal word list equals request, PWL and dict. And then words dot text. Okay, so I guess it returned something. Do I have a words dot text? I do. What's in words dot text? There's nothing in there. All right. So what else can we do with this? Now this personal word list dictionary has been kind of created and can be used the same way as dictionary objects, which reference a language dictionary. When the objects add method is called new entries will be appended to the bottom of the file. So so is it using just this file as the dictionary? Like am I testing PWL? Can I check if hello is a word? And it's not because there's nothing in words dot text. But if I actually entered that in hello, and now I know that that exists in there, I'm actually gonna I'm gonna reinvoke this object. So it knows that okay, I've refreshed it on my own without without using it in Python. Now if I check does hello exist, it does. Does it worry about case? I'm kind of curious. No, it does. Wow. Okay. So here's an interesting thing. When the objects add method is called new entries will be appended to the bottom of the file. So if I try and add something to our words dot text file within Python, not from within editing the file itself, if I did PWL dot add, would it work? Okay. But if I added subscribe, PWL dot check is subscribe in there it is. Now when I look at words dots text, hey, subscribe is right in there. Cool. That's pretty simple functionality. But I mean, we can actually work with that stuff. Let's actually create because it looks like there's an option that allows you to provide a dictionary with a PWL or a personal word list. So you can actually combine a language dictionary with the personal word file. Maybe maybe that's like what our Android phones do. That's maybe that's like what my Samsung Galaxy does when it tries to keep track of words that I add to its dictionary. It's probably not adding it to the full language dictionary like we were doing in the last tutorial. Hopefully it's keeping them stored in a personal word dictionary or like a specific text file that's separate from the real English language dictionary. So let's add our let's create a new word. Kerfunkel, Kerker, Kershner, Kershner funkel. Alright, I hope I hope I hope that's not a real word. I'm going to Google it. I'm going to Google Kershner funkel. Alright, I don't even know. But it looks like Kershner funkel. Alright, whatever. Let's get back to the freaking tutorial. So now what we can do is we can create a dict with PWL or a dictionary with the personal word list. Let's try and do this. D, they're using D2, but we haven't created a D yet. So let's let's make our D. Dict with PWL, capital D, capital W and PWL is in all capital letters. tag is necessary this time around. So we need to specify and us. That's what I'm going to use. And then PWL is what we will include with it. So we would include the file name here. So words dot text. So we've got so now we can D dot check. There's a Kershner funkel. And we've got it. Now, if I need to Kershner funkel all know, of course, that's not a real word, but it's it's only able to see this Kershner funkel word, not because it's in the English dictionary, but because it's in our words dot text, personal word list that we already created with PWL, or at least with enchants. And that's how we were working with it. We added it to it from Python. That's pretty cool. Pretty nifty. Pretty simple stuff, though. But I wanted to show you guys how it all works. And now we've got this words dot text file, which is pretty much our own personal words list. This can be as huge as we want it to be. And it works just fine with our ancient library. Cool. Thanks for sticking with me guys. I hope you enjoyed this tutorial. I'll jump into something new in the next tutorial. But I hope you're enjoying this series so far. Thanks. See you later.