words following or preceding a phrase

wsbones

Beta Tester
Messages
3,192
I had previously written a python script to find these words, but a regex search can do this right in SS. I was interested in the word preceding "of life" like tree of life or word of life, etc.

Here's the regex search expresssion and results. Regex searches are done using the F2 key and picking the Regex Search tab.

Here's what the input looks like.
upload_2014-4-16_14-38-39.png


RESULTS
Regular Expression search: \W\w+\Wof life
Search parameters: Remove Pre- and Post-Scripts
Search scope: Genesis - Revelation
Total matching verses: 70
Total Match Count: 70
Matching Strings:

String Match Count
book of life 8
bread of life 2
breath of life 4
bundle of life 1
crown of life 2
end of life 1
even of life 1
fountain of life 3
grace of life 1
him of life 1
issues of life 1
justification of life 1
light of life 1
manner of life 2
newness of life 1
path of life 2
paths of life 1
pride of life 1
prince of life 1
promise of life 1
reproof of life 1
resurrection of life 1
savour of life 1
spirit of life 2
statutes of life 1
sure of life 1
time of life 4
tree of life 10
up of life 1
water of life 3
way of life 4
ways of life 1
well of life 1
wellspring of life 1
word of life 2
 
Very interesting Bill... going to try it out myself. :)
 
Me, too! Thanks, Bill!
 
If you put a colon before the numbers, you can paste the result into www.wordle.net, advanced option, the top input box, and produce a word cloud of phrases. You need to have JAVA enabled in your browser for that site. I wouldn't enable it globally however for security reasons. I'm don't mean JAVASCRIPT but rather JAVA programming language (available here https://www.java.com/en/download/)

Maybe it would be an interesting SS new feature to produce "phrase clouds" for searches that return a table of phrase results.

book of life:8
bread of life:2
breath of life:4
... etc.

produces this:
upload_2014-4-16_21-22-15.png
 
I wouldn't have thought to do a search on what the Bible says about x "of life." What an interesting study! Thanks, Bill! And for the clue about RegEx searches.
 
Good stuff!
 
Here's an interesting regex search for the word following "and God".

Search Details
Regular Expression search: \band god\W\w+\W
Search parameters: Remove Pre- and Post-Scripts
Search scope: Genesis - Revelation
Total matching verses: 118
Total Match Count: 128
Matching Strings:

String Match Count
and god almighty 2
and god also, 1
and god answered 1
and god appeared 1
and god blessed 4
and god called 3
and god came 3
and god command 1
and god created 1
and god delivered 1
and god did 2
and god divided 1
and god doeth 1
and god feedeth 1
and god gave 3
and god granted 1
and god had 2
and god hath 6
and god healed 1
and god heard 2
and god hearkened 3
and god helped 1
and god himself 1
and god in 1
and god is 4
and god looked 2
and god made 5
and god met 1
and god moved 1
and god of 1
and god opened 1
and god remembered 3
and god repented 1
and god requireth 1
and god said 18
and god said, 12
and god saw 9
and god sent 2
and god set 1
and god shall 3
and god smote 1
and god spake 6
and god stirred 1
and god talked 1
and god that 1
and god the 1
and god was 2
and god went 2
and god will 2
and god wrought 1
and god's 1

It would be a nice SS feature to link the searches in the search result table.
 
Last edited:
nice...............:)
 
For this type of search (pattern matching and wildcard) where multiple types of matches occur, it would be useful to be able to send the matching strings to a delimited file for sorting or filtering or else have the capability within SwordSearcher.
 
I'm wondering if Bill or Brandon or someone familiar with regular expressions could help me.

In the TR module I want to find και ___ δε, in other words, I want to find instances like 2Ti 3:12:

2Ti 3:12 (TR) και παντες δε οι θελοντες ευσεβως ζην εν χριστω ιησου διωχθησονται

But I want to find all instances no matter what word comes between και and δε.

I tried adapting Bill's regular expression search of the KJV which finds any one word in front of the two words "of life", but it didn't work. I think my ignorance of RE is part of the problem, but I suspect that the Greek letters may be messing it up.

I tried to search for "\W\w+\Wκαι" in the TR module, but it got no hits. If I put any random KJV word in the same search and search the KJV, I get hits.

look for any word preceding kai in Greek TR.jpg


Any help you can offer would be very much appreciated!
 
The problem is \w+ which matches any alphanumeric character; this is equivalent to the set [a-zA-Z0-9_]. You would have to specify a set of Greek characters instead. I defer to Brandon :confused:
 
I'm having trouble with this one -- it appears that the RegEx library's character classes aren't working with Greek. This works to narrow it down to 43 verses:

και [^ ]+ δε

But it is imperfect because it includes words that end with και or start with δε. Normally I would put \b (word boundary) but it's not working with Greek.
 
Careful with \s. It forces a whitespace match, which means it will cause the match to fail at the beginning or ending of a verse.
 
This finds 9 occurrences: και\s[α-ωΑ-Ω]+\sδε\s
Brandon, I see your point.
 
Thanks, men. I'll look into it, but I think the 9 Bill got is correct (at least the number). I'm grateful!
 
It is exactly what I needed. Thank you very much. The /s did not cause any problems in this case: the search did find matches at the beginning of verses (apparently due to the way it was constructed).
I'm a happy camper! :)
 
Thanks, men. I'll look into it, but I think the 9 Bill got is correct (at least the number). I'm grateful!
Brandon's is a more parsimonious, and if you put the \s at the end, it will find the 9 also.
 
Back
Top