Skip to content

erykjj/linkture-binary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

This is a single-binary executable to parse and process Bible scripture references.

The parser can work in Cebuano, Chinese, Danish, Dutch, English, Ewe, French, German, Greek, Haitian, Hungarian, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Tagalog, and Ukrainian. It will recognize such references and validate them to ensure the chapter(s) and/or verse(s) are within range.

It does not work with whole books (like "James") unless they are preceded by a number (like "1 John"); otherwise it would have to look up ever single word. Also, it will not find the multi-word book name "Song of Solomon" (and its variations), though this (and any other scripture) can be force-detected by tagging the desired reference "manually" within the source text (eg., "{{Song of Solomon 1:1}}") - one book per brace pair. These two limitations aside, it works with most book name variants in all the available languages (including common abbreviations): "2 Sam.", "2nd Samuel", "II Samuel", "2Sa", etc.

These found references can be extracted as a list of references, or a list of BCV-encoded ranges in the format bbcccvvv (where b is book, c is chapter, and v is verse). Or, they can be tagged (with '{{ }}' or other custom tags) within the text, or replaced with HTML hyperlink tags (with custom prefix and suffix). All of these functions can also include a rewrite of the reference with either a full book name, or one of two abbreviation formats, along with translation into one of the available languages.


Downloads

If you're looking for a Python module you can use in your own code, check out the parallel linkture project repo.


Usage

linkture on Linux/macOS; linkture.exe on Windows:

PARSE and PROCESS BIBLE SCRIPTURE REFERENCES:
  rewrite, translate, extract, tag, hyperlink, BCV-encode and decode, etc.

linkture [-h] [-v] [-q] [-f=in-file | -r=reference] [-o=out-file]
         [--language=LANG] [--translate=LANG] [-s=separator] [-u]
         [--full | --official | --standard] [--chapters]
         [-c | -d | -l | -t | -x]
         [-lp=PREFIX] [-ls=SUFFIX]
         [-ts=CHARS] [-te=CHARS]
         [-sc=BCV | -sv=BCV | -cv=verse | -cc=chapter | -bn=book]

options:
  -h, --help            show this help message and exit
  -v                    show version and exit
  -q                    don't show errors (quiet)
  -o=out-file           output file (terminal output if not provided)
  --language=LANG       source language for book names (English if unspecified)
  --translate=LANG      output language (same as source if unspecified)
  -s=separator          segment separator (space by default)
  -u                    capitalize (upper-case) book names
  --full                output as full name (eg., "Genesis") - default
  --official            output as official abbreviation (eg., "Ge")
  --standard            output as standard abbreviation (eg., "Gen.")
  --chapters            encode multi-chapter ranges into separate chapters (with -c)

data source (one required):
  -f=in-file            get input from file (UTF-8 TEXT or DOCX)
  -r=reference          process "reference; reference; etc."

type of conversion (default: rewrite):
  -c                    encode as BCV-notation ranges
  -d                    decode list of BCV-notation ranges
  -l                    create HTML links
    -lp, --link-prefix  prefix for links (default: '<a href=')
    -ls, --link-suffix  suffix for links (default: '>')
  -t                    tag scriptures with {{ }}
    -ts, --tag-start    start tag character(s) (default: "{{")
    -te, --tag-end      end tag character(s) (default: "}}")
  -x                    extract list of scripture references

auxiliary functions (no input source needed):
  -sc=BCV               serial chapter number for BCV code (bbcccvvv)
  -sv=BCV               serial verse number for BCV code (bbcccvvv)
  -cv=verse             BCV code for serial verse number (1-31194)
  -cc=chapter           BCV range for serial chapter number (1-1189)
  -bn=book              name of book number (1-66)

available source and translation languages:
Cebuano, Chinese, Danish, Dutch, English, Ewe, French, German, Greek, Haitian, Hungarian, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Tagalog, Ukrainian


EXAMPLES:

  basic scripture rewriting:

    linkture -r="Joh 17:17; 2Ti 3:16, 17" --full -u
    > JOHN 17:17; 2 TIMOTHY 3:16, 17

    linkture -r="Joh 17:17; 2Ti 3:16, 17" --standard
    > John 17:17; 2 Tim. 3:16, 17

    linkture -r="Joh 17:17; 2Ti 3:16, 17" --official
    > Joh 17:17; 2Ti 3:16, 17

    linkture -r="2Ti 3:16, 17" --full -s="_"
    > 2_Timothy_3:16,_17


  rewriting with translation:

    linkture -r="Joh 17:17; 2Ti 3:16, 17" --translate="Chinese"
    > 约翰福音 17:17; 提摩太后书 3:16, 17

    linkture -r="约翰福音 17:17; 提摩太后书 3:16, 17" --language="Chinese" --translate="Dutch"
    > Johannes 17:17; 2 Timotheüs 3:16, 17

    linkture -r="2 Timothée 3:16, 17" --language="French" --translate="Spanish" --standard
    > 2 Tim. 3:16, 17


  extract scriptures:

    linkture -r="Mat 17:17; Paul 3:16, 17" --full -x
    > ["Matthew 17:17"]


  tag scriptures:

    linkture -r="Joh 17:17; 2Ti 3:16, 17" -t
    > {{John 17:17}}; {{2 Timothy 3:16, 17}}

    linkture -r="Joh 17:17; 2Ti 3:16, 17" -t -ts=%% -te=@@
    > %%John 17:17@@; %%2 Timothy 3:16, 17@@

  HTML links:

    linkture -r="2Ti 3:16" -l -lp='<a href="https://my.website.com/' -ls='/index.html" class="test">'
    > <a href="https://my.website.com/55:3:16/index.html" class="test">2 Timothy 3:16</a>


  BCV encoding:

    linkture -r="Pr 2:1-5; 3-5" -c
    > [["20002001","20002005"],["20003001","20005023"]]


    linkture -r="Pr 2:1-5; 3-5" -c --chapters
    > [["20002001","20002005"],["20003001","20003035"],["20004001","20004027"],["20005001","20005023"]]


  BCV decoding:

    linkture -r='[["43017017","43017017"],["55003016","55003017"]]' -d --translate="German"
    > ["Johannes 17:17","2. Timotheus 3:16, 17"]


  auxiliary functions:

    linkture -cc=2
    > ["01002001","01002025"]

    linkture -cv=31194
    > ["66022021","66022021"]

    linkture -sv="01001001"
    > 1

    linkture -sc="66022001"
    > 1189

    linkture -bn=3 --official
    > ["Le"]

    linkture -bn=3 --translate="German"
    > ["3. Mose"]

Of course, you can pass a whole text file to parse and process using the -f=in-file flag, instead of -r="references". And you can output to another text file (instead of the terminal) using -o=out-file.

Unless you use -q, you will see in the terminal any out-of-range errors encountered while parsing. Of course, these entries will not be processed, but they will not affect the rest of the operation.


Static Badge

Feel free to get in touch and post any issues and suggestions.

About

PARSE and PROCESS BIBLE SCRIPTURE REFERENCES: rewrite, translate, extract, tag, hyperlink, BCV-encode and decode, etc.

Topics

Resources

License

Stars

Watchers

Forks

Contributors