Jump to content


Photo

RegexForAccordance

regex

  • Please log in to reply
31 replies to this topic

#21 Matt Fredenburg

Matt Fredenburg

    Gold

  • Active Members
  • PipPipPipPip
  • 326 posts
  • Gender:Male
  • Accordance Version:12.x
  • Platforms:Windows, iOS

Posted 15 January 2015 - 03:23 PM

Would the kind folks at Accordance please sherlock this, and do the honors of making this a feature of Accordance itself? I've been longing for advanced search features in the notes (as well as texts). Excellent idea, and nicely done.

+1

 

Matt


Specs:
  • Windows 10 Pro 10.0.14393
  • Accordance 12.0.2
  • i7-6800K @ 3.40 GHz
  • 64 GB RAM
  • Nvidia 1080 GTX 8GB VRAM

#22 farcas

farcas

    Gold

  • Active Members
  • PipPipPipPip
  • 239 posts
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 27 February 2016 - 05:49 PM

Could this help with finding hebrew word play between words? E.g. Noah found favor... נח found חן...Gen 6:8 - וְנֹ֕חַ מָ֥צָא חֵ֖ן בְּעֵינֵ֥י יְהוָֽה׃ פ

 
 
Thanks!


#23 Darin Franklin

Darin Franklin

    Silver

  • Active Members
  • PipPipPip
  • 106 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X

Posted 28 February 2016 - 02:16 PM

In your other post, I think you are asking how to search for two words in the same verse which have the same letters, but not in the same order. You can do this with regular expressions, but there are some complications.

 

In RegexForAccordance, click Filters and remove cantillation and points.

The commands to know for this search are

\b for word boundary 

\w for word character (i.e., not a space or punctuation).

 

Search for a two letter word: \b\w\w\b

Now we want to capture the two letters and match another word with those same letters. Parentheses capture, and \1 and \2 represent what was captured.  The .* matches 0 or more of any character. 

\b(\w)(\w)\b.*\b\2\1\b

 

If you search Genesis, you will find a lot of hits with אל... לא.  In fact, the only one that isn't like that is your example of Gen 38:7:

ער בכור יהודה רע

 

Notice that it does not find Gen 6:8.

 

ונח מצא חן בעיני יהוה׃ פ

 

That is due to two complications.

 

1. נח does not begin at a word boundary because of the ו prefix.  

2. חן has a final form nun.  Final form and medial form are different Unicode characters, so they do not match each other.

 

You could add a ו to fix the first problem:

\bו(\w)(\w)\b.*\b\2\1\b

 

That finds more hits with ואל...לא

 

To account for final forms, you could search each one separately.

\bונ(\w)\b.*\b\1ן\b

 

That finds Gen 6:8 and nothing else in the whole OT. 

 

This search can be extended to three character words by adding one more (\w) to the beginning and \3 to the end.

 

\b(\w)(\w)(\w)\b.*\b\3\2\1\b

 
Then you will probably want to check for the other permutations, not just reverse order.

\b(\w)(\w)(\w)\b.*\b\2\3\1\b

\b(\w)(\w)(\w)\b.*\b\1\3\2\b

 
 
 
 

 



#24 farcas

farcas

    Gold

  • Active Members
  • PipPipPipPip
  • 239 posts
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 13 March 2016 - 11:00 PM

This is great! Thanks. Wish this could be integrated into Accordance searches! The best I can come up with is searching for two words that contain the same characters, but I can't specify the order.  Any work around within Accordance lex data...?

 

 

Thanks!



#25 Fabian

Fabian

    Mithril

  • Super Member
  • PipPipPipPipPipPip
  • 4,768 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 13 March 2017 - 10:12 AM

Hello Darin 

 

I have a request after a search in RegexforAccordance and in Accordance I got different counts of hits.

 

See like https://www.accordan...verse/?p=101503 and Attached File  Bildschirmfoto 2017-03-13 um 16.03.07.png   100.4KB   1 downloads ^And in Mark. I have seen that in different Verses the ESV has a superscript after the verse numbering. I would love to have to filter this.

 

