+1 vote

Hi,
How to calculate number of words in chapter or in one book. It should not include marking.

Paratext by (224 points)
reshown

3 Answers

0 votes
Best answer

Here is some regex that will do a similar thing in RegexPal:
(?<=(\\(?!(b|c|cp|f|fr|id\w*|jmp|periph|rem|toc\d|usfm|v|vp|x|xo)\s)\+?\w+[\s\*]|[cv]\s+\S+\s))[^\\]*?(?=\\|\Z):::\S+
Use Count (CTRL-O) to find all the words in a an entire project down to a single book.This will give you more words but it is probably more accurate. The Wordlist excludes numbers and words in certain reference fields like \r \ior and sometimes \xt which may not need to be checked for spelling, but should probably be included in a word count.

Detail
This is an explanation of the regex:
The first part is a context where you want to count words. It excludes markers as well as chapter and verse numbers: (?<=(\\(?!(b|c|cp|f|fr|id\w*|jmp|periph|rem|toc\d|usfm|v|vp|x|xo)\s)\+?\w+[\s\*]|[cv]\s+\S+\s)[^\\]*?(?=\\|\Z):::

  • It includes a list of markers whose contents you probably do not want counted:
    (?!(b|c|cp|f|fr|id\w*|jmp|periph|rem|toc\d|usfm|v|vp|x|xo)\s)
  • This part excludes chapter numbers and verse numbers: [cv]\s+\S+\s

The second part \S+ simply finds text separated by spaces. Since it is greedy it will find text up to a space, end of string, or end of file.

by (1.8k points)
reshown
0 votes
Here is a quick way to get a count of any selection (based on Word List options) of verse, chapter, section, book, or books. You use Excel to get the full count.
Here is a Quick Tip video: https://www.loom.com/share/21b31bb8bf37492695e1b27589f75f43?sid=60a34a28-7f27-44ec-a9e3-dcbcbc33de86
by (8.4k points)
edited by
0 votes

Thank you so much anon848905 exactly I want like this, I tried by Regex \w+ but it did not give exactly value.

by (224 points)
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
All the believers were one in heart and mind. No one claimed that any of their possessions was their own, but they shared everything they had.
Acts 4:32
2,628 questions
5,370 answers
5,045 comments
1,420 users