Skip to content

eddy-lau/usfm-bible-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usfm-bible-parser

Instantiate the parser

var Parser = require('usfm-bible-parser');

var inputDir = '/path/of/the/usfm/files';
var lang = 'zh-hant';
var parser = Parser(inputDir, lang);

Methods

  • getBooks() - returns a list of Book objects.
  • getBook(bookShortName) - return a book with the short name.

Book Object

Properties:

  • index
  • id
  • name
  • localizedName
  • localizedAltNames
  • localizedAbbreviation
  • description
  • shortName
  • fileName
  • filePath
  • localizedData

Methods:

  • getTexts([fromLineNumber, toLineNumber]) - Deprecated Returns the text of the book.
  • getTexts(options) - Returns the text of the book with Get Texts Options.
  • parse(options) - Parse the book with the Parse Options object.
  • getChapterCount()

Get Texts Options

// Case 1: Look up by line number
{
  fromLine:number,
  toLine:number,
}

// Case 2: Look up by chapter and verse
{
  fromChapter:number,
  fromVerse:number,
  toChapter:number,
  toVerse:number  
}

Parse Options

{
  fromChapter, // optional
  fromVerse, // optional
  toChapter, // optional
  toVerse, // optional
  onStartBook:function(){}, // optional
  onEndBook:function(){},// optional
  onStartLine:function(text, [chapter, [verse]]){}, // optional
  onText:function(text){}, // optional
  onEndLine:function(text){}, // optional
  onStartMarker:function(marker){}, // optional
  onEndMarker:function(marker){} // optional  
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published