From b5292d1d6c301302e234a465e362af9fcc557a46 Mon Sep 17 00:00:00 2001 From: danglassey Date: Sat, 14 Sep 2002 13:01:00 +0000 Subject: sync with crosswire 20020914-1300 --- src/modules/filters/gbfosis.cpp | 50 +++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'src/modules') diff --git a/src/modules/filters/gbfosis.cpp b/src/modules/filters/gbfosis.cpp index ec20675..ef5f92a 100644 --- a/src/modules/filters/gbfosis.cpp +++ b/src/modules/filters/gbfosis.cpp @@ -80,7 +80,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu while (wordStart < (text+maxlen)) { // if (strchr(" ,;.?!()'\"", *wordStart)) - if (strchr(";, .:?!()'\"", *wordStart)) + if (strchr(";, .:?!()'\"", *wordStart) && wordStart[0] && wordStart[1]) wordStart++; else break; } @@ -100,21 +100,20 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu tmp = ""; tmp.append(textStart, (int)(textEnd - textStart)+1); pushString(&to, convertToOSIS(tmp.c_str(), key)); + lastspace = false; suspendTextPassThru = false; } // Footnote if (!strcmp(token, "RF")) { // pushString(buf, ""); newText = true; + lastspace = false; } else if (!strcmp(token, "Rf")) { - tmp = ""; - tmp.append(textStart, (int)(textEnd - textStart)+1); - tmp += ""; - pushString(&to, tmp.c_str()); - suspendTextPassThru = false; + pushString(&to, ""); + lastspace = false; } // Figure @@ -140,6 +139,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu *to++ = *c; pushString(&to, "\" />"); + lastspace = false; return true; } @@ -153,18 +153,29 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu // normal strongs number strstrip(val); if (!strncmp(wordStart, ""); + char *attStart = strstr(wordStart, "lemma"); + if (attStart) { + attStart += 7; + sprintf(buf, "x-Strongs:%s|", val); + } + else { + attStart = wordStart + 3; + sprintf(buf, "lemma=\"x-Strongs:%s\" ", val); + } + wordStart[strlen(wordStart)] = '>'; + memmove(attStart+strlen(buf), attStart, (to-attStart)+1); + memcpy(attStart, buf, strlen(buf)); to+=strlen(buf); } else { - sprintf(buf, "", val); + sprintf(buf, "", val); memmove(wordStart+strlen(buf), wordStart, (to-wordStart)+1); memcpy(wordStart, buf, strlen(buf)); to+=strlen(buf); pushString(&to, ""); module->getEntryAttributes()["Word"][wordstr]["Strongs"] = val; + lastspace = false; } } } @@ -177,9 +188,19 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu *valto = 0; strstrip(val); if (!strncmp(wordStart, ""); + char *attStart = strstr(wordStart, "morph"); + if (attStart) { + attStart += 7; + sprintf(buf, "x-%s:%s|", "StrongsMorph", val); + } + else { + attStart = wordStart + 3; + sprintf(buf, "morph=\"x-%s:%s\" ", "StrongsMorph", val); + } + wordStart[strlen(wordStart)] = '>'; + memmove(attStart+strlen(buf), attStart, (to-attStart)+1); + memcpy(attStart, buf, strlen(buf)); to+=strlen(buf); } else { @@ -188,6 +209,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu memcpy(wordStart, buf, strlen(buf)); to+=strlen(buf); pushString(&to, ""); + lastspace = false; } } -- cgit