Over the weekend, a user posted a question to our user forums asking if it was possible to perform a particular search:
I need to find Psalms where a word or expression does NOT occur. I can do a search where one word does occur and exclude other words with NOT, but I wasn't able to do it with only non-occurrences of a word or root. How can I do it? (Can I?)
Is this search possible with Accordance? Of course it is! And it helps to illustrate a few of Accordance's search features quite nicely.
Since this user didn't give the search term that he wanted to exclude, I'll choose to look for Psalms that do not contain the word "love." First, I'll tell you how to construct the search, and then we'll examine it in more detail.
- Open a Search window, make sure an English Bible is selected in the search text pop-up menu, and click the Search for Words radio button.
- Type an asterisk (*), then choose NOT from the Enter Command submenu of the Search menu, then type "lov*" (without the quotes).
- Click the More Options disclosure triangle to view the additional options. In the first pop-up labeled "Search within every", choose "Chapter." In the second pop-up preceded by the word "in," choose "Psalms."
Note: I'm assuming you've already defined a "Psalms" range. If you haven't, choose "Define Range..." from this pop-up menu. In the dialog that opens, click the New button, then give your new range a name ("Psalms") and a definition (ps, psa, psalms, etc.—as long as it's enough to uniquely identify the book of Psalms). Then click Update to add your new range.
Your search argument should now look like this:
When you click OK to perform this search, Accordance will find every word in every psalm except for those which contain the word "love." Now, how does this search work?
First, we entered the asterisk wildcard, which in word search mode, tells Accordance to find any word. We had to enter the asterisk because we had to search for something positive before we could exclude the word we didn't want to find. If you think about this search, it's essentially negative. Instead of looking for a particular word, we're trying to avoid finding a particular word. To a computer, searching for nothing is somewhat akin to dividing by zero. In order to avoid disrupting the entire space-time continuum, we need to search for something, and then exclude what we don't want to find. Using the asterisk to search for any word gives us a comprehensive positive search from which to exclude the words we don't want to find.
The NOT command followed by "lov*" indicates that we want to find any words which do not appear together with any form of the word "love." Now the question becomes, "How closely together may they not appear?" Are we looking for any word which does not appear within the same verse as "love"? Within the same "sentence"? Within the same "paragraph"? We can choose from any of these options in the "Search within every" pop-up menu. By choosing "Chapter," we are saying that we want to find any word, as long as it does not appear within the same chapter as the word "love."
Sure enough, when we click OK to perform this search, we'll get every word in every psalm except those psalms which contain the word "love." To prove it, enter Psalm 136 in the Go To box and you'll be taken to Psalm 137. Psalm 136, which contains the refrain "His love endures forever," is not there. That psalm has been excluded by our search.
Now, for the pièce de résistance! If you want to see at a glance which psalms were excluded, click the Details button. In the Details Workspace, click the Table button. Now use the one keyboard shortcut you absolutely must learn—command-T—to open the Set Table Display dialog box. In the dialog box, check the "Show Chapter Detail" checkbox and click OK. Now, you should see something like this:
The psalms which contain the word love are the ones with zero in the Total Hits column. Pretty cool, huh?
While most of you may not ever need to do this particular search, I do hope that this little case study has helped you to understand some of the logic behind the Accordance search engine.