This method processes and appropriately modifies the text given it for a particular filter task
61 const char *wordStart = 0;
64 const SWBuf orig = text;
65 const char * from = orig.
c_str();
67 for (text =
""; *from; ++from) {
79 SWBuf type = stag.getAttribute(
"type");
81 SWBuf number = stag.getAttribute(
"subtype");
93 if (!wtag.getAttribute(
"savlm")) {
94 const char *l = wtag.getAttribute(
"lemma");
96 wtag.setAttribute(
"savlm", l);
110 SWBuf morphClass =
"";
111 SWBuf lemmaClass =
"";
114 sprintf(wordstr,
"%03d", wordNum);
118 if ((attrib = wtag.getAttribute(
"morph"))) {
119 int count = wtag.getAttributePartCount(
"morph",
' ');
120 int i = (count > 1) ? 0 : -1;
124 attrib = wtag.getAttribute(
"morph", i,
' ');
127 const char *
m = strchr(attrib,
':');
129 int len = (int)(m-attrib);
130 mClass.
append(attrib, len);
133 if ((mClass ==
"x-Robinsons") || (mClass ==
"x-Robinson") || (mClass ==
"Robinson")) {
136 if (i) { morphClass +=
" "; morph +=
" "; }
138 morphClass += mClass;
146 }
while (++i < count);
149 if ((attrib = wtag.getAttribute(
"savlm"))) {
150 int count = wtag.getAttributePartCount(
"savlm",
' ');
151 int i = (count > 1) ? 0 : -1;
156 attrib = wtag.getAttribute(
"savlm", i,
' ');
159 const char *m = strchr(attrib,
':');
161 int len = (int)(m-attrib);
162 lClass.
append(attrib, len);
165 if ((lClass ==
"x-Strongs") || (lClass ==
"strong") || (lClass ==
"Strong")) {
166 if (isdigit(attrib[0])) {
179 if (i) { lemmaClass +=
" "; lemma +=
" "; }
182 lemmaClass += lClass;
188 }
while (++i < count);
192 if ((attrib = wtag.getAttribute(
"src"))) {
193 int count = wtag.getAttributePartCount(
"src",
' ');
194 int i = (count > 1) ? 0 : -1;
197 attrib = wtag.getAttribute(
"src", i,
' ');
207 }
while (++i < count);
224 if (wtag.isEmpty()) {
226 for (j = (
int)token.
length()-1; ((j>0) && (strchr(
" /", token[j]))); j--);
234 if (wtag.isEmpty()) {
243 int count = wtag.getAttributePartCount(
"lemma",
' ');
244 for (
int i = 0; i < count; ++i) {
245 SWBuf a = wtag.getAttribute(
"lemma", i,
' ');
247 if ((prefix) && (!strcmp(prefix,
"x-Strongs") || !strcmp(prefix,
"strong") || !strcmp(prefix,
"Strong"))) {
249 wtag.setAttribute(
"lemma", 0, i,
' ');
267 tmp.
append(wordStart, (from-wordStart)-3);
268 sprintf(wordstr,
"%03d", wordNum-1);
unsigned long length() const
bool startsWith(const SWBuf &prefix) const
const char * c_str() const
SWBuf & append(const char *str, long max=-1)
#define SWDYNAMIC_CAST(className, object)
SWBuf & replaceBytes(const char *targets, char newByte)
unsigned long size() const
const char * stripPrefix(char separator, bool endOfStringAsSeparator=false)
virtual bool isProcessEntryAttributes() const
virtual AttributeTypeList & getEntryAttributes() const
SWBuf & setFormatted(const char *format,...)
virtual char getTestament() const