36
39
** please let me know...
42
int i, same, hasnumber, hasvowel, hascons,
43
numberrow, vowelrow, consrow, wordlen;
51
wordlen = strlen(word);
52
if ((wordlen < minwordlimit) || (wordlen > maxwordlimit))
57
hasnumber = hasvowel = hascons = 0;
58
numberrow = vowelrow = consrow = 0;
59
for (i = 0; word[i] != '\0'; i++) {
60
if (word[i] == lastchar) {
62
if (same > IGNORESAME)
67
if (isdigit((int)word[i])) {
70
if (numberrow > IGNOREROWN)
75
else if (isvowel(word[i])) {
78
if (vowelrow > IGNOREROWV)
83
else if (!ispunct((int)word[i])) {
86
if (consrow > IGNOREROWC)
95
if (hasvowel && !hascons)
98
if (hascons && !hasvowel)
101
if (hasnumber && !hasvowel && !hascons)
107
/* Does a word have valid characters?
115
** Obsolete. Let's use the lookuptable
118
c = word[strlen(word) - 1];
119
for (i = j = 0; beginchars[i] != '\0'; i++)
120
if (word[0] == beginchars[i])
125
if(!begincharslookuptable[(int)((unsigned char)word[0])]) return 0;
128
** Obsolete. Let's use the lookuptable
129
for (i = j = 0; endchars[i] != '\0'; i++)
130
if (c == endchars[i])
135
if(!endcharslookuptable[(int)((unsigned char)word[strlen(word)-1])]) return 0;
138
** Obsolete. Let's use the lookuptable
139
for (i = 0; word[i] != '\0'; i++)
140
for (j = 0; wordchars[j] != '\0'; j++)
141
if (word[i] == wordchars[j])
144
for (i = 0; word[i] != '\0'; i++)
145
if(iswordchar(word[i]))
151
/* Is a letter a vowel?
153
/* Obsolete - Now is a macro that uses a lookuptable
156
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
157
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U')
42
int isokword(sw, word, indexf)
61
if ( is_word_in_hash_table( indexf->header.hashstoplist, word ) )
64
wordlen = strlen(word);
65
if ((wordlen < indexf->header.minwordlimit) || (wordlen > indexf->header.maxwordlimit))
70
hasnumber = hasvowel = hascons = 0;
71
numberrow = vowelrow = consrow = 0;
73
for (i = 0; word[i] != '\0'; i++)
75
/* Max number of times a char can repeat in a word */
76
if (word[i] == lastchar)
79
if (same > IGNORESAME)
85
/* Max number of consecutive digits */
86
if (isdigit((int) ( (unsigned char) word[i])))
90
if (numberrow > IGNOREROWN)
96
/* maximum number of consecutive vowels a word can have */
97
else if (isvowel(sw, word[i]))
101
if (vowelrow > IGNOREROWV)
107
/* maximum number of consecutive consonants a word can have */
108
else if (!ispunct((int) ( (unsigned char) word[i])))
112
if (consrow > IGNOREROWC)
120
/* If IGNOREALLV is 1, words containing all vowels won't be indexed. */
122
if (hasvowel && !hascons)
125
/* If IGNOREALLC is 1, words containing all consonants won't be indexed */
127
if (hascons && !hasvowel)
130
/* If IGNOREALLN is 1, words containing all digits won't be indexed */
132
if (hasnumber && !hasvowel && !hascons)
165
-- Check, if a filter is needed to retrieve information from a file
166
-- Returns NULL or path to filter prog according conf file.
140
-- Determine document type by checking the file extension
143
-- 2001-03-08 rasc rewritten (optimize and match also
144
-- e.g. ".htm", ".htm.de" or ".html.gz")
170
char *hasfilter (char *filename, struct filter *filterlist)
174
char *c, *checksuffix;
180
if (! fl) return (char *)NULL;;
181
if (! (c = (char *)strrchr(filename, '.')) ) return (char *) NULL;
183
lchecksuffix = strlen(c);
184
checksuffix=(char *) emalloc(lchecksuffix + 1);
185
strcpy(checksuffix, c);
188
if (lstrstr(fl->suffix, checksuffix)
189
&& strlen(fl->suffix) == lchecksuffix) {
147
int getdoctype(char *filename, struct IndexContents *indexcontents)
157
/* basically do a right to left compare */
158
fe = (filename + strlen(filename));
159
while (indexcontents)
161
swl = indexcontents->patt;
165
s = fe - strlen(swl->line);
167
{ /* no negative overflow! */
168
if (!strcasecmp(swl->line, s))
170
return indexcontents->DocType;;
176
indexcontents = indexcontents->next;
186
struct StoreDescription *hasdescription(int doctype, struct StoreDescription *sd)
190
if (sd->DocType == doctype)