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. Note you can use an empty string to find the closest text in or after
the start point.
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 SerializedVerseRef 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. Note that this query must yield a MarkerContent or Usj; JSONPaths yielding properties on nodes are not currently supported.
OptionalbookIdIfNotFound: string3-letter ID of the book this USJ document is in (only used if a book ID is not found in the USJ document)
SerializedVerseRef and offset that represent the location within this USJ data
indicated by jsonPathQuery
Convert a JSONPath query into a USJ node, JSONPath, 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. Note that this query must yield a MarkerContent or Usj; JSONPaths yielding properties on nodes are not currently supported.
USJ node, JSONPath, and offset that represent 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 location in the USFM representation of this data that corresponds to the location of a node somewhere within this USJ data
JSON object or string in the USJ data to get the USFM location for
OptionalnodeParent: Usj | MarkerObject | MarkerContent[]JSON object that owns the content array that includes node. Required if
node is a string; optional and unused if node is a MarkerObject or Usj
OptionalbookIdIfNotFound: string3-letter ID of the book this USJ document is in (only used if a book ID is not found in the USJ document)
SerializedVerseRef and offset representing the location of node, if one could be
found
Determine the location in the USJ document that corresponds to the location of a node somewhere within this USJ data
JSON object or string in the USJ data to get the USJ location for
OptionalnodeParent: Usj | MarkerObject | MarkerContent[]JSON object that owns the content array that includes node. Required if
node is a string; optional and unused if node is a MarkerObject or Usj
Node, JSONPath, and offset info 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
Search for matches of a regular expression within this USJ's text data
Regular expression to search for. Specify the global flag to find all matches.
Array of UsjSearchResult objects that match the given regular expression
Transforms the USJ document into USFM
Get the index in the USFM representation of this data relative to the start of the document that corresponds to the absolute verse location in USFM space passed in
The location in USFM space relative to a verse to get the index for
Index in the USFM representation of this data relative to the start of the document
Get the node + offset and JSONPath query within this USJ data of the first encountered string after the provided USFM location for a specific verse in a USJ document.
Note: this may return a node that is in a subsequent verse or even chapter depending on how much content the USJ data contains. It simply looks through the rest of the USJ data for the first text node and returns that.
Indicates the location in USFM space (book, chapter, verse, character offset) to find the next text for
Object containing the first USJ text node after verseRef, and a JSONPath string that
indicates the location of the USJ text node within this USJ data.
Convert a verse-based location in USFM space into a location in USJ space within this USJ data.
If the USJ document has no book markers in it to determine which book the USJ is in, the
verseRef.book will be ignored, and only the chapter and verse numbers will be used to
determine the location.
Location in USFM space - a book, chapter, verse, and character offset within the verse's USFM
Object containing the USJ location within the USJ document indicated by
usfmVerseLocation.
Convert a verse-based location in USFM space into a node and location in USJ space within this USJ data.
If the USJ document has no book markers in it to determine which book the USJ is in, the
verseRef.book will be ignored, and only the chapter and verse numbers will be used to
determine the location.
Location in USFM space - a book, chapter, verse, and character offset within the verse's USFM
Object containing the USJ node and location within the USJ document indicated by
usfmVerseLocation. 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.
Inform this UsjReaderWriter that the underlying USJ object changed. This is needed to clear caches used when querying.
Convert a location in USJ space within this USJ data into a location in USFM space.
Location in USJ space - a jsonPath and other information about where the location is
OptionalbookIdIfNotFound: string3-letter ID of the book this USJ document is in (only used if a book ID is not found in the USJ document)
Location in USFM space that is equivalent to the USJ location specified
Utilities for reading from and writing to
Usjobjects