tsv-quote-converters
v1.1.18
Published
A Node.js package for converting quotes between original biblical languages (Greek/Hebrew) and Gateway Languages in TSV files.
Maintainers
Keywords
Readme
TSV Quote Converters package (tsv-quote-converters)
A Node.js package for converting quotes between original biblical languages (Greek/Hebrew) and Gateway Languages in TSV files.
Demo Styleguide
Interactive Documentation on Netlify
Installation
npm install tsv-quote-convertersFeatures
- Convert original language quotes to Gateway Language quotes (
addGLQuoteCols) - Convert Gateway Language quotes back to original language quotes (
convertGLQuotes2OLQuotes) - Handles complex quote alignments and multiple occurrences
- Supports multiple target Gateway Language Bibles
- Maintains TSV format integrity
Usage
Adding Gateway Language Quote Columns
Convert original language quotes to Gateway Language quotes by adding new columns:
import { addGLQuoteCols } from 'tsv-quote-converters';
const params = {
// Required parameters
bibleLinks: ['unfoldingWord/en_ult/master'], // Array of Bible repos to use
bookCode: 'eph', // Bible book code (e.g., 'eph', 'gen')
tsvContent: yourTsvString, // TSV content with 'Quote' column
// Optional parameters
trySeparatorsAndOccurrences: true, // Try different quote separators
quiet: false, // Show console output
usePreviousGLQuotes: true, // Skip if GLQuote/GLOccurrence already exist
};
const result = await addGLQuoteCols(params);
console.log(result.output); // Modified TSV with new GLQuote/GLOccurrence columns
console.log(result.errors); // Array of any errors encounteredConverting Gateway Language Quotes to Original Language
Convert Gateway Language quotes in the Quote column back to original language:
import { convertGLQuotes2OLQuotes } from 'tsv-quote-converters';
const params = {
// Required parameters
bibleLinks: ['unfoldingWord/en_ult/master'], // Bible used for current quotes
bookCode: 'eph', // Bible book code
tsvContent: yourTsvString, // TSV content with GL quotes
// Optional parameters
trySeparatorsAndOccurrences: true, // Try different quote separators
quiet: false, // Show console output
};
const result = await convertGLQuotes2OLQuotes(params);
console.log(result.output); // Modified TSV with original language quotes
console.log(result.errors); // Array of any errors encounteredInput TSV Format
Your input TSV must include these columns:
Reference- Chapter:verse referenceQuote- The quote to convertOccurrence- Occurrence number of the quote
Example input:
Reference ID Tags SupportReference Quote Occurrence Note
1:1 abc1 Παῦλος 1 Note text hereOutput Format
addGLQuoteCols
Adds two columns per target Bible:
GLQuote- The converted Gateway Language quoteGLOccurrence- The occurrence number in the Gateway Language
convertGLQuotes2OLQuotes
Updates existing columns:
Quote- Replaced with original language quoteOccurrence- Updated to match original language occurrence
Error Handling
Both functions return an object with:
output- The modified TSV content (string)errors- Array of error messages for any failed conversions
Live Demo
Try it out in our interactive documentation
Contributing
Visit our GitHub repository to contribute.
License
ISC
See: LICENSE.md
