Search for a word NOT before another word

Page 1 of 2 (25 items) 1 2 Next >
This post has 24 Replies | 1 Follower

Posts 725
Harry Hahne | Forum Activity | Posted: Fri, Apr 27 2012 12:57 PM

I want to find all instances of a certain word where another word does not occur before it. For example, I would like to find all instances of Jesus where it does not have the word "Lord" directly before. This search does not work as expected:

   Jesus ANDNOT AFTER 1 WORD Lord

This finds verses where the words Jesus and Lord appear, but "Lord" does not appear before  "Jesus". It does not find verses like Matt 1:1 where only Jesus appears.

How would I do this search?

Posts 18075
Rosie Perera | Forum Activity | Replied: Fri, Apr 27 2012 1:02 PM

You could probably do it using passage lists and subtraction of the results. Search tabs have command "Save as passage list" so you save the results as one PL for all occurrences of Jesus, another for all occurrences of Lord BEFORE 1 word Jesus, and then subtract the two lists by using the Merge > Intersection option in the PL tab.

It would miss any occurrence of Jesus alone without being preceded by Lord which occurred in a verse that ALSO has "Lord Jesus" in it somewhere else. But other than that it should work. Sorry I don't have time to work up a more detailed description of the procedure for you.

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Fri, Apr 27 2012 3:42 PM

Harry Hahne:
How would I do this search?

In English (Bible Search):

Jesus -"Lord Jesus"

In Greek (these Morph Searches has the same results): 

lemma:Ἰησοῦς ANDNOT (lemma:κύριος BEFORE 1 WORD lemma:Ἰησοῦς)

lemma:Ἰησοῦς ANDNOT (lemma:κύριος BEFORE 1-2 WORDS lemma:Ἰησοῦς)

Noticed John 11:21 is found by these searches where "Jesus" immediately precedes "Lord".  In English, Romans 10:9 is found in a variety of translations.

Keep Smiling Smile

Posts 49
Darrell | Forum Activity | Replied: Fri, Apr 27 2012 6:13 PM

See if this gives you what you're looking for,,

 

"Jesus" ANDNOT "Lord Jesus"

Lenovo Win 10_Home_OS,  Logos Bible Software 6.6 SR-1  6.6.0.0059.   Nexus 7 Tablet,  

Samsung gs4 phone Android 4.3   Bible version 4.6.4 (Build 443)

Posts 18075
Rosie Perera | Forum Activity | Replied: Fri, Apr 27 2012 11:33 PM

Darrell:

See if this gives you what you're looking for,,

"Jesus" ANDNOT "Lord Jesus"

That is equivalent to what KS4J suggested:  Jesus -"Lord Jesus"

The minus sign is shorthand for ANDNOT, and you don't need quotation marks around a single word that isn't a phrase.

My answer above was really dumb! I can't believe I didn't think of this, KS4J and Darrell. Thanks. Embarrassed

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Sat, Apr 28 2012 11:08 AM

Rosie Perera:
My answer above was really dumb! I can't believe I didn't think of this, KS4J and Darrell. Thanks. Embarrassed

For dumb ideas, glad to be among friends Embarrassed  My initial thought was passage list subtraction, then noticed you had already replied.  Later had an aha! moment Idea when I realized that

Harry Hahne:
Jesus where it does not have the word "Lord" directly before

is equivalent to excluding the phrase "Lord Jesus"; then wondered if minus would work with a phrase for searching (since minus works with dynamic collection rules).  Personally learned minus worked Yes in a Bible Search, but does not work with parenthesis in Morph Search so used ANDNOT.

Keep Smiling Smile

Posts 725
Harry Hahne | Forum Activity | Replied: Wed, May 2 2012 3:00 PM

Darrell:

See if this gives you what you're looking for,,

"Jesus" ANDNOT "Lord Jesus"

I tried this, but it is not what I want. The problem is that if a verse has both "Jesus" and "Lord Jesus" it will not show up in the search results.

For example if you search for "life" ANDNOT "the life", it will not find 1 John 1:2, since both "life" and "the life" occur.

Posts 1649
Room4more | Forum Activity | Replied: Wed, May 2 2012 4:13 PM

"jesus" ANDNOT "lord" = 762 verses ESV

ANDNOT "lord jesus" also takes away 'jesus' as well from the phrase the same as you are getting for the "the life", but there will be an instance or two where youy will still get Lord as well, but most are filtered - hey its not perfect, ya'kno..

DISCLAIMER: What you do on YOUR computer is your doing.

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Wed, May 2 2012 4:16 PM

Harry Hahne:

Darrell:

See if this gives you what you're looking for,,

"Jesus" ANDNOT "Lord Jesus"