Greetings

 

Fabian


Edited by Fabian, 13 March 2017 - 10:13 AM.

Greetings

Fabian

ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

PLEASE!
Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.

#26 Darin Franklin

Darin Franklin

    Silver

  • Active Members
  • PipPipPip
  • 106 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X

Posted 14 March 2017 - 06:53 PM

Hi Fabian.  I will summarize here what we discussed in private messages.

 

The regular expression you want is: ^\W*and\b

If you use only this: ^and

then it fails to find Mark 8:20 because of the leading quotation mark, and it matches Mark 3:18, which starts with "Andrew".

 

Mark 8:20 “And the seven for the four thousand, how many baskets full of broken pieces did you take up?” And they said to him, “Seven.”

Mark 3:18 Andrew, and Philip, and Bartholomew, and Matthew, and Thomas, and James the son of Alphaeus, and Thaddaeus, and Simon the Zealot,

 

^ matches the beginning of the line

\W* matches zero or more non-word characters, like punctuation and space.

\b matches a word boundary.

 

This results in 394 verses for Mark, and the list matches what Accordance finds with this query:

and <WITHIN 1 Words> [FIELD BEGIN] <AND> [RANGE Mark]

 

I can't reproduce your result of 329 verses.  Let me know if you ever see it again.

 


  • Fabian likes this

#27 Fabian

Fabian

    Mithril

  • Super Member
  • PipPipPipPipPipPip
  • 4,768 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 15 March 2017 - 01:53 AM

Hello Darin

Thank for your explanations.

 

Greetings

 

Fabian 


Greetings

Fabian

ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

PLEASE!
Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.

#28 Fabian

Fabian

    Mithril

  • Super Member
  • PipPipPipPipPipPip
  • 4,768 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 15 July 2020 - 10:22 AM

Hello Darin

 

Many thanks for the 1.0.9 update. 

 

May you wan't to check the Dark Mode feature? The text on the left side is nearly unreadable.

Attached File  Bildschirmfoto 2020-07-15 um 17.16.44.png   997.4KB   0 downloads

 

Thanks

 

Fabian


Edited by Fabian, 15 July 2020 - 10:24 AM.

  • Darin Franklin likes this
Greetings

Fabian

ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

PLEASE!
Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.

#29 Darin Franklin

Darin Franklin

    Silver

  • Active Members
  • PipPipPip
  • 106 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X

Posted 15 July 2020 - 11:18 PM

Thank you very much. Version 1.0.10 fixes Dark Mode.

v1.0.10-dark.png

 
I also updated the documentation page with some more detailed examples.

Version 1.0.9 fixed the problem with Accordance 13.1 that I mentioned in another post.
https://www.accordan...etching-verses/


Edited by Darin Franklin, 15 July 2020 - 11:52 PM.

  • Fabian likes this

#30 Fabian

Fabian

    Mithril

  • Super Member
  • PipPipPipPipPipPip
  • 4,768 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 15 July 2020 - 11:56 PM

Hello Darin 

 

Many thanks.

 

Is there a search "How many words per verse".

E.g in

 

Verse     Hits

Gen 1:1  7

Gen 1:2  8

Gen 1:3  5

 

Thanks

 

Fabian


Greetings

Fabian

ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

PLEASE!
Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.

#31 Darin Franklin

Darin Franklin

    Silver

  • Active Members
  • PipPipPip
  • 106 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X

Posted 16 July 2020 - 11:10 AM

Is there a search "How many words per verse".

 

No, it does not show the number of hits for each verse. 


  • Fabian likes this

#32 Fabian

Fabian

    Mithril

  • Super Member
  • PipPipPipPipPipPip
  • 4,768 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 16 July 2020 - 11:27 AM

No, it does not show the number of hits for each verse. 

Thanks.


Greetings

Fabian

ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

PLEASE!
Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.





Also tagged with one or more of these keywords: regex

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users