Return a copy of text following a given starting point
Point where text extraction will start
Length of text to extract from this USJ data
Return a copy of text between two points
Point where text extraction will start
Point where text extraction will end
Maximum length of string to return (defaults to 100)
Text between the two points, capped at length maxLength
Given a starting point, find the next location in this USJ data that matches the given text
Point where the search for text
will start
Text to find
Maximum length of text to search before stopping (default is 1000)
Object containing the USJ node where text
begins (it might be split across nodes),
offset within that node that indicates where text
begins, and a JSONPath string that
indicates the location of the of USJ node within usj
. Note that if the USJ node returned is
an object, it is the same object that is within this USJ data. So if you change it, you are
changing this USJ data.
Find the parent of the first value matching the given JSONPath query within this USJ data
Find the first value matching the given JSONPath query within this USJ data
Convert a JSONPath query into a VerseRef and offset
JSONPath search expression that indicates a node within this USJ data. If the expression matches more than one node, then only the first node found is considered.
Optional
bookId: string3 letter ID of the book being searched (must be defined in this USJ data if not provided here)
VerseRef and offset that represents the location within this USJ data indicated by
jsonPathQuery
Build a JSONPath query that uniquely identifies the given node with this USJ data.
Determine the VerseRef and offset that correspond to the location of a node somewhere within this USJ data
ID of the book represented by this USJ data
JSON object representing the location of the VerseRef and offset
JSON object that owns the content
array that includes node
. If
'undefined' is provided then the UsjReaderWriter
will attempt to lookup the parent of
node
. The lookup will always fail and throw an error if node
is a string.
VerseRef and offset representing the location of node
, if one could be found
Remove all nodes from this USJ data that match a given search function.
Function that returns true
if the given node should be removed
Number of nodes removed
Inform this UsjReaderWriter that the underlying USJ object changed. This is needed to clear caches used when querying.
Convert a verse ref + offset into a node + offset within this USJ data and a JSONPath query
Indicates the book, chapter, and verse of interest to find
Specific location within verse text (defaults to 0)
Object containing the USJ node indicated by verseRef
and verseRefOffset
, offset
within that node that matches the verseRefOffset
, and a JSONPath string that indicates the
location of the of USJ node within this USJ data. Note that if the USJ node returned is an
object, it is the same object that is within this USJ data. So if you change it, you are
changing this USJ data.
Utilities for reading from and writing to
Usj
objects