36 static const char oName[] =
"Word Javascript";
37 static const char oTip[] =
"Toggles Word Javascript data";
41 static const StringList oVals(&choices[0], &choices[2]);
69 unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
72 bool needWordOut =
false;
75 SWBuf wordSrcPrefix = modName;
77 const SWBuf orig = text;
78 const char * from = orig.
c_str();
84 for (text =
""; *from; from++) {
91 textEnd = (
unsigned int)text.
length();
96 if (*token ==
'W' && (token[1] ==
'G' || token[1] ==
'H')) {
98 if (atoi((!isdigit(*val))?val+1:val) < 5627) {
100 sprintf(wordstr,
"%03d", word++);
101 needWordOut = (word > 2);
103 (*wordAttrs)[
"Lemma"] = val;
106 tmp.
append(text.
c_str()+textStart, (int)(textEnd - textStart));
107 (*wordAttrs)[
"Text"] = tmp;
111 (*wordAttrs)[
"TextStart"] = ts;
118 (*wordAttrs)[
"Morph"] = val;
124 if (*token ==
'W' && token[1] ==
'T') {
125 if (token[2] ==
'G' || token[2] ==
'H') {
126 strcpy(val, token+2);
128 else strcpy(val, token+1);
130 (*wordAttrs)[
"Morph"] = val;
131 (*wordAttrs)[
"MorphClass"] =
"StrongsMorph";
141 sprintf(wstr,
"%03d", word-2);
144 SWBuf strong = (*wAttrs)[
"Lemma"];
145 SWBuf morph = (*wAttrs)[
"Morph"];
146 SWBuf morphClass = (*wAttrs)[
"MorphClass"];
147 SWBuf wordText = (*wAttrs)[
"Text"];
148 SWBuf textSt = (*wAttrs)[
"TextStart"];
151 gh = isdigit(strong[0]) ? 0:strong[0];
174 if (lexName ==
"StrongsGreek")
176 if (lexName ==
"StrongsHebrew")
187 for (
unsigned int i = 0; i < wordID.
size(); i++) {
188 if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
194 int textStr = atoi(textSt.
c_str());
195 textStr += lastAppendLen;
196 SWBuf spanStart =
"";
200 if (!sMorph) sMorph = 0;
210 const char *
m = strchr(morph.
c_str(),
':');
212 else m = morph.
c_str();
213 spanStart.
appendFormatted(
"<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.
c_str(), strong.
c_str(), wordID.
c_str(),
m, modName.
c_str());
214 text.
insert(textStr, spanStart);
215 lastAppendLen = (
unsigned int)spanStart.
length();
221 textStart = (
unsigned int)text.
length(); newText =
false;
227 token[tokpos++] = *from;
238 sprintf(wstr,
"%03d", word-1);
241 SWBuf strong = (*wAttrs)[
"Lemma"];
242 SWBuf morph = (*wAttrs)[
"Morph"];
243 SWBuf morphClass = (*wAttrs)[
"MorphClass"];
244 SWBuf wordText = (*wAttrs)[
"Text"];
245 SWBuf textSt = (*wAttrs)[
"TextStart"];
248 gh = isdigit(strong[0]) ? 0:strong[0];
268 if (lexName ==
"StrongsGreek")
270 if (lexName ==
"StrongsHebrew")
281 for (
unsigned int i = 0; i < wordID.
size(); i++) {
282 if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
288 int textStr = atoi(textSt.
c_str());
289 textStr += lastAppendLen;
290 SWBuf spanStart =
"";
292 const char *
m = strchr(morph.
c_str(),
':');
294 else m = morph.
c_str();
295 spanStart.
appendFormatted(
"<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.
c_str(), strong.
c_str(), wordID.
c_str(),
m, modName.
c_str());
296 text.
insert(textStr, spanStart);
const char * getName() const
#define SWORD_NAMESPACE_START
SWBuf & appendFormatted(const char *format,...)
SWModule * defaultGreekLex
unsigned long length() const
static const StringList * oValues()
virtual const char * getText() const
std::map< SWBuf, SWBuf, std::less< SWBuf > > AttributeValue
void insert(unsigned long pos, const char *str, unsigned long start=0, signed long max=-1)
const char * c_str() const
std::list< SWBuf > StringList
SWBuf & append(const char *str, long max=-1)
static const char oName[]
virtual char processText(SWBuf &text, const SWKey *key=0, const SWModule *module=0)
virtual int getVerse() const
#define SWDYNAMIC_CAST(className, object)
unsigned long size() const
virtual AttributeTypeList & getEntryAttributes() const
static const char * choices[4]
#define SWORD_NAMESPACE_END
SWModule * defaultGreekParse
virtual char getTestament() const
SWModule * defaultHebParse