0 votes
607 views
I need to find out what percentage of each book has been drafted. A count of how many verses in each book have text in them would be close enough. Can anybody write a regex that would do this?

Thanks for any help you can give me on this.

John Nystrom
Paratext by (312 points) | 607 views

2 Answers

0 votes
Is something as simple as this what you're looking for, or are you looking for some more complex?
\\v \d+ .

PT doesn't catch carriage returns with . and so I think that would work. Otherwise:
\\v \d+ \w

But that wouldn't catch verses that start with numbers or punctuation.
by (1.9k points)
mjames,

Thank you for this. This does count non-empty verses. I'm trying to answer these questions: What percentage of the OT is drafted in this project? What percentage of the NT is drafted? It's easy to do when I know an entire book is drafted, but the team I'm most concerned about is doing an OT panorama, so they have drafted a bit here and a bit there.

I would love to be able to run something one time that would count the non-empty verses in all books and give me the results by book and a total so I don't have to do this 66 times for each project for which I need this info. So yes, I am looking for something a bit more complex and I understand this is not a simple thing. I was hoping maybe somebody had already done this or knows of an existing tool that can do it.
Do you need the information at both a book level and also at the testament level? If you're mainly concerned about the whole OT or NT, why not just limit the books you're searching in PT to one of those two options? So search the whole NT for that regex, not just one book?

I think if you wanted to get a result which listed each book's count and a total count, all in one single command, then it would probably require an external script. I don't think PT has the capability to give multiple results like "each book count + a total count".
To answer the question somebody else is asking me, which got me started on this, i.e. how much of the OT is drafted, yes, I can just use that regex and run it on the OT. But it would be useful to me to know the info on the book level as well. If such a tool existed, I would use it periodically in several projects.
When I do this in the Paratext project, I get 16,886 items. When I do it in RegexPal, I get 16,677. I don't know why I get this discrepancy. For what I need the number for, it's not a big deal, but I think it's odd that it's not the same number.
Were you using the regex with the . in it? My guess is that PT doesn't match the . with line endings, but RegexPal does. This means if you ever have
\v_# (with no space after the # and a carriage return immediately)
then PT will not count it (since . isn't getting caught) but RegexPal will count it (since . is catching the carriage return).
0 votes

A single regex may not be enough. You could try to adapt a script from the Custom Tools menu, i.e. the My Paratext Projects/cms/ subdirectory.

by (872 points)

Related questions

0 votes
1 answer 255 views
As a user I'd like to know how many words are in a particular book or books.
Phil_Leckrone 9.8k asked Feb 8, 2024
0 votes
3 answers 454 views
Hi, I'm using this Regex \f .*?\f* for extract all footnotes, there is no books names to take printout for ... footnotes. Is any regex to get book names. image792 353 105 KB
Prabhu_beelagi 241 asked Jan 7, 2020
0 votes
1 answer 181 views
We have a user who is doing a transliteration from one script in a language to another script in the same language. ... has the reference number of PTXS-17276 Thank you, MSEAIT/LT
MSEAIT_LT 478 asked Aug 3, 2018
0 votes
1 answer 128 views
I have a regex that can extract all the figures in my Paratext project: \\fig .*\\fig\* I would like to have a ... . Thanks for any help you can give me on this. John Nystrom
john_nystrom 312 asked Nov 6, 2024
0 votes
1 answer 282 views
I notice the checklists has a long sentence list but no short sentence list. Is there a regular expression for counting the ... in my whole project but that isn't a useful figure.
[Expert]
sewhite
3.3k
asked Mar 9, 2017
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Make every effort to keep the unity of the Spirit through the bond of peace.
Ephesians 4:3
3,037 questions
5,994 answers
5,661 comments
2,022 users