From e330651fbc54920cd6c7d5d3a56527516efa3b82 Mon Sep 17 00:00:00 2001 From: danglassey Date: Sat, 26 Oct 2002 13:01:54 +0000 Subject: sync with crosswire 20021026-1300 --- src/modules/filters/gbfosis.cpp | 3 ++- src/modules/filters/thmlosis.cpp | 18 +++++++++++++++--- tests/filtertest.cpp | 8 +++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/modules/filters/gbfosis.cpp b/src/modules/filters/gbfosis.cpp index ac41e5b..0d9f8f1 100644 --- a/src/modules/filters/gbfosis.cpp +++ b/src/modules/filters/gbfosis.cpp @@ -279,7 +279,8 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu case '\'': case '\"': case '`': - quoteStack.handleQuote(fromStart, from, &to); +// quoteStack.handleQuote(fromStart, from, &to); + *to++ = *from; from++; break; default: diff --git a/src/modules/filters/thmlosis.cpp b/src/modules/filters/thmlosis.cpp index f04b1b9..4035108 100644 --- a/src/modules/filters/thmlosis.cpp +++ b/src/modules/filters/thmlosis.cpp @@ -48,6 +48,7 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod std::string tmp; bool suspendTextPassThru = false; bool keepToken = false; + bool handled = false; len = strlen(text) + 1; // shift string to right of buffer if (len < maxlen) { @@ -77,7 +78,7 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod keepToken = false; suspendTextPassThru = false; newWord = true; - + handled = false; while (wordStart < (text+maxlen)) { // if (strchr(" ,;.?!()'\"", *wordStart)) @@ -96,12 +97,14 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod // pushString(buf, ""; @@ -116,13 +120,15 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod tmp += ""; pushString(&to, tmp.c_str()); suspendTextPassThru = false; + handled = true; } // Figure else if (!strncmp(token, "img ", 4)) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute - return false; + continue; +// return false; pushString(&to, "
"); - return true; + handled = true; } // Strongs numbers @@ -170,6 +176,7 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod module->getEntryAttributes()["Word"][wordstr]["Morph"] = val; } } + handled = true; } // Morphology @@ -209,9 +216,14 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod to+=strlen(buf); } } + handled = true; } if (!keepToken) { // if we don't want strongs + if (!handled) { + SWLog::systemlog->LogError("Unprocessed Token: <%s>", token); +// exit(-1); + } if (strchr(" ,:;.?!()'\"", from[1])) { if (lastspace) to--; diff --git a/tests/filtertest.cpp b/tests/filtertest.cpp index 0301c49..3d49084 100644 --- a/tests/filtertest.cpp +++ b/tests/filtertest.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #ifndef NO_SWORD_NAMESPACE @@ -11,15 +12,16 @@ using namespace sword; #define MAXBUF 30000 int main(int argc, char **argv) { SWMgr mgr; - SWModule *module = mgr.Modules["KJV"]; + SWModule *module = mgr.Modules["TR"]; if (!module) module = mgr.Modules.begin()->second; ((VerseKey *)(SWKey *)*module)->AutoNormalize(0); ((VerseKey *)(SWKey *)*module)->Headings(1); // ThMLHTMLHREF filter; - GBFOSIS filter; - module->Key() = ((argc > 1) ? argv[1] : "jas1:1"); +// GBFOSIS filter; + ThMLOSIS filter; + module->Key() = ((argc > 1) ? argv[1] : "mat4:15"); char *buf = new char [ MAXBUF ]; memset(buf, 0, MAXBUF); // strcpy(buf, "This is a verse reference: jas1:22,23-25;3;5:1;rom1-9 with an "); -- cgit