Index: include/canon_nrsv.h =================================================================== --- include/canon_nrsv.h (revision 2571) +++ include/canon_nrsv.h (working copy) @@ -172,6 +172,12 @@ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21 }; +unsigned char mappings_nrsv[] = { + 0, + 66, 12, 18, 19, 13, 1, 0, + 66, 13, 1, 1, 13, 1, 0, + 0 +}; SWORD_NAMESPACE_END Index: include/canon_synodal.h =================================================================== --- include/canon_synodal.h (revision 2571) +++ include/canon_synodal.h (working copy) @@ -285,6 +285,198 @@ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21 }; +unsigned char mappings_synodal[] = { + 'P', 'r', 'A', 'z', 'a', 'r', 0, + 'S', 'u', 's', 0, + 'B', 'e', 'l', 0, + 0, + 3, 14, 55, 0, 14, 55, 56, + 4, 13, 1, 0, 12, 16, 0, + 4, 13, 2, 0, 13, 1, 0, + 4, 30, 1, 0, 29, 40, 0, + 4, 30, 2, 0, 30, 1, 0, + 6, 5, 16, 0, 6, 1, 0, + 6, 6, 1, 0, 6, 2, 0, + 9, 24, 1, 0, 23, 29, 0, + 9, 24, 2, 0, 24, 1, 0, + 22, 39, 31, 0, 40, 1, 0, + 22, 40, 1, 0, 40, 6, 0, + 22, 40, 20, 0, 41, 1, 0, + 22, 41, 1, 0, 41, 9, 0, + 23, 3, 1, 0, 3, 0, 0, + 23, 4, 1, 0, 4, 0, 0, + 23, 5, 1, 0, 5, 0, 0, + 23, 6, 1, 0, 6, 0, 0, + 23, 7, 1, 0, 7, 0, 0, + 23, 8, 1, 0, 8, 0, 0, + 23, 9, 1, 0, 9, 0, 0, + 23, 9, 22, 0, 10, 1, 0, + 23, 10, 1, 0, 11, 0, 1, + 23, 11, 1, 0, 12, 0, 0, + 23, 12, 1, 0, 13, 0, 0, + 23, 12, 6, 0, 13, 5, 6, + 23, 13, 1, 0, 14, 0, 1, + 23, 14, 1, 0, 15, 0, 1, + 23, 15, 1, 0, 16, 0, 1, + 23, 16, 1, 0, 17, 0, 1, + 23, 17, 1, 0, 18, 0, 0, + 23, 18, 1, 0, 19, 0, 0, + 23, 19, 1, 0, 20, 0, 0, + 23, 20, 1, 0, 21, 0, 0, + 23, 21, 1, 0, 22, 0, 0, + 23, 22, 1, 0, 23, 0, 1, + 23, 23, 1, 0, 24, 0, 1, + 23, 24, 1, 0, 25, 0, 1, + 23, 25, 1, 0, 26, 0, 1, + 23, 26, 1, 0, 27, 0, 1, + 23, 27, 1, 0, 28, 0, 1, + 23, 28, 1, 0, 29, 0, 1, + 23, 29, 1, 0, 30, 0, 0, + 23, 30, 1, 0, 31, 0, 0, + 23, 31, 1, 0, 32, 0, 1, + 23, 32, 1, 0, 33, 0, 1, + 23, 33, 1, 0, 34, 0, 0, + 23, 34, 1, 0, 35, 0, 1, + 23, 35, 1, 0, 36, 0, 0, + 23, 36, 1, 0, 37, 0, 1, + 23, 37, 1, 0, 38, 0, 0, + 23, 38, 1, 0, 39, 0, 0, + 23, 39, 1, 0, 40, 0, 0, + 23, 40, 1, 0, 41, 0, 0, + 23, 41, 1, 0, 42, 0, 0, + 23, 42, 0, 0, 43, 0, 0, + 23, 43, 1, 0, 44, 0, 0, + 23, 44, 1, 0, 45, 0, 0, + 23, 45, 1, 0, 46, 0, 0, + 23, 46, 1, 0, 47, 0, 0, + 23, 47, 1, 0, 48, 0, 0, + 23, 48, 1, 0, 49, 0, 0, + 23, 49, 0, 0, 50, 0, 0, + 23, 50, 1, 2, 51, 0, 0, + 23, 51, 1, 2, 52, 0, 0, + 23, 52, 1, 0, 53, 0, 0, + 23, 53, 1, 2, 54, 0, 0, + 23, 54, 1, 0, 55, 0, 0, + 23, 55, 1, 0, 56, 0, 0, + 23, 56, 1, 0, 57, 0, 0, + 23, 57, 1, 0, 58, 0, 0, + 23, 58, 1, 0, 59, 0, 0, + 23, 59, 1, 2, 60, 0, 0, + 23, 60, 1, 0, 61, 0, 0, + 23, 61, 1, 0, 62, 0, 0, + 23, 62, 1, 0, 63, 0, 0, + 23, 63, 1, 0, 64, 0, 0, + 23, 64, 1, 0, 65, 0, 0, + 23, 65, 1, 0, 66, 0, 1, + 23, 66, 1, 0, 67, 0, 0, + 23, 67, 1, 0, 68, 0, 0, + 23, 68, 1, 0, 69, 0, 0, + 23, 69, 1, 0, 70, 0, 0, + 23, 70, 0, 0, 71, 0, 0, + 23, 71, 0, 0, 72, 0, 0, + 23, 72, 0, 0, 73, 0, 0, + 23, 73, 0, 0, 74, 0, 0, + 23, 74, 1, 0, 75, 0, 0, + 23, 75, 1, 0, 76, 0, 0, + 23, 76, 1, 0, 77, 0, 0, + 23, 77, 0, 0, 78, 0, 0, + 23, 78, 0, 0, 79, 0, 0, + 23, 79, 1, 0, 80, 0, 0, + 23, 80, 1, 0, 81, 0, 0, + 23, 81, 0, 0, 82, 0, 0, + 23, 82, 1, 0, 83, 0, 0, + 23, 83, 1, 0, 84, 0, 0, + 23, 84, 1, 0, 85, 0, 0, + 23, 85, 0, 0, 86, 0, 0, + 23, 86, 1, 0, 87, 0, 0, + 23, 86, 2, 0, 87, 1, 2, + 23, 87, 1, 0, 88, 0, 0, + 23, 88, 1, 0, 89, 0, 0, + 23, 89, 1, 0, 90, 0, 0, + 23, 89, 6, 0, 90, 5, 6, + 23, 90, 0, 0, 91, 0, 0, + 23, 91, 1, 0, 92, 0, 0, + 23, 92, 0, 0, 93, 0, 0, + 23, 93, 0, 0, 94, 0, 0, + 23, 94, 0, 0, 95, 0, 0, + 23, 95, 0, 0, 96, 0, 0, + 23, 96, 0, 0, 97, 0, 0, + 23, 97, 0, 0, 98, 0, 0, + 23, 98, 0, 0, 99, 0, 0, + 23, 99, 0, 0, 100, 0, 0, + 23, 100, 0, 0, 101, 0, 0, + 23, 101, 1, 0, 102, 0, 0, + 23, 102, 0, 0, 103, 0, 0, + 23, 103, 0, 0, 104, 0, 0, + 23, 104, 0, 0, 105, 0, 0, + 23, 105, 0, 0, 106, 0, 0, + 23, 106, 0, 0, 107, 0, 0, + 23, 107, 1, 0, 108, 0, 0, + 23, 108, 0, 0, 109, 0, 0, + 23, 109, 0, 0, 110, 0, 0, + 23, 110, 0, 0, 111, 0, 0, + 23, 111, 0, 1, 112, 1, 0, + 23, 112, 0, 1, 113, 1, 0, + 23, 113, 0, 0, 114, 0, 0, + 23, 113, 9, 0, 115, 1, 0, + 23, 114, 0, 0, 116, 0, 0, + 23, 115, 1, 0, 116, 10, 0, + 23, 116, 0, 0, 117, 0, 0, + 23, 117, 0, 0, 118, 0, 0, + 23, 118, 0, 0, 119, 0, 0, + 23, 119, 0, 0, 120, 0, 0, + 23, 120, 0, 0, 121, 0, 0, + 23, 121, 0, 0, 122, 0, 0, + 23, 122, 0, 0, 123, 0, 0, + 23, 123, 0, 0, 124, 0, 0, + 23, 124, 0, 0, 125, 0, 0, + 23, 125, 0, 0, 126, 0, 0, + 23, 126, 0, 0, 127, 0, 0, + 23, 127, 0, 0, 128, 0, 0, + 23, 128, 0, 0, 129, 0, 0, + 23, 129, 0, 0, 130, 0, 0, + 23, 130, 0, 0, 131, 0, 0, + 23, 131, 0, 0, 132, 0, 0, + 23, 132, 0, 0, 133, 0, 0, + 23, 133, 0, 0, 134, 0, 0, + 23, 134, 0, 1, 135, 1, 0, + 23, 135, 0, 0, 136, 0, 0, + 23, 136, 0, 0, 137, 0, 0, + 23, 137, 0, 0, 138, 0, 0, + 23, 138, 0, 0, 139, 0, 0, + 23, 139, 1, 0, 140, 0, 0, + 23, 140, 0, 0, 141, 0, 0, + 23, 141, 0, 0, 142, 0, 0, + 23, 142, 0, 0, 143, 0, 0, + 23, 143, 0, 0, 144, 0, 0, + 23, 144, 0, 0, 145, 0, 0, + 23, 145, 0, 1, 146, 1, 0, + 23, 146, 0, 1, 147, 1, 0, + 23, 147, 1, 0, 147, 12, 0, + 23, 148, 0, 1, 148, 1, 0, + 23, 149, 0, 1, 149, 1, 0, + 23, 150, 0, 1, 150, 1, 0, + 25, 4, 17, 0, 5, 1, 0, + 25, 5, 1, 0, 5, 2, 0, + 26, 1, 0, 0, 1, 1, 0, + 26, 7, 1, 0, 6, 13, 0, + 26, 7, 2, 0, 7, 1, 0, + 79, 3, 24, 0, 1, 1, 0, 35, + 35, 3, 91, 0, 3, 24, 0, + 35, 3, 98, 0, 4, 1, 0, + 35, 4, 1, 0, 4, 4, 0, + 80, 13, 1, 0, 1, 1, 0, 35, + 81, 14, 1, 0, 1, 1, 0, 35, + 36, 14, 1, 0, 13, 16, 0, + 36, 14, 2, 0, 14, 1, 0, + 40, 2, 1, 0, 1, 17, 0, + 40, 2, 2, 0, 2, 1, 0, + 56, 19, 40, 0, 19, 40, 41, + 64, 14, 24, 0, 16, 25, 0, + 66, 13, 12, 0, 13, 12, 13, + 62, 1, 14, 15, 1, 14, 0, + 0 +}; SWORD_NAMESPACE_END Index: include/canon_vulg.h =================================================================== --- include/canon_vulg.h (revision 2571) +++ include/canon_vulg.h (working copy) @@ -282,6 +282,287 @@ 20 }; +unsigned char mappings_vulg[] = { + 'E', 'p', 'J', 'e', 'r', 0, + 'P', 'r', 'A', 'z', 'a', 'r', 0, + 'S', 'u', 's', 0, + 'B', 'e', 'l', 0, + 0, + 1, 49, 31, 0, 49, 31, 32, + 1, 50, 22, 0, 50, 22, 23, + 2, 40, 13, 0, 40, 13, 15, + 3, 26, 45, 0, 26, 45, 46, + 4, 11, 34, 0, 11, 34, 35, + 4, 13, 1, 0, 12, 16, 0, + 4, 13, 2, 0, 13, 1, 0, + 4, 20, 29, 0, 20, 28, 0, + 4, 26, 1, 0, 25, 19, 0, + 4, 26, 1, 0, 26, 1, 0, + 6, 4, 24, 0, 4, 23, 0, + 6, 5, 15, 0, 5, 14, 0, + 6, 21, 36, 0, 21, 36, 37, + 6, 21, 37, 0, 21, 38, 39, + 7, 5, 32, 0, 5, 31, 0, + 7, 21, 24, 0, 21, 24, 25, + 9, 20, 41, 0, 20, 42, 0, + 9, 20, 43, 0, 21, 1, 0, + 9, 24, 1, 0, 23, 28, 29, + 9, 24, 2, 0, 24, 1, 0, + 13, 11, 46, 0, 11, 46, 47, + 13, 20, 7, 0, 20, 7, 8, + 16, 3, 30, 0, 3, 30, 31, + 16, 12, 33, 0, 12, 33, 34, + 20, 16, 5, 0, 16, 4, 0, + 20, 39, 31, 0, 40, 1, 0, + 20, 40, 1, 0, 40, 6, 0, + 20, 40, 20, 0, 41, 1, 0, + 20, 41, 1, 0, 41, 10, 0, + 20, 42, 16, 0, 42, 16, 17, + 21, 2, 13, 0, 2, 12, 0, + 21, 3, 2, 0, 3, 1, 0, + 21, 4, 2, 0, 4, 1, 0, + 21, 4, 9, 10, 4, 8, 0, + 21, 5, 2, 0, 5, 1, 0, + 21, 6, 2, 0, 6, 1, 0, + 21, 7, 2, 0, 7, 1, 0, + 21, 8, 2, 0, 8, 1, 0, + 21, 9, 2, 0, 9, 1, 0, + 21, 9, 22, 0, 10, 1, 0, + 21, 10, 1, 2, 11, 1, 0, + 21, 11, 0, 0, 12, 0, 0, + 21, 12, 1, 0, 13, 1, 0, + 21, 12, 2, 3, 13, 2, 0, + 21, 13, 0, 0, 14, 0, 0, + 21, 14, 1, 0, 15, 1, 0, + 21, 15, 0, 0, 16, 0, 0, + 21, 15, 10, 0, 16, 10, 11, + 21, 16, 0, 0, 17, 0, 0, + 21, 17, 1, 2, 18, 1, 0, + 21, 18, 1, 2, 19, 1, 0, + 21, 19, 1, 2, 20, 1, 0, + 21, 20, 1, 2, 21, 1, 0, + 21, 21, 1, 2, 22, 1, 0, + 21, 22, 0, 0, 23, 0, 0, + 21, 23, 0, 0, 24, 0, 0, + 21, 24, 0, 0, 25, 0, 0, + 21, 25, 0, 0, 26, 0, 0, + 21, 26, 0, 0, 27, 0, 0, + 21, 27, 0, 0, 28, 0, 0, + 21, 28, 0, 0, 29, 0, 0, + 21, 29, 1, 2, 30, 1, 0, + 21, 30, 1, 2, 31, 1, 0, + 21, 31, 0, 0, 32, 0, 0, + 21, 32, 0, 0, 33, 0, 0, + 21, 33, 1, 2, 34, 1, 0, + 21, 34, 0, 0, 35, 0, 0, + 21, 35, 1, 2, 36, 1, 0, + 21, 36, 0, 0, 37, 0, 0, + 21, 37, 1, 2, 38, 1, 0, + 21, 38, 1, 2, 39, 1, 0, + 21, 39, 1, 2, 40, 1, 0, + 21, 40, 1, 2, 41, 1, 0, + 21, 41, 1, 2, 42, 1, 0, + 21, 42, 0, 0, 43, 0, 0, + 21, 43, 1, 2, 44, 1, 0, + 21, 43, 22, 0, 44, 21, 22, + 21, 44, 1, 2, 45, 1, 0, + 21, 45, 1, 2, 46, 1, 0, + 21, 46, 1, 2, 47, 1, 0, + 21, 47, 1, 2, 48, 1, 0, + 21, 48, 1, 2, 49, 1, 0, + 21, 49, 0, 0, 50, 0, 0, + 21, 50, 1, 3, 51, 1, 0, + 21, 51, 1, 3, 52, 1, 0, + 21, 52, 1, 2, 53, 1, 0, + 21, 53, 1, 3, 54, 1, 0, + 21, 54, 1, 2, 55, 1, 0, + 21, 55, 1, 2, 56, 1, 0, + 21, 55, 11, 0, 56, 10, 11, + 21, 56, 1, 2, 57, 1, 0, + 21, 57, 1, 2, 58, 1, 0, + 21, 58, 1, 2, 59, 1, 0, + 21, 59, 1, 3, 60, 1, 0, + 21, 60, 1, 2, 61, 1, 0, + 21, 61, 1, 2, 62, 1, 0, + 21, 62, 1, 2, 63, 1, 0, + 21, 63, 1, 2, 64, 1, 0, + 21, 64, 1, 2, 65, 1, 0, + 21, 65, 0, 0, 66, 0, 0, + 21, 66, 1, 2, 67, 1, 0, + 21, 67, 1, 2, 68, 1, 0, + 21, 68, 1, 2, 69, 1, 0, + 21, 69, 1, 2, 70, 1, 0, + 21, 70, 0, 0, 71, 0, 0, + 21, 71, 0, 0, 72, 0, 0, + 21, 72, 0, 0, 73, 0, 0, + 21, 73, 0, 0, 74, 0, 0, + 21, 74, 1, 2, 75, 1, 0, + 21, 75, 1, 2, 76, 1, 0, + 21, 76, 1, 2, 77, 1, 0, + 21, 77, 0, 0, 78, 0, 0, + 21, 78, 0, 0, 79, 0, 0, + 21, 79, 1, 2, 80, 1, 0, + 21, 80, 1, 2, 81, 1, 0, + 21, 81, 0, 0, 82, 0, 0, + 21, 82, 1, 2, 83, 1, 0, + 21, 83, 1, 2, 84, 1, 0, + 21, 84, 1, 2, 85, 1, 0, + 21, 85, 0, 0, 86, 0, 0, + 21, 86, 0, 0, 87, 0, 0, + 21, 87, 1, 2, 88, 1, 0, + 21, 88, 1, 2, 89, 1, 0, + 21, 89, 0, 0, 90, 0, 0, + 21, 90, 0, 0, 91, 0, 0, + 21, 91, 1, 2, 92, 1, 0, + 21, 92, 0, 0, 93, 0, 0, + 21, 93, 0, 0, 94, 0, 0, + 21, 94, 0, 0, 95, 0, 0, + 21, 95, 0, 0, 96, 0, 0, + 21, 96, 0, 0, 97, 0, 0, + 21, 97, 0, 0, 98, 0, 0, + 21, 98, 0, 0, 99, 0, 0, + 21, 99, 0, 0, 100, 0, 0, + 21, 100, 0, 0, 101, 0, 0, + 21, 101, 1, 2, 102, 1, 0, + 21, 102, 0, 0, 103, 0, 0, + 21, 103, 0, 0, 104, 0, 0, + 21, 104, 0, 0, 105, 0, 0, + 21, 105, 0, 0, 106, 0, 0, + 21, 106, 0, 0, 107, 0, 0, + 21, 107, 1, 2, 108, 1, 0, + 21, 108, 0, 0, 109, 0, 0, + 21, 109, 0, 0, 110, 0, 0, + 21, 110, 0, 0, 111, 0, 0, + 21, 111, 0, 0, 112, 0, 0, + 21, 112, 0, 0, 113, 0, 0, + 21, 113, 0, 0, 114, 0, 0, + 21, 113, 9, 0, 115, 1, 0, + 21, 114, 0, 0, 116, 0, 0, + 21, 115, 1, 0, 116, 10, 0, + 21, 116, 0, 0, 117, 0, 0, + 21, 117, 0, 0, 118, 0, 0, + 21, 118, 0, 0, 119, 0, 0, + 21, 119, 0, 0, 120, 0, 0, + 21, 120, 0, 0, 121, 0, 0, + 21, 121, 0, 0, 122, 0, 0, + 21, 122, 0, 0, 123, 0, 0, + 21, 123, 0, 0, 124, 0, 0, + 21, 124, 0, 0, 125, 0, 0, + 21, 125, 0, 0, 126, 0, 0, + 21, 126, 0, 0, 127, 0, 0, + 21, 127, 0, 0, 128, 0, 0, + 21, 128, 0, 0, 129, 0, 0, + 21, 129, 0, 0, 130, 0, 0, + 21, 130, 0, 0, 131, 0, 0, + 21, 131, 0, 0, 132, 0, 0, + 21, 132, 0, 0, 133, 0, 0, + 21, 133, 0, 0, 134, 0, 0, + 21, 134, 0, 0, 135, 0, 0, + 21, 135, 0, 0, 136, 0, 0, + 21, 136, 0, 0, 137, 0, 0, + 21, 137, 0, 0, 138, 0, 0, + 21, 138, 0, 0, 139, 0, 0, + 21, 139, 1, 2, 140, 1, 0, + 21, 140, 0, 0, 141, 0, 0, + 21, 141, 1, 2, 142, 1, 0, + 21, 142, 0, 0, 143, 0, 0, + 21, 143, 0, 0, 144, 0, 0, + 21, 144, 0, 0, 145, 0, 0, + 21, 145, 1, 0, 146, 0, 0, + 21, 145, 2, 0, 146, 1, 2, + 21, 146, 0, 0, 147, 0, 0, + 21, 147, 1, 0, 147, 12, 0, + 23, 4, 17, 0, 5, 1, 0, + 23, 5, 1, 0, 5, 2, 0, + 23, 7, 1, 0, 6, 12, 0, + 23, 7, 2, 0, 7, 1, 0, + 24, 1, 1, 0, 1, 1, 2, + 24, 5, 17, 0, 6, 1, 0, + 24, 6, 1, 0, 6, 2, 0, + 25, 2, 25, 0, 2, 24, 0, + 25, 5, 14, 0, 5, 13, 0, + 25, 6, 2, 0, 6, 1, 0, + 25, 6, 22, 23, 6, 21, 0, + 25, 9, 19, 0, 9, 18, 0, + 25, 11, 6, 0, 11, 5, 0, + 25, 19, 12, 0, 19, 12, 13, + 27, 8, 22, 0, 8, 22, 23, + 28, 37, 4, 0, 37, 4, 5, + 79, 6, 1, 0, 6, 1, 0, 30, + 31, 2, 9, 0, 2, 9, 10, + 80, 3, 24, 0, 1, 1, 0, 32, + 32, 3, 91, 0, 3, 24, 0, + 32, 3, 98, 0, 4, 1, 0, + 32, 4, 1, 0, 4, 4, 0, + 81, 13, 1, 0, 1, 1, 0, 32, + 81, 13, 64, 65, 1, 64, 0, 32, + 82, 14, 1, 0, 1, 1, 0, 32, + 82, 14, 41, 42, 1, 41, 0, 32, + 33, 14, 1, 0, 13, 16, 0, + 33, 14, 2, 0, 14, 1, 0, + 35, 6, 11, 0, 6, 10, 0, + 42, 2, 1, 0, 1, 15, 0, + 42, 2, 2, 0, 2, 1, 0, + 45, 1, 5, 0, 1, 4, 0, + 45, 1, 31, 32, 1, 30, 0, + 45, 1, 36, 0, 1, 34, 35, + 45, 1, 37, 0, 1, 35, 0, + 45, 1, 47, 48, 1, 45, 0, + 45, 12, 54, 0, 12, 53, 0, + 45, 13, 53, 0, 13, 52, 0, + 46, 2, 19, 0, 2, 18, 0, + 46, 12, 46, 0, 12, 45, 0, + 46, 15, 37, 0, 15, 36, 0, + 47, 17, 15, 0, 17, 16, 0, + 48, 4, 40, 0, 4, 40, 41, + 48, 8, 39, 0, 9, 1, 0, + 48, 9, 1, 0, 9, 2, 0, + 50, 6, 52, 0, 6, 51, 0, + 51, 7, 55, 0, 7, 55, 56, + 51, 14, 6, 0, 14, 6, 7, + 51, 19, 40, 0, 19, 40, 41, + 73, 12, 18, 19, 13, 1, 0, + 73, 13, 1, 0, 13, 1, 0, + 75, 1, 4, 0, 1, 3, 4, + 75, 1, 10, 0, 1, 10, 11, + 75, 1, 11, 0, 1, 12, 13, + 75, 1, 12, 0, 1, 13, 0, + 75, 1, 16, 0, 1, 15, 0, + 75, 1, 17, 18, 1, 16, 0, + 75, 1, 51, 52, 1, 49, 0, + 75, 2, 2, 0, 2, 1, 0, + 75, 2, 3, 4, 2, 2, 0, + 75, 2, 6, 7, 2, 4, 0, + 75, 2, 11, 12, 2, 8, 0, + 75, 2, 13, 0, 2, 9, 10, + 75, 2, 14, 15, 2, 11, 0, + 75, 2, 20, 21, 2, 16, 0, + 75, 2, 22, 23, 2, 17, 0, + 75, 2, 26, 0, 2, 20, 21, + 75, 2, 30, 0, 2, 25, 26, + 75, 3, 15, 0, 3, 14, 0, + 75, 3, 17, 0, 3, 16, 17, + 75, 4, 10, 0, 4, 10, 11, + 75, 4, 40, 0, 4, 39, 40, + 75, 5, 42, 0, 5, 41, 0, + 75, 5, 54, 55, 5, 53, 0, + 75, 5, 58, 0, 5, 56, 57, + 75, 5, 59, 60, 5, 57, 0, + 75, 5, 73, 0, 5, 70, 71, + 75, 6, 9, 0, 6, 8, 0, + 75, 8, 6, 0, 8, 5, 0, + 75, 8, 20, 0, 8, 19, 20, + 75, 8, 44, 0, 8, 43, 0, + 75, 8, 50, 0, 8, 49, 50, + 75, 8, 57, 0, 8, 56, 0, + 75, 8, 63, 64, 8, 62, 0, + 75, 8, 65, 66, 8, 63, 0, + 75, 8, 86, 0, 8, 83, 84, + 75, 8, 87, 0, 8, 84, 0, + 75, 8, 93, 94, 8, 90, 0, + 0 +}; + SWORD_NAMESPACE_END #endif Index: include/versemgr.h =================================================================== --- include/versemgr.h (revision 2571) +++ include/versemgr.h (working copy) @@ -141,11 +141,12 @@ int getBookNumberByOSISName(const char *bookName) const; const Book *getBook(int number) const; int getBookCount() const; - void loadFromSBook(const sbook *ot, const sbook *nt, int *chMax); + void loadFromSBook(const sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings=NULL); long getOffsetFromVerse(int book, int chapter, int verse) const; char getVerseFromOffset(long offset, int *book, int *chapter, int *verse) const; const int *getBMAX() const { return BMAX; }; long getNTStartOffset() const { return ntStartOffset; } + void translateVerse(const System *dstSys, const char **book, int *chapter, int *verse, int *verse_end) const; }; VerseMgr() { init(); } ~VerseMgr(); @@ -153,7 +154,7 @@ static void setSystemVerseMgr(VerseMgr *newVerseMgr); const StringList getVersificationSystems() const; const System *getVersificationSystem(const char *name) const; - void registerVersificationSystem(const char *name, const sbook *ot, const sbook *nt, int *chMax); + void registerVersificationSystem(const char *name, const sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings=NULL); void registerVersificationSystem(const char *name, const TreeKey *); }; Index: src/keys/versekey.cpp =================================================================== --- src/keys/versekey.cpp (revision 2571) +++ src/keys/versekey.cpp (working copy) @@ -119,26 +119,67 @@ */ void VerseKey::setFromOther(const VerseKey &ikey) { - if (refSys == ikey.refSys) { - testament = ikey.Testament(); - book = ikey.Book(); - chapter = ikey.Chapter(); - verse = ikey.Verse(); - suffix = ikey.getSuffix(); + if (refSys == ikey.refSys) { + testament = ikey.getTestament(); + book = ikey.getBook(); + chapter = ikey.getChapter(); + verse = ikey.getVerse(); + suffix = ikey.getSuffix(); + } + else { + // map verse between systems + const char* map_book = ikey.getOSISBookName(); + int map_chapter = ikey.getChapter(); + int map_verse = ikey.getVerse(); + int map_range = map_verse; + + ikey.refSys->translateVerse(refSys, &map_book, &map_chapter, &map_verse, &map_range); + //printf("verse: %s.%i.%i-%i\n",map_book,map_chapter,map_verse,map_range); + + book = refSys->getBookNumberByOSISName(map_book); + + // check existence + if (book == -1) { + book = 1; + error = KEYERR_OUTOFBOUNDS; } - // Here is where we will do v11n system conversions in the future - // when we have a conversion mechanism (Ben Morgan has started - // thinking about this) - else { - // For now, this is the best we can do - setText(ikey.getText()); + else if (refSys->getBook(book-1)->getChapterMax() < map_chapter) { + map_chapter = refSys->getBook(book-1)->getChapterMax(); + map_verse = refSys->getBook(book-1)->getVerseMax(map_chapter); + error = KEYERR_OUTOFBOUNDS; } + else if (map_chapter > 0 && refSys->getBook(book-1)->getVerseMax(map_chapter) < map_verse) { + map_verse = refSys->getBook(book-1)->getVerseMax(map_chapter); + error = KEYERR_OUTOFBOUNDS; + } + + // set values + if (book > BMAX[0]) + book -= BMAX[0], testament = 2; + else + testament = 1; + + //if (map_verse == 0) Headings(1); + + chapter = map_chapter; + verse = map_verse; + suffix = ikey.getSuffix(); + + if (map_verse < map_range) { + if (map_range > refSys->getBook(((testament>1)?BMAX[0]:0)+book-1)->getVerseMax(chapter)) + ++map_range; + verse = map_range; + UpperBound(this); + verse = map_verse; + LowerBound(this); + } + } } void VerseKey::positionFrom(const SWKey &ikey) { - error = 0; - const SWKey *fromKey = &ikey; + error = 0; + const SWKey *fromKey = &ikey; ListKey *tryList = SWDYNAMIC_CAST(ListKey, fromKey); if (tryList) { SWKey *k = tryList->getElement(); Index: src/mgr/versemgr.cpp =================================================================== --- src/mgr/versemgr.cpp (revision 2571) +++ src/mgr/versemgr.cpp (working copy) @@ -58,10 +58,10 @@ systemVerseMgr->registerVersificationSystem("Leningrad", otbooks_leningrad, ntbooks_null, vm_leningrad); systemVerseMgr->registerVersificationSystem("MT", otbooks_mt, ntbooks_null, vm_mt); systemVerseMgr->registerVersificationSystem("KJVA", otbooks_kjva, ntbooks, vm_kjva); - systemVerseMgr->registerVersificationSystem("NRSV", otbooks, ntbooks, vm_nrsv); + systemVerseMgr->registerVersificationSystem("NRSV", otbooks, ntbooks, vm_nrsv, mappings_nrsv); systemVerseMgr->registerVersificationSystem("NRSVA", otbooks_nrsva, ntbooks, vm_nrsva); - systemVerseMgr->registerVersificationSystem("Synodal", otbooks_synodal, ntbooks_synodal, vm_synodal); - systemVerseMgr->registerVersificationSystem("Vulg", otbooks_vulg, ntbooks_vulg, vm_vulg); + systemVerseMgr->registerVersificationSystem("Synodal", otbooks_synodal, ntbooks_synodal, vm_synodal, mappings_synodal); + systemVerseMgr->registerVersificationSystem("Vulg", otbooks_vulg, ntbooks_vulg, vm_vulg, mappings_vulg); systemVerseMgr->registerVersificationSystem("German", otbooks_german, ntbooks, vm_german); systemVerseMgr->registerVersificationSystem("Luther", otbooks_luther, ntbooks_luther, vm_luther); systemVerseMgr->registerVersificationSystem("Catholic", otbooks_catholic, ntbooks, vm_catholic); @@ -77,6 +77,18 @@ /** Array[chapmax] of maximum verses in chapters */ vector books; map osisLookup; + /** General mapping rule is that first verse of every chapter corresponds first + verse of another chapter in default intermediate canon(kjva), so mapping data + contains expections. Intermediate canon could not contain corresponding data. + + pointers on uchar[7]: 1 value - book id 1-based, ot+nt, 2-4 map to, 5-7 map + from (chap,verse from, verse to if greater then "verse from") + + TODO what if book name in one v11n differs from cannon + special section in mapping for book transformation + */ + vector> mappings; + vector mappingsExtraBooks; Private() { } @@ -168,7 +180,7 @@ } -void VerseMgr::System::loadFromSBook(const sbook *ot, const sbook *nt, int *chMax) { +void VerseMgr::System::loadFromSBook(const sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings) { int chap = 0; int book = 0; long offset = 0; // module heading @@ -208,6 +220,23 @@ BMAX[1] = book; // TODO: build offset speed array + + // parse mappings + if (mappings != NULL) { + const unsigned char *m=mappings; + for (; *m != 0; m += strlen((const char*)m)+1) { + p->mappingsExtraBooks.push_back((const char*)m); + } + p->mappings.resize(p->books.size()+p->mappingsExtraBooks.size()); + + for (++m; *m != 0; m += 7) { + p->mappings[m[0]-1].push_back(m); + if (*m > p->books.size()) { + p->mappings[m[7]-1].push_back(m); + m += 1; + } + } + } } @@ -360,10 +389,10 @@ } -void VerseMgr::registerVersificationSystem(const char *name, const sbook *ot, const sbook *nt, int *chMax) { +void VerseMgr::registerVersificationSystem(const char *name, const sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings) { p->systems[name] = name; System &s = p->systems[name]; - s.loadFromSBook(ot, nt, chMax); + s.loadFromSBook(ot, nt, chMax, mappings); } @@ -379,5 +408,122 @@ return retVal; } +void VerseMgr::System::translateVerse(const System *dstSys, const char **book, int *chapter, int *verse, int *verse_end) const { + //printf("translate verse from %s to %s: %s.%i.%i-%i\n",getName(), dstSys->getName(), *book, *chapter, *verse, *verse_end); + if (!strcmp(getName(),"KJVA") || !strcmp(getName(),"KJV")) { + if (!strcmp(dstSys->getName(),"KJVA") || !strcmp(dstSys->getName(),"KJV")) + return; + // reversed mapping + //printf("Perform reversed mapping.\n"); + int b = dstSys->getBookNumberByOSISName(*book)-1; + if (b < 0) { + for (int i=0; i<(int)p->mappingsExtraBooks.size(); ++i) { + if (!strcmp(*book, p->mappingsExtraBooks[i])) { + b = p->books.size()+i; + break; + } + } + } + if (b >= (int)dstSys->p->mappings.size() || b < 0) + return; + + const unsigned char *a = NULL; + + // reversed mapping should use forward search for item + for (unsigned int i=0; ip->mappings[b].size(); ++i) { + const unsigned char *m = dstSys->p->mappings[b][i]; + if (m[4] == *chapter && m[5] <= *verse) { + //printf("found mapping %i %i %i %i %i %i\n",m[1],m[2],m[3],m[4],m[5],m[6]); + if (m[5] == *verse || (m[6] >= *verse && m[5] <= *verse)) { + // inside of any mapping range + *chapter = m[1]; + *verse = m[2]; + *verse_end = m[3]; + if (*m > dstSys->p->books.size()) + *book = dstSys->getBook(m[7])->getOSISName(); + return; + } + // destination mapping can have duplicate items, use the last (by using <=) + if (a == NULL || (a[5]>a[6]?a[5]:a[6]) <= (m[5]>m[6]?m[5]:m[6])) + a = m; + } + } + if (a != NULL) { + //printf("set appropriate: %i %i %i %i %i %i\n",a[1],a[2],a[3],a[4],a[5],a[6]); + (*chapter) = a[1]; + // shift verse + const int d = (a[3]>a[2]?a[3]:a[2])-(a[6]>a[5]?a[6]:a[5]); + if (*verse < *verse_end) + *verse_end += d; + else + *verse_end = (*verse) + d; + *verse += d; + if (*a > dstSys->p->books.size()) + *book = dstSys->getBook(a[7])->getOSISName(); + return; + } + //printf("There is no mapping.\n"); + } + else if (strcmp(dstSys->getName(),"KJVA") && strcmp(dstSys->getName(),"KJV")) { + const System *kjva = getSystemVerseMgr()->getVersificationSystem("KJVA"); + const int src_verse = *verse; + + translateVerse(kjva, book, chapter, verse, verse_end); + + int interm_verse = *verse, interm_range = *verse_end, interm_chapter = *chapter; + const char *interm_book = *book; + + kjva->translateVerse(dstSys, book, chapter, verse, verse_end); + + // contraction->expansion fix + if (verse < verse_end && !(interm_verse < interm_range)) { + kjva->translateVerse(this, &interm_book, &interm_chapter, &interm_verse, &interm_range); + if (interm_verse < interm_range) { + *verse += src_verse - interm_verse; + if (*verse > *verse_end) + *verse = *verse_end; + else + *verse_end = *verse; + } + } + } + else { + //printf("Perform forward mapping.\n"); + const int b = getBookNumberByOSISName(*book)-1; + if (b >= (int)p->mappings.size()) + return; + // forward mapping should use reversed search for item + for (int i=p->mappings[b].size()-1; i>=0; --i) { + const unsigned char *m = p->mappings[b][i]; + if (m[1] < *chapter) { + //printf("There is no mapping for this chapter.\n"); + return; + } + if (m[1] == *chapter && m[2] <= *verse) { + //printf("found mapping %i %i %i %i %i %i\n",m[1],m[2],m[3],m[4],m[5],m[6]); + if (m[2] == *verse || (m[3] >= *verse && m[2] <= *verse)) { + *chapter = m[4]; + *verse = m[5]; + *verse_end = m[6]; + } + else { + *chapter = m[4]; + // shift verse + const int d = (m[6]>m[5]?m[6]:m[5])-(m[3]>m[2]?m[3]:m[2]); + if (*verse < *verse_end) + *verse_end += d; + else + *verse_end = (*verse) + d; + *verse += d; + } + if (*m > p->books.size()) + *book = p->mappingsExtraBooks[m[0]-p->books.size()-1]; + return; + } + } + //printf("No mapping.\n"); + } +} + SWORD_NAMESPACE_END