From 9ee854a4d91196887e640230db56b0fffcfdd240 Mon Sep 17 00:00:00 2001 From: "Troy A. Griffitts" Date: Sat, 17 Sep 2022 12:21:29 +0000 Subject: updated lockosis script to work for both 1995 and 2020 data unchanged git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@552 07627401-56e2-0310-80f4-f8cd0041bdcd --- modules/nasb1995/lockosis.cpp | 54 ++++++++++++++++++++++++++++++++----------- modules/nasb2020/lockosis.cpp | 47 +++++++++++++++++++++++++------------ 2 files changed, 73 insertions(+), 28 deletions(-) diff --git a/modules/nasb1995/lockosis.cpp b/modules/nasb1995/lockosis.cpp index 4209a8f..8c719de 100644 --- a/modules/nasb1995/lockosis.cpp +++ b/modules/nasb1995/lockosis.cpp @@ -532,7 +532,7 @@ int main(int argc, char **argv) { strongsStartFound = true; } } - else if (!strncmp(lastToken.c_str(), "hi", 2)) { + else if (!strncmp(lastToken.c_str(), "hi", 2) && strncmp(lastToken.c_str(), "hi type=\"inscription\"", 21)) { if ((outstring[i] != ' ') && ((isalpha(outstring[i])) || (isdigit(outstring[i])))) { strongsStart = tokenStart - 1; strongsStartFound = true; @@ -586,7 +586,11 @@ int main(int argc, char **argv) { strongsStartFound = false; strongsStart = i+1; } - if (!strncmp(lastToken.c_str(), "seg type=\"otPassage\"", 19)) { + if (!strncmp(lastToken.c_str(), "seg type=\"otPassage\"", 20)) { + strongsStartFound = false; + strongsStart = i+1; + } + if (!strncmp(lastToken.c_str(), "hi type=\"inscription\"", 21)) { strongsStartFound = false; strongsStart = i+1; } @@ -978,31 +982,55 @@ void prepLine(string &outstring, int currentTestament, bool note) { if (replaceFirst(outstring, "E", "Ē") > -1) continue; if (replaceFirst(outstring, "e", "ē") > -1) continue; - if (replaceFirst(outstring, "MENE", "Mene") > -1) continue; + if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; + + // these are probably legacy + if (replaceFirst(outstring, "M<\\>ENĒ:", "Menē:") > -1) continue; if (replaceFirst(outstring, "M<\\>ENE", "Mene") > -1) continue; if (replaceFirst(outstring, "M<\\>ENE:", "Mene:") > -1) continue; + if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENE", "Mene") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; + if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "TEKEL", "Tekel") > -1) continue; if (replaceFirst(outstring, "T<\\>EKEL", "Tekel") > -1) continue; if (replaceFirst(outstring, "T<\\>EKEL:", "Tekel:") > -1) continue; + if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; + if (replaceFirst(outstring, "T<\\>EKĒL:", "Tekēl:") > -1) continue; + if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "U<\\>PHARSIN", "Upharsin") > -1) continue; + if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; if (replaceFirst(outstring, "U<\\>FARSIN", "Ufarsin") > -1) continue; + if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; + if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "P<\\>ERĒS", "Perēs") > -1) continue; + if (replaceFirst(outstring, "PERĒS", "Perēs") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "PERES", "Peres") > -1) continue; if (replaceFirst(outstring, "P<\\>ERES", "Peres") > -1) continue; if (replaceFirst(outstring, "P<\\>ERES:", "Peres:") > -1) continue; - - if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; - if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; - if (replaceFirst(outstring, "M<\\>ENĒ:", "Menē:") > -1) continue; - if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; - if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; - if (replaceFirst(outstring, "T<\\>EKĒL:", "Tekēl:") > -1) continue; - if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; - if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; - if (replaceFirst(outstring, "U<\\>FARSIN", "Ufarsin") > -1) continue; if (replaceFirst(outstring, "PERĒS", "Perēs") > -1) continue; if (replaceFirst(outstring, "P<\\>ERĒS", "Perēs") > -1) continue; if (replaceFirst(outstring, "P<\\>ERĒS:", "Perēs:") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "H<\\>OLY TO THE L<\\>ORD", + "Holy to the L<\\>ORD") > -1) continue; const char *outstr = outstring.c_str(); const char *found = strstr(outstr+end, "<\\>"); diff --git a/modules/nasb2020/lockosis.cpp b/modules/nasb2020/lockosis.cpp index 87904b3..8c719de 100644 --- a/modules/nasb2020/lockosis.cpp +++ b/modules/nasb2020/lockosis.cpp @@ -982,35 +982,52 @@ void prepLine(string &outstring, int currentTestament, bool note) { if (replaceFirst(outstring, "E", "Ē") > -1) continue; if (replaceFirst(outstring, "e", "ē") > -1) continue; - if (replaceFirst(outstring, "MENE", "Mene") > -1) continue; + if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; + + // these are probably legacy + if (replaceFirst(outstring, "M<\\>ENĒ:", "Menē:") > -1) continue; if (replaceFirst(outstring, "M<\\>ENE", "Mene") > -1) continue; if (replaceFirst(outstring, "M<\\>ENE:", "Mene:") > -1) continue; + if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; + if (replaceFirst(outstring, "MENE", "Mene") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; + if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "TEKEL", "Tekel") > -1) continue; if (replaceFirst(outstring, "T<\\>EKEL", "Tekel") > -1) continue; if (replaceFirst(outstring, "T<\\>EKEL:", "Tekel:") > -1) continue; + if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; + if (replaceFirst(outstring, "T<\\>EKĒL:", "Tekēl:") > -1) continue; + if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "U<\\>PHARSIN", "Upharsin") > -1) continue; + if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; if (replaceFirst(outstring, "U<\\>FARSIN", "Ufarsin") > -1) continue; + if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; + if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; + // end of probably legacy + + if (replaceFirst(outstring, "P<\\>ERĒS", "Perēs") > -1) continue; + if (replaceFirst(outstring, "PERĒS", "Perēs") > -1) continue; + + // these are probably legacy if (replaceFirst(outstring, "PERES", "Peres") > -1) continue; if (replaceFirst(outstring, "P<\\>ERES", "Peres") > -1) continue; if (replaceFirst(outstring, "P<\\>ERES:", "Peres:") > -1) continue; - - if (replaceFirst(outstring, "MENĒ", "Menē") > -1) continue; - if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; - if (replaceFirst(outstring, "M<\\>ENĒ", "Menē") > -1) continue; - if (replaceFirst(outstring, "M<\\>ENĒ:", "Menē:") > -1) continue; - if (replaceFirst(outstring, "TEKĒL", "Tekēl") > -1) continue; - if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; - if (replaceFirst(outstring, "T<\\>EKĒL", "Tekēl") > -1) continue; - if (replaceFirst(outstring, "T<\\>EKĒL:", "Tekēl:") > -1) continue; - if (replaceFirst(outstring, "UPHARSIN", "Upharsin") > -1) continue; - if (replaceFirst(outstring, "UFARSIN", "Ufarsin") > -1) continue; - if (replaceFirst(outstring, "U<\\>FARSIN", "Ufarsin") > -1) continue; - if (replaceFirst(outstring, "U<\\>PHARSIN", "Ufarsin") > -1) continue; if (replaceFirst(outstring, "PERĒS", "Perēs") > -1) continue; if (replaceFirst(outstring, "P<\\>ERĒS", "Perēs") > -1) continue; - if (replaceFirst(outstring, "P<\\>ERĒS", "Perēs") > -1) continue; if (replaceFirst(outstring, "P<\\>ERĒS:", "Perēs:") > -1) continue; + // end of probably legacy if (replaceFirst(outstring, "H<\\>OLY TO THE L<\\>ORD", "Holy to the L<\\>ORD") > -1) continue; -- cgit