This method processes and appropriately modifies the text given it for a particular filter task
46 char val[128], *valto;
48 const char *currentPhrase = 0;
49 const char *currentPhraseEnd = 0;
53 for (from = text.
c_str(); *from; from++) {
55 if (currentPhrase == 0) {
60 if ((!isalpha(*from)) && (*from !=
' ') && (*from !=
'+') && (*from !=
'(') && (*from !=
')') && (*from !=
'\'')) {
62 if (!currentPhraseEnd)
63 currentPhraseEnd = from - 1;
64 for (; *from && *from !=
'>'; from++) {
65 if (!strncmp(from,
"value=\"", 7)) {
68 for (
unsigned int i = 0; from[i] !=
'\"' && i < 127; i++)
71 sprintf(wordstr,
"%03d", number+1);
80 phrase.append(currentPhrase, (
int)(((currentPhraseEnd>currentPhrase)?currentPhraseEnd:from) - currentPhrase)-1);
82 while (*from && isdigit(*from)) from++;
84 freq.append(currentPhrase, (
int)(from - currentPhrase));
85 if ((freq.length() > 0) && (phrase.length() > 0)) {
86 sprintf(wordstr,
"%03d", ++number);
87 if ((strchr(phrase.c_str(),
'(') > phrase.c_str()) && (strchr(phrase.c_str(),
')') > phrase.c_str() + 1)) {
88 string tmp = phrase.substr(0, phrase.find_first_of(
"("));
89 phrase.erase(phrase.find_first_of(
"("), 1);
90 phrase.erase(phrase.find_first_of(
")"), 1);
91 phrase.erase(0,phrase.find_first_not_of(
"\r\n\v\t ")); phrase.erase(phrase.find_last_not_of(
"\r\n\v\t ")+1);
95 phrase.erase(0,phrase.find_first_not_of(
"\r\n\v\t ")); phrase.erase(phrase.find_last_not_of(
"\r\n\v\t ")+1);
96 freq.erase(0,freq.find_first_not_of(
"\r\n\v\t ")); freq.erase(freq.find_last_not_of(
"\r\n\v\t ")+1);
100 currentPhraseEnd = 0;
104 if (*from ==
';') inAV =
false;
107 else if (!strncmp(from,
"AV-", 3)) {
const char * c_str() const
virtual bool isProcessEntryAttributes() const
virtual AttributeTypeList & getEntryAttributes() const