Search the Mac Dictionary by Definition
Hey guys, this is Mac. Heads on with a video on a little app we made.
Now basically, what this app does is it lets you search the dictionary on your Mac for a definition instead of for a term. Because, if you hadn't already noticed, if you open up the dictionary app, which just comes with your Mac, and you type a word, for instance, let's say "look up," it says the definition is a stupid person.
I can look up the word "idiot," and it says the definition is also a stupid person. But if I look up "a stupid person," no results come up. Basically, it doesn't let you search by definition; it always lets you search by word. This is kind of frustrating, especially if you want to see all the words with the same definition.
For instance, let's say I wanted to find all the words that have a "stupid person" somewhere in their definition. I can't do that using the dictionary app, and that's where our app "Definition Search" comes in.
So all you got to do is open up Definition Search and type a phrase, for instance, "a stupid person," and it'll tell you all the words that contain this somewhere in the definition. So, for instance, if I go back into the dictionary app and let's say I search something in this list like "blockhead," indeed the definition is a stupid person. You know, you can see all these.
This is a really neat and easy way to find all the words with the definition. Now I'm just going to talk a little bit about how this actually works, how this app works, for all the programmers who are interested.
So basically, all this program does is it creates its own index of all the stuff in the Mac dictionary and then it searches that. Unfortunately, Apple has an API for looking up words in the dictionary by word, but just like their dictionary app, they actually have no API for looking up all the words with something in the definition.
So the app instead goes through and creates a database by, you know, brute forcing through the entire Mac dictionary. It creates a database with all the definitions and all the words. You can actually see this if you go up into the preferences of the app.
It'll talk about indexes and when the last index was made. Obviously, I ship an index with the app so you don't have to make one, but you can actually go ahead and start indexing, and it'll start regenerating a database. You can obviously cancel that or pause it or whatever.
So basically, this app just uses one of Apple's silly APIs and improves upon it to add functionality. I hope this was interesting to some of you, but anyway, thanks for watching, subscribe, and goodbye.