I tried this, but it is not what I want. The problem is that if a verse has both "Jesus" and "Lord Jesus" it will not show up in the search results.

Back to passage list idea: could create a passage list for Bible Search:

Jesus -"Lord Jesus"

then do a Bible Search for:

Jesus WITHIN 100 WORDS "Lord Jesus"

to find verses where both occur and add to passage list e.g. Acts 19:13 and 1 Peter 1:3 (doubt 1 Corinthians 5:4 nor 2 Thessalonians 1:12 would be added since "Lord Jesus" occurs twice in those verses):

Harry Hahne:
For example if you search for "life" ANDNOT "the life", it will not find 1 John 1:2, since both "life" and "the life" occur.

Bit more challenging since Greek usage in 1 John 1:2 is literally "the life" and "the life the eternal" so both uses have the definite article.  May try syntax searching later since noticed "the life" are in different primary clauses (PC):

Keep Smiling Smile

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Wed, May 2 2012 4:21 PM

Room4more:
"jesus" ANDNOT "lord" = 762 verses ESV

The ANDNOT "lord" excludes Acts 19:13 and 1 Peter 1:3 from search results (since Lord does appear in those verses).

Keep Smiling Smile

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Wed, May 2 2012 10:14 PM

Keep Smiling 4 Jesus :):

Harry Hahne:
For example if you search for "life" ANDNOT "the life", it will not find 1 John 1:2, since both "life" and "the life" occur.

Bit more challenging since Greek usage in 1 John 1:2 is literally "the life" and "the life the eternal" so both uses have the definite article.  May try syntax searching later since noticed "the life" are in different primary clauses (PC):

Syntax search can find "the life" and "the life the eternal" separately.  With definer being present, syntax search finds life with a definer (often eternal):

Keep Smiling Smile

Posts 1649
Room4more | Forum Activity | Replied: Wed, May 2 2012 11:28 PM

KS4J,

Well it is not a bug, I can duplicate the same results from another program that has absolutely nothing in common with L4, So it is what it is.........but still not sure why you would do a search like that, of course I have seen some others that I did not understand why....of cousre no one ever says why, they just say that it doesn't give them the results they seek...?

DISCLAIMER: What you do on YOUR computer is your doing.

Posts 582
Gary O'Neal | Forum Activity | Replied: Thu, May 3 2012 6:19 AM

Harry Hahne:
For example if you search for "life" ANDNOT "the life", it will not find 1 John 1:2, since both "life" and "the life" occur.

Here's a way you can find these -- but it may be more trouble than what you care to put out.

First, do a Bible search for "life" (display as "Aligned") and export the results to an Excel file. My search of ESV in the NT found 205 results in 186 vs.

In the Excel file, notice that there are several different columns, one labeled as "preceding context" and one labeled as "hit". Select the column labeled "preceding context" -- Don't select the column header (click in cell under "preceding context", hold shift key down, hit End key, hit Down key)

Copy this selection and paste into Notepad++, a free text editor that understands Regular Expressions.

Click Search -> Replace...

In the dialog, make sure the "Regular Expression" is selected. In the Find box, copy and paste this expression -- (.*)\s(.*\>)

In the Replace box type \2 -- Now Click Replace All

You should be left with the last word of each sentence. Copy these and go back to Excel. Click in the cell under "preceding context" and paste.

Now you can sort on this column and all the hits which have "the" before them will be together. Delete these lines and you have your final results. You can resort again on the Reference column to get Bible books together. I found 192 hits.

Sounds complicated, but once you've done it a time or two it really isn't that bad.

πάντα εἰς δόξαν θεοῦ ποιεῖτε

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Thu, May 3 2012 8:58 AM

Harry Hahne:

This finds verses where the words Jesus and Lord appear, but "Lord" does not appear before  "Jesus". It does not find verses like Matt 1:1 where only Jesus appears.

How would I do this search?

One option is a Syntax Search.  Caveat: Greek sentences do not align with verse numbering: some verse numbers have more than one Greek sentence (e.g. 1 John 1:2) while some Greek sentences have more than one verse number(e.g. Ephesians 1:3-14 is one Greek sentence).   Some word groups within one Greek sentence span verse numbers (e.g. Acts 1:1-2 and 2 Timothy 1:8-10)

First created syntax search to find word groups with "Lord Jesus" (with matching skip levels between word group and group along with highlighting words in search results):

that includes Acts 19:13 "Lord Jesus", followed by searching for word groups that do not have κύριος (Lord):

Acts 19:13 Ἰησοῦς (Jesus) is highlighted in a word group, which does not have "Lord Jesus"

