summaryrefslogtreecommitdiffstats
path: root/flashtools/flash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flashtools/flash.cpp')
-rw-r--r--flashtools/flash.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/flashtools/flash.cpp b/flashtools/flash.cpp
index 71d4e42..012496d 100644
--- a/flashtools/flash.cpp
+++ b/flashtools/flash.cpp
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * flash.cpp - Automation of flashcards generation
+ *
+ * Copyright 2007 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.
+ *
+ * Contributors:
+ * Lyndon Drake <lyndon at arotau dot com>
+ * Troy A. Griffitts <scribe at crosswire dot org>
+ */
+
#include <map>
#include <vector>
#include <iostream>
@@ -201,7 +223,7 @@ void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool
}
// if we would rather have short strongs
else {
- SWBuf answers = w.def;
+ answers = w.def;
strip.processText(answers); // remove html tags
answers.replaceBytes("\n\r", ' '); // remove newlines
}
@@ -241,13 +263,19 @@ void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool
*/
vector<Word> processWords(const char *range, bool addAll = true) {
SWMgr manager;
- SWModule &bible = *manager.getModule("KJV");
map<SWBuf, Word> wordList;
SWConfig hutf8("hwords.conf");
SWConfig hdefs("hdefs.conf");
SWConfig gutf8("gwords.conf");
SWConfig gdefs("gdefs.conf");
+
+ SWModule *tmpBible = manager.getModule("KJV");
+ if (!tmpBible) {
+ cerr << "Unable to locate KJV module" << endl;
+ exit(1);
+ }
+ SWModule &bible = *tmpBible;
VerseKey parser;
ListKey r = parser.ParseVerseList(range, 0, true);