[sword-svn] r3483 - in branches/sword-1-8-x: . examples examples/classes examples/cmdline examples/tasks include locales.d src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Sun Jun 25 08:19:34 MST 2017
Author: scribe
Date: 2017-06-25 08:19:34 -0700 (Sun, 25 Jun 2017)
New Revision: 3483
Added:
branches/sword-1-8-x/examples/classes/flatapiinstallmgr.cpp
branches/sword-1-8-x/examples/tasks/listbiblebooknames.cpp
branches/sword-1-8-x/examples/tasks/simpleverselookup.cpp
branches/sword-1-8-x/locales.d/be-utf8.conf
Removed:
branches/sword-1-8-x/examples/simple.cpp
Modified:
branches/sword-1-8-x/
branches/sword-1-8-x/configure.ac
branches/sword-1-8-x/examples/classes/Makefile
branches/sword-1-8-x/examples/cmdline/lookup.cpp
branches/sword-1-8-x/examples/tasks/CMakeLists.txt
branches/sword-1-8-x/examples/tasks/Makefile.am
branches/sword-1-8-x/include/swversion.h
branches/sword-1-8-x/src/modules/filters/osislemma.cpp
branches/sword-1-8-x/src/modules/filters/osisstrongs.cpp
branches/sword-1-8-x/src/modules/filters/osisxhtml.cpp
Log:
Merged updates and fixes since RC2. 1.8.0RC3
Property changes on: branches/sword-1-8-x
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:3459-3471,3473,3475
+ /trunk:3459-3471,3473,3475,3478-3482
Modified: branches/sword-1-8-x/configure.ac
===================================================================
--- branches/sword-1-8-x/configure.ac 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/configure.ac 2017-06-25 15:19:34 UTC (rev 3483)
@@ -5,7 +5,7 @@
# Version change: Change line 8 only !
# Change it immediately after a release
-AC_INIT(sword, 1.7.902, sword-bugs at crosswire.org, sword, http://crosswire.org/sword)
+AC_INIT(sword, 1.7.903, sword-bugs at crosswire.org, sword, http://crosswire.org/sword)
AC_CONFIG_SRCDIR(sword.bmp)
AC_PREREQ(2.52)
AC_REVISION($Revision: 1.45 $)
Modified: branches/sword-1-8-x/examples/classes/Makefile
===================================================================
--- branches/sword-1-8-x/examples/classes/Makefile 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/examples/classes/Makefile 2017-06-25 15:19:34 UTC (rev 3483)
@@ -1,4 +1,4 @@
-TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey flatapisearch versenorm
+TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey flatapisearch versenorm flatapiinstallmgr
all: $(TARGETS)
clean:
Copied: branches/sword-1-8-x/examples/classes/flatapiinstallmgr.cpp (from rev 3479, trunk/examples/classes/flatapiinstallmgr.cpp)
===================================================================
--- branches/sword-1-8-x/examples/classes/flatapiinstallmgr.cpp (rev 0)
+++ branches/sword-1-8-x/examples/classes/flatapiinstallmgr.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ *
+ * flatapilookup.c -
+ *
+ * $Id$
+ *
+ * Copyright 2014 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <flatapi.h>
+
+int main(int argc, char **argv) {
+ if (argc != 4) {
+ fprintf(stderr, "\nusage: %s \"<sourceName>\" <\"modName\"> \"<destPath>\"\n"
+ "\tExample: CrossWire KJV ~/library\n\n", argv[0]);
+ exit(-1);
+ }
+
+
+ SWHANDLE mgr = org_crosswire_sword_SWMgr_newWithPath(argv[3]);
+
+ SWHANDLE instMgr = org_crosswire_sword_InstallMgr_new("/home/scribe/.sword/InstallMgr", 0);
+
+ org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed(instMgr);
+
+ fprintf(stdout, "Install returned: %d\n", org_crosswire_sword_InstallMgr_remoteInstallModule(instMgr, mgr, argv[1], argv[2]));
+
+ org_crosswire_sword_SWMgr_delete(mgr);
+ org_crosswire_sword_InstallMgr_delete(instMgr);
+
+ return 0;
+}
Modified: branches/sword-1-8-x/examples/cmdline/lookup.cpp
===================================================================
--- branches/sword-1-8-x/examples/cmdline/lookup.cpp 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/examples/cmdline/lookup.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -37,6 +37,7 @@
using sword::SWModule;
using sword::FMT_WEBIF;
using sword::FMT_HTMLHREF;
+using sword::FMT_XHTML;
using sword::FMT_RTF;
using sword::FMT_LATEX;
using sword::ModMap;
@@ -54,7 +55,7 @@
// WebMgr manager((const char *)0);
// manager.setJavascript(true);
//
- SWMgr manager(new MarkupFilterMgr(FMT_HTMLHREF));
+ SWMgr manager(new MarkupFilterMgr(FMT_XHTML));
// SWMgr manager(new MarkupFilterMgr(FMT_WEBIF));
SWModule *target;
@@ -78,7 +79,7 @@
// turn all filters to default values
manager.setGlobalOption("Headings", "On");
- manager.setGlobalOption("Strong's Numbers", "On");
+ manager.setGlobalOption("Strong's Numbers", "Off");
manager.setGlobalOption("Lemmas", "Off");
// manager.setGlobalOption("Greek Accents", "Off");
Deleted: branches/sword-1-8-x/examples/simple.cpp
===================================================================
--- branches/sword-1-8-x/examples/simple.cpp 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/examples/simple.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -1,54 +0,0 @@
-/******************************************************************************
- *
- * simple.cpp - This is about the simplest useful example of using the
- * SWORD engine.
- *
- * After sword is installed, it should compile with something similar to:
- *
- * g++ -o simple simple.cpp `pkg-config --cflags --libs sword`
- *
- * If you'd like to choose the type of tag markup which sword will output
- * for you, include:
- *
- * #include <markupfiltmgr.h>
- *
- * and change your instantiation of SWMgr, below, to (e.g., for HTML):
- *
- * SWMgr library(0, 0, true, new MarkupFilterMgr(FMT_HTMLHREF));
- *
- * $Id$
- *
- * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-#include <swmgr.h>
-#include <swmodule.h>
-#include <iostream>
-
-
-using namespace sword;
-using std::cout;
-
-
-int main(int argc, char **argv) {
- SWMgr library;
- SWModule *darby = library.getModule("Darby");
- darby->setKey("James 1:19");
- cout << darby->RenderText();
-
- return 0;
-}
-
Modified: branches/sword-1-8-x/examples/tasks/CMakeLists.txt
===================================================================
--- branches/sword-1-8-x/examples/tasks/CMakeLists.txt 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/examples/tasks/CMakeLists.txt 2017-06-25 15:19:34 UTC (rev 3483)
@@ -6,6 +6,8 @@
MESSAGE(STATUS "\n-- CONFIGURING LIBRARY EXAMPLES")
SET(example_PROGRAMS
parallelbibles
+ simpleverselookup
+ listbiblebooknames
)
FOREACH(DEMO ${example_PROGRAMS})
Modified: branches/sword-1-8-x/examples/tasks/Makefile.am
===================================================================
--- branches/sword-1-8-x/examples/tasks/Makefile.am 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/examples/tasks/Makefile.am 2017-06-25 15:19:34 UTC (rev 3483)
@@ -5,7 +5,8 @@
endif
LDADD = $(top_builddir)/lib/libsword.la
-noinst_PROGRAMS = parallelbibles
+noinst_PROGRAMS = parallelbibles listbiblebooknames simpleverselookup
parallelbibles_SOURCES = parallelbibles.cpp
-
+listbiblebooknames_SOURCES = listbiblebooknames.cpp
+simpleverselookup_SOURCES = simpleverselookup.cpp
Copied: branches/sword-1-8-x/examples/tasks/listbiblebooknames.cpp (from rev 3480, trunk/examples/tasks/listbiblebooknames.cpp)
===================================================================
--- branches/sword-1-8-x/examples/tasks/listbiblebooknames.cpp (rev 0)
+++ branches/sword-1-8-x/examples/tasks/listbiblebooknames.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ * verseranges.cpp - This example demonstrates how to work with contiguous
+ * verse ranges using VerseKey
+ *
+ * $Id$
+ *
+ * Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <iostream>
+
+#include <swmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+
+
+using namespace sword;
+using namespace std;
+
+
+int main(int argc, char **argv) {
+
+ cout << "\n";
+
+ const char *modName = (argc > 1) ? argv[1] : "KJV";
+ SWMgr manager;
+ SWModule *bible = manager.getModule(modName);
+ if (!bible) {
+ cout << modName << " module is not installed.\nPlease install to show versification (v11n) from this specific Bible.\nShowing builtin KJV v11n scheme..\n\n";
+ }
+
+ VerseKey *vk = (bible) ? (VerseKey *)bible->getKey() : new VerseKey();
+
+ for ((*vk) = TOP; !vk->popError(); vk->setBook(vk->getBook()+1)) {
+ cout << vk->getBookName() << "\n";
+ }
+
+ // if we 'new'ed a VerseKey unassociated with a module, above, then we should delete it.
+ if (!bible) delete vk;
+
+ return 0;
+}
+
Copied: branches/sword-1-8-x/examples/tasks/simpleverselookup.cpp (from rev 3481, trunk/examples/tasks/simpleverselookup.cpp)
===================================================================
--- branches/sword-1-8-x/examples/tasks/simpleverselookup.cpp (rev 0)
+++ branches/sword-1-8-x/examples/tasks/simpleverselookup.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ *
+ * simple.cpp - This is about the simplest useful example of using the
+ * SWORD engine.
+ *
+ * After sword is installed, it should compile with something similar to:
+ *
+ * g++ -o simple simple.cpp `pkg-config --cflags --libs sword`
+ *
+ * If you'd like to choose the type of tag markup which sword will output
+ * for you, include:
+ *
+ * #include <markupfiltmgr.h>
+ *
+ * and change your instantiation of SWMgr, below, to (e.g., for HTML):
+ *
+ * SWMgr library(0, 0, true, new MarkupFilterMgr(FMT_HTMLHREF));
+ *
+ * $Id$
+ *
+ * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+// Simple example to show James 1:19 from KJV,
+// if argv[1] is passed then use this instead of KJV
+// if argv[2] is passed then use this instead of James 1:19
+
+#include <swmgr.h>
+#include <swmodule.h>
+#include <iostream>
+
+
+using namespace sword;
+using std::cout;
+
+
+int main(int argc, char **argv) {
+ // instantiate a SWORD Manager to give access to the installed library of books (modules)
+ SWMgr library;
+
+ // try to retrieve a reference to an installed book (module)
+ SWModule *book = library.getModule((argc > 1) ? argv[1] : "KJV");
+
+ // set that book's reference key to our desired verse
+ book->setKey((argc > 2) ? argv[2] : "James 1:19");
+
+ // ask the book to render the current text
+ cout << book->renderText() << "\n";
+
+ return 0;
+}
+
Modified: branches/sword-1-8-x/include/swversion.h
===================================================================
--- branches/sword-1-8-x/include/swversion.h 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/include/swversion.h 2017-06-25 15:19:34 UTC (rev 3483)
@@ -24,11 +24,11 @@
#ifndef SWVERSION_H
#define SWVERSION_H
-#define SWORD_VERSION_NUM 107902000
-#define SWORD_VERSION_STR "1.7.902"
+#define SWORD_VERSION_NUM 107903000
+#define SWORD_VERSION_STR "1.7.903"
#define SWORD_VERSION_MAJOR 1
#define SWORD_VERSION_MINOR 7
-#define SWORD_VERSION_MICRO 902
+#define SWORD_VERSION_MICRO 903
#define SWORD_VERSION_NANO 0
#include <defs.h>
Copied: branches/sword-1-8-x/locales.d/be-utf8.conf (from rev 3478, trunk/locales.d/be-utf8.conf)
===================================================================
--- branches/sword-1-8-x/locales.d/be-utf8.conf (rev 0)
+++ branches/sword-1-8-x/locales.d/be-utf8.conf 2017-06-25 15:19:34 UTC (rev 3483)
@@ -0,0 +1,185 @@
+# Belarussian BIBLE
+
+[Meta]
+Name=be
+Description=Belarussian (Unicode)
+Encoding=UTF-8
+
+[Text]
+Genesis=Быцьцё
+Exodus=Выхад
+Leviticus=Лявіт
+Numbers=Лікі
+Deuteronomy=Другі закон
+Joshua=Ісус Нав
+Judges=Кніга Судзьдзяў
+Ruth=Рут
+1 Samuel=Першая Царстваў
+2 Samuel=Другая Царстваў
+1 Kings=Трэйцяя Царстваў
+2 Kings=Чацьвёртая Царстваў
+1 Chronicles=Першая Летапісаў
+2 Chronicles=Другая Летапісаў
+Ezra=Эздра
+Nehemiah=Нээмія
+Esther=Эстэр
+Job=Ёв
+Psalms=Псалтыр
+Proverbs=Выслоўі
+Ecclesiastes=Эклезіяст
+Song of Solomon=Песьня
+Isaiah=Ісая
+Jeremiah=Ерамія
+Lamentations=Плач
+Ezekiel=Езэкііль
+Daniel=Данііл
+Hosea=Асія
+Joel=Ёіль
+Amos=Амос
+Obadiah=Аўдзей
+Jonah=Ёна
+Micah=Міхей
+Nahum=Навум
+Habakkuk=Абакум
+Zephaniah=Сафон
+Haggai=Агей
+Zechariah=Захарыя
+Malachi=Малахія
+Matthew=Мацьвея
+Mark=Марка
+Luke=Лукаш
+John=Яна
+Acts=Дзеі
+Romans=Да Рымлянаў
+1 Corinthians=Першае да Карынфянаў
+2 Corinthians=Другое да Карынфянаў
+Galatians=Да Галятаў
+Ephesians=Да Эфэсянаў
+Philippians=Да Піліпянаў
+Colossians=Да Каласянаў
+1 Thessalonians=Першае да Фесаланікійцаў
+2 Thessalonians=Другое да Фесаланікійцаў
+1 Timothy=Першае да Цімафея
+2 Timothy=Другое да Цімафея
+Titus=Да Ціта
+Philemon=Да Філімона
+Hebrews=Да Габрэяў
+James=Якава
+1 Peter=Першае Пятра
+2 Peter=Другое Пятра
+1 John=Першае Яна
+2 John=Другое Яна
+3 John=Трэйцяе Яна
+Jude=Юда
+Revelation=Адкрыцьцё
+
+[Book Abbrevs]
+Быцьцё=Gen
+Быц=Gen
+Быцьцё=Gen
+Выхад=Exo
+Лявіт=Lev
+Лікі=Num
+Другі закон=Deu
+Ісус Нав=Jos
+Кніга Судзьдзяў=Jdg
+Рут=Rut
+
+Першая Царстваў=1Sa
+Другая Царстваў=2Sa
+Трэйцяя Царстваў=1Ki
+Чацьвёртая Царстваў=2Ki
+Першая Летапісаў=1Ch
+Другая Летапісаў=2Ch
+
+1 Царстваў=1Sa
+2 Царстваў=2Sa
+3 Царстваў=1Ki
+4 Царстваў=2Ki
+1 Летапісаў=1Ch
+2 Летапісаў=2Ch
+
+1Царстваў=1Sa
+2Царстваў=2Sa
+3Царстваў=1Ki
+4Царстваў=2Ki
+1Летапісаў=1Ch
+1Летапісаў=2Ch
+
+Эздра=Ezr
+Нээмія=Neh
+Эстэр=Est
+Ёв=Job
+Псалтыр=Psa
+Выслоўі=Pro
+Эклезіяст=Ecc
+Песьня=Sng
+Ісая=Isa
+Ерамія=Jer
+Плач=Lam
+Езэкііль=Ezk
+Данііл=Dan
+Асія=Hos
+Ёіль=Jol
+Амос=Amo
+Аўдзей=Oba
+Ёна=Jnh
+Міхей=Mic
+Навум=Nah
+Абакум=Hab
+Сафон=Zep
+Агей=Hag
+Захарыя=Zec
+Малахія=Mal
+Мацьвея=Mat
+Марка=Mrk
+Лукаш=Luk
+Яна=Jhn
+Дзеі=Act
+Да Рымлянаў=Rom
+Першае да Карынфянаў=1Co
+Другое да Карынфянаў=2Co
+1Карынфянаў=1Co
+2Карынфянаў=2Co
+1 Карынфянаў=1Co
+2 Карынфянаў=2Co
+
+Да Галятаў=Gal
+Да Эфэсянаў=Eph
+Да Піліпянаў=Php
+Да Каласянаў=Col
+Першае да Фесаланікійцаў=1Th
+Другое да Фесаланікійцаў=2Th
+Першае да Цімафея=1Ti
+Другое да Цімафея=2Ti
+1Фесаланікійцаў=1Th
+2Фесаланікійцаў=2Th
+1Цімафея=1Ti
+2Цімафея=2Ti
+
+1 Фесаланікійцаў=1Th
+2 Фесаланікійцаў=2Th
+1 Цімафея=1Ti
+2 Цімафея=2Ti
+
+Да Ціта=Tts
+Да Філімона=Phm
+Да Габрэяў=Heb
+Якава=Jam
+Першае Пятра=1Pe
+Другое Пятра=2Pe
+Першае Яна=1Jn
+Другое Яна=2Jn
+Трэйцяе Яна=3Jn
+1Пятра=1Pe
+2Пятра=2Pe
+1Яна=1Jn
+2Яна=2Jn
+3Яна=3Jn
+1 Пятра=1Pe
+2 Пятра=2Pe
+1 Яна=1Jn
+2 Яна=2Jn
+3 Яна=3Jn
+Юда=Jde
+Адкрыцьцё=Rev
Modified: branches/sword-1-8-x/src/modules/filters/osislemma.cpp
===================================================================
--- branches/sword-1-8-x/src/modules/filters/osislemma.cpp 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/src/modules/filters/osislemma.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -67,6 +67,15 @@
intoken = false;
if (token.startsWith("w ")) { // Word
XMLTag wtag(token);
+
+ // always save off lemma if we haven't yet
+ if (!wtag.getAttribute("savlm")) {
+ const char *l = wtag.getAttribute("lemma");
+ if (l) {
+ wtag.setAttribute("savlm", l);
+ }
+ }
+
int count = wtag.getAttributePartCount("lemma", ' ');
for (int i = 0; i < count; i++) {
SWBuf a = wtag.getAttribute("lemma", i, ' ');
@@ -78,6 +87,7 @@
count--;
}
}
+
token = wtag;
token.trim();
// drop <>
Modified: branches/sword-1-8-x/src/modules/filters/osisstrongs.cpp
===================================================================
--- branches/sword-1-8-x/src/modules/filters/osisstrongs.cpp 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/src/modules/filters/osisstrongs.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -88,6 +88,15 @@
if (token.startsWith("w ")) { // Word
XMLTag wtag(token);
+
+ // always save off lemma if we haven't yet
+ if (!wtag.getAttribute("savlm")) {
+ const char *l = wtag.getAttribute("lemma");
+ if (l) {
+ wtag.setAttribute("savlm", l);
+ }
+ }
+
if (module->isProcessEntryAttributes()) {
wordStart = from+1;
char gh = 0;
@@ -138,14 +147,14 @@
} while (++i < count);
}
- if ((attrib = wtag.getAttribute("lemma"))) {
- int count = wtag.getAttributePartCount("lemma", ' ');
+ if ((attrib = wtag.getAttribute("savlm"))) {
+ int count = wtag.getAttributePartCount("savlm", ' ');
int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0
do {
gh = 0;
SWBuf lClass = "";
SWBuf l = "";
- attrib = wtag.getAttribute("lemma", i, ' ');
+ attrib = wtag.getAttribute("savlm", i, ' ');
if (i < 0) i = 0; // to handle our -1 condition
const char *m = strchr(attrib, ':');
@@ -232,35 +241,27 @@
wordNum++;
}
+ // if we won't want strongs, then lets get them out of lemma
if (!option) {
-/*
- * Code which handles multiple lemma types. Kindof works but breaks at least WEBIF filters for strongs.
- *
int count = wtag.getAttributePartCount("lemma", ' ');
- for (int i = 0; i < count; i++) {
+ for (int i = 0; i < count; ++i) {
SWBuf a = wtag.getAttribute("lemma", i, ' ');
const char *prefix = a.stripPrefix(':');
if ((prefix) && (!strcmp(prefix, "x-Strongs") || !strcmp(prefix, "strong") || !strcmp(prefix, "Strong"))) {
// remove attribute part
wtag.setAttribute("lemma", 0, i, ' ');
- i--;
- count--;
+ --i;
+ --count;
}
}
-* Instead the codee below just removes the lemma attribute
-*****/
- const char *l = wtag.getAttribute("lemma");
- if (l) {
- SWBuf savlm = l;
- wtag.setAttribute("lemma", 0);
- wtag.setAttribute("savlm", savlm);
- token = wtag;
- token.trim();
- // drop <>
- token << 1;
- token--;
- }
+
+
}
+ token = wtag;
+ token.trim();
+ // drop <>
+ token << 1;
+ token--;
}
if (token.startsWith("/w")) { // Word End
if (module->isProcessEntryAttributes()) {
Modified: branches/sword-1-8-x/src/modules/filters/osisxhtml.cpp
===================================================================
--- branches/sword-1-8-x/src/modules/filters/osisxhtml.cpp 2017-06-25 14:36:23 UTC (rev 3482)
+++ branches/sword-1-8-x/src/modules/filters/osisxhtml.cpp 2017-06-25 15:19:34 UTC (rev 3483)
@@ -76,14 +76,19 @@
int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0
do {
attrib = tag.getAttribute("lemma", i, ' ');
+ SWBuf at = attrib;
+ const char *prefix = at.stripPrefix(':');
if (i < 0) i = 0; // to handle our -1 condition
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
SWBuf gh;
- if(*val == 'G')
+ if (*val == 'G') {
gh = "Greek";
- if(*val == 'H')
+ }
+ else if (*val == 'H') {
gh = "Hebrew";
+ }
+ else if (prefix) gh = prefix;
const char *val2 = val;
if ((strchr("GH", *val)) && (isdigit(val[1])))
val2++;
More information about the sword-cvs
mailing list