The search results can be saved as a passage list so need to remember some verses have "Lord Jesus" in one word group with "Jesus" in a different word group: e.g. Acts 19:13 plus some word groups span verse numbers: e.g. Acts 1:1-2, 1 Timothy 2:5-6, 2 Timothy 1:8-10, 2 Timothy 1:9-10, Titus 1:1-3, Hebrews 3:1-2, Hebrews 10:19-20, and 1 Peter 1:1-2  (noticed 2 Timothy 1:8-10 has two occurrences of "Jesus" in different word groups so matching skip levels finds "Jesus" a couple times).

Keep Smiling Smile

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Thu, May 3 2012 9:13 AM

Gary O'Neal:
Copy this selection and paste into Notepad++, a free text editor that understands Regular Expressions.

An alternative to Notepad++ is using Visual Basic for Applications (VBA) to expose Excel's regular expression support => http://www.dailydoseofexcel.com/archives/2005/08/13/pattern-matching/

Edit: VBA has InStrRev() so could search for last blank in "preceding context" that could return numeric position of last blank within text string (or 0 for not found).

A technical article about Office 2003 includes regular expression examples => http://msdn.microsoft.com/en-us/library/aa159903%28v=office.11%29.aspx

Word 2010 find and replace has wildcard (regular expression) option.  Caveat: Word 2010 implementation has practical limits for regular expression matching since encountered some failures (expression too long) while formatting a personal book Bible for Logos 4 => American Standard Version 1901 - Personal Bible without Chapter and Verse #'s

Keep Smiling Smile

Posts 582
Gary O'Neal | Forum Activity | Replied: Thu, May 3 2012 9:42 AM

Keep Smiling 4 Jesus :):

 

Just a quick check and noticed that this search doesn't return either Rom. 1:1 or 1:4. My 'complicated' search method above returned 862 hits and yours shows 827 so there's not many that are being missed.

 

πάντα εἰς δόξαν θεοῦ ποιεῖτε

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Thu, May 3 2012 11:51 AM

Gary O'Neal:
Just a quick check and noticed that this search doesn't return either Rom. 1:1 or 1:4. My 'complicated' search method above returned 862 hits and yours shows 827 so there's not many that are being missed.

Personally living and learning Romans 1:1-7 is one Greek sentence, which has one word group that spans Romans 1:1-6 that contains the lemma κύριος (Lord)

Observation: Romans 1:4 has Jesus Christ our Lord, which is a variation of "Lord Jesus" from genitive use of the Lord (of us = our) modifying Jesus and Christ.

Modified Syntax Search to find Acts 19:13 and Romans 1:1 (also learned Logos 4.5b on Mac lacks not symbol for visual display along with duplicating syntax search since was open and modified in two Logos 4.5b installations at the same time):


Keep Smiling Smile

Posts 725
Harry Hahne | Forum Activity | Replied: Thu, May 3 2012 2:37 PM

Keep Smiling 4 Jesus :):
Syntax search can find "the life" and "the life the eternal" separately.

I am aware that syntax searches can do this type of search in Greek or Hebrew. But there are times I want to do this in English. Even for Greek and Hebrew, syntax searches are also time consuming to set up and it is easy to make a mistake without even knowing it.

Posts 1649
Room4more | Forum Activity | Replied: Thu, May 3 2012 4:59 PM

Harry Hahne:

Keep Smiling 4 Jesus :):
Syntax search can find "the life" and "the life the eternal" separately.

I am aware that syntax searches can do this type of search in Greek or Hebrew. But there are times I want to do this in English. Even for Greek and Hebrew, syntax searches are also time consuming to set up and it is easy to make a mistake without even knowing it.

Yes this may be true, but it gives KS4J something to do during the day…..Surprise

DISCLAIMER: What you do on YOUR computer is your doing.

Posts 15805
Forum MVP
Keep Smiling 4 Jesus :) | Forum Activity | Replied: Thu, May 3 2012 7:02 PM

Harry Hahne:

Keep Smiling 4 Jesus :):
Syntax search can find "the life" and "the life the eternal" separately.

I am aware that syntax searches can do this type of search in Greek or Hebrew. But there are times I want to do this in English. Even for Greek and Hebrew, syntax searches are also time consuming to set up and it is easy to make a mistake without even knowing it.

Concur syntax search can be time consuming to set up; personally had several attempts that found nothing (until changed vertical arrangement of lemma's).  Also appreciate easy to make a mistake.  Likewise learning that "is not present" has some nuances for syntax searching.

Thankful for many friendly forum discussions about Logos Bible Software: have learned a lot plus have a lot to learn (personally amazed at amount of learning this year).

Keep Smiling Smile

Page 1 of 2 (25 items) 1 2 Next > | RSS
Copyright 1992-2015 Faithlife / Logos Bible Software.