It's good at matching, manipulating and DB querying for complex biblical references, and at manipulating Unicode Greek text.
https://github.com/eukras/koinos
This is MIT licensed, so feel free to fork and mod. There is a large Unit Test suite, so you'll know immediately if you've broken anything.
INTRO
Libraries are defined in CSV files (Resources/libraries/nt/books.csv, and easy to add more):
Code: Select all
107,NT,1 Corinthians,1 Cor,1cor,2,1co,16
Code: Select all
use Koinos\Bundle\KoinosBundle\Service\ReferenceManager;
$rm = new ReferenceManager($libraries=['nt', 'lxx']);
$ref1 = $rm->createReferenceFromQuery('1 Cor 16:1-5,8,10-12,13-14');
echo $rm->getTitle($ref1); // 1 Corinthians 16:1-5,8,10-14 -- note merged ranges
Internally, references are arrays of ranges [start, finish], each value being a quadruple of [bookId, sectionNum, chapterNum, verseNum]. These map to INT(12)s for efficient SQL querying:
Code: Select all
echo $ref1->getSqlClause($columnName='reference');
// (reference BETWEEN 107001016001 AND 107001016005) OR
// (reference BETWEEN 107001016008 AND 107001016008) OR
// (reference BETWEEN 107001016010 AND 107001016014)
Code: Select all
use Koinos\Bundle\KoinosBundle\Utility\Greek;
$g = new Greek;
echo $g->romanize('Ῥύγχος'); // Rhunchos
echo $g->romanize('Ἡσυχάζω'); // Hēsuchazō
echo $g->romanize('Αὑτοῖσι'); // Hautoisi
Plenty more info in the README.md, code doc and Test suites...