Skip to content

Script to prep blocks of English tex for conversion into .gabc files

License

Notifications You must be signed in to change notification settings

BallsyWalnuts/gabc-prepper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gabc-prepper

Script to prep blocks of English tex for conversion into .gabc files

Impetus

This script was created to make creation of .gabc files for the use by The Gregorio Project as simple as possible. For Gregorio to work, each syllable of the word needs to be pointed with the proper neum. However, manually splitting words into syllables is tedious in the extreme, so this script was created to take out much of that work.

How does it work?

It uses the hyphenate python library to implement an algorithm devised by Frank Liang to hyphenate words for TeX ages ago. It is not a perfect algorithm, but it gets close enough for government work.

Usage

Command Line

$ echo "some text to split on syllables" | python gabc_prep.py
some() text() to() split() on() syl()la()bles()

$ echo "some text to split on syllables
across multiple lines" | python .\gabc_prep.py
some() text() to() split() on() syl()la()bles()
across() mul()ti()ple() lines()

In Python Script

First, you will need to install the module:

pip install -e /path/to/repo

Then, it can be used in the following manner:

from gabc_prep import prep_text

print(prep_text(text_to_prep="some text to prepare"))

About

Script to prep blocks of English tex for conversion into .gabc files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages