When using verse numbers inside a script, it is not save to assume verse number within a chapter are sequential without gaps. The folling script will produce a list of 'missing' verses.
%load_ext autoreload
%autoreload 2
# Loading the Text-Fabric code
# Note: it is assumed Text-Fabric is installed in your environment
from tf.fabric import Fabric
from tf.app import use
# load the N1904 app and data
N1904 = use ("tonyjurg/Nestle1904LFT", version="0.6", hoist=globals())
Locating corpus resources ...
Name | # of nodes | # slots / node | % coverage |
---|---|---|---|
book | 27 | 5102.93 | 100 |
chapter | 260 | 529.92 | 100 |
verse | 7943 | 17.35 | 100 |
sentence | 8011 | 17.20 | 100 |
wg | 105430 | 6.85 | 524 |
word | 137779 | 1.00 | 100 |
3
tonyjurg/Nestle1904LFT
C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/app
e68bd68c7c4c862c1464d995d51e27db7691254f
''
orig_order
verse
book
chapter
none
unknown
NA
''
0
text-orig-full
https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/
about
https://github.com/tonyjurg/Nestle1904LFT
https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/features/<feature>.md
layout-orig-full
}True
local
C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/_temp
Nestle 1904 (Low Fat Tree)
10.5281/zenodo.10182594
tonyjurg
/tf
Nestle1904LFT
Nestle1904LFT
0.6
https://learner.bible/text/show_text/nestle1904/
Show this on the Bible Online Learner website
en
https://learner.bible/text/show_text/nestle1904/<1>/<2>/<3>
{webBase}/word?version={version}&id=<lid>
v0.6
True
True
{book}
''
True
True
{chapter}
''
0
#{sentence} (start: {book} {chapter}:{headverse})
''
True
chapter verse
{book} {chapter}:{verse}
''
0
#{wgnum}: {wgtype} {wgclass} {clausetype} {wgrole} {wgrule} {junction}
''
True
lemma
gloss
chapter verse
grc
# Initialize variables for tracking the previous verse and node
previousVerse = 1
previousNode = 0 # Start with a dummy value for the previous node
# Iterate over all verse nodes in the dataset
for verseNode in F.otype.s('verse'):
# Retrieve the verse number for the current node
ThisVerse = F.verse.v(verseNode)
# Check if the current verse is different from the previous one
if ThisVerse != previousVerse:
# Check for a gap in verse numbering that is not at the start
if ThisVerse != previousVerse + 1 and ThisVerse != 1:
# Calculate the size of the gap and print details
print(f'Hole of {ThisVerse - previousVerse - 1} verse(s) between {T.sectionFromNode(previousNode)} and {T.sectionFromNode(verseNode)}')
# Update the previous verse and node to the current ones
previousVerse = ThisVerse
previousNode = verseNode
Hole of 1 verse(s) between ('Matthew', 17, 20) and ('Matthew', 17, 22) Hole of 1 verse(s) between ('Matthew', 18, 10) and ('Matthew', 18, 12) Hole of 1 verse(s) between ('Matthew', 23, 13) and ('Matthew', 23, 15) Hole of 1 verse(s) between ('Mark', 7, 15) and ('Mark', 7, 17) Hole of 1 verse(s) between ('Mark', 9, 43) and ('Mark', 9, 45) Hole of 1 verse(s) between ('Mark', 9, 45) and ('Mark', 9, 47) Hole of 1 verse(s) between ('Mark', 11, 25) and ('Mark', 11, 27) Hole of 1 verse(s) between ('Mark', 15, 27) and ('Mark', 15, 29) Hole of 78 verse(s) between ('Mark', 16, 20) and ('Mark', 16, 99) Hole of 1 verse(s) between ('Luke', 17, 35) and ('Luke', 17, 37) Hole of 1 verse(s) between ('Luke', 23, 16) and ('Luke', 23, 18) Hole of 1 verse(s) between ('Acts', 8, 36) and ('Acts', 8, 38) Hole of 1 verse(s) between ('Acts', 15, 33) and ('Acts', 15, 35) Hole of 1 verse(s) between ('Acts', 24, 6) and ('Acts', 24, 8) Hole of 1 verse(s) between ('Acts', 28, 28) and ('Acts', 28, 30) Hole of 1 verse(s) between ('Romans', 16, 23) and ('Romans', 16, 25)