資源簡介
用C語言寫的C搜索引擎含多種建立索引的方式,相信對學習C語言和搜索引擎的朋友有很大的幫助

代碼片段和文件信息
/*
**?Copyright?(C)?1995?1996?1997?1998?Hewlett-Packard?Company
**?Originally?by?Kevin?Hughes?kev@kevcom.com?3/11/94
**
**?This?program?and?library?is?free?software;?you?can?redistribute?it?and/or
**?modify?it?under?the?terms?of?the?GNU?(Library)?General?Public?License
**?as?published?by?the?Free?Software?Foundation;?either?version?2
**?of?the?License?or?any?later?version.
**
**?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?(Library)?General?Public?License?for?more?details.
**
**?You?should?have?received?a?copy?of?the?GNU?(Library)?General?Public?License
**?along?with?this?program;?if?not?write?to?the?Free?Software
**?Foundation?Inc.?59?Temple?Place?-?Suite?330?Boston?MA??02111-1307?USA.
*/
#include?“swish.h“
#include?“check.h“
#include?“hash.h“
/*?Check?if?a?file?with?a?particular?suffix?should?be?indexed
**?according?to?the?settings?in?the?configuration?file.
*/
/*?Should?a?word?be?indexed??Consults?the?stopword?hash?list
**?and?checks?if?the?word?is?of?a?reasonable?length...
**?If?you?have?any?good?rules?that?can?work?with?most?languages
**?please?let?me?know...
*/
int?isokword(word)
??????char?*word;
{
int?i?same?hasnumber?hasvowel?hascons
numberrow?vowelrow?consrow?wordlen;
char?lastchar;
if?(word[0]?==?‘\0‘)
return?0;
if?(isstopword(word))
return?0;
wordlen?=?strlen(word);
if?((wordlen??maxwordlimit))
return?0;
lastchar?=?‘:‘;
same?=?0;
hasnumber?=?hasvowel?=?hascons?=?0;
numberrow?=?vowelrow?=?consrow?=?0;
for?(i?=?0;?word[i]?!=?‘\0‘;?i++)?{
if?(word[i]?==?lastchar)?{
same++;
if?(same?>?IGNORESAME)
return?0;
}
else
same?=?0;
if?(isdigit(word[i]))?{
hasnumber?=?1;
numberrow++;
if?(numberrow?>?IGNOREROWN)
return?0;
vowelrow?=?0;
consrow?=?0;
}
else?if?(isvowel(word[i]))?{
hasvowel?=?1;
vowelrow++;
if?(vowelrow?>?IGNOREROWV)
return?0;
numberrow?=?0;
consrow?=?0;
}
else?if?(!ispunct(word[i]))?{
hascons?=?1;
consrow++;
if?(consrow?>?IGNOREROWC)
return?0;
numberrow?=?0;
vowelrow?=?0;
}
lastchar?=?word[i];
}
if?(IGNOREALLV)
if?(hasvowel?&&?!hascons)
return?0;
if?(IGNOREALLC)
if?(hascons?&&?!hasvowel)
return?0;
if?(IGNOREALLN)
if?(hasnumber?&&?!hasvowel?&&?!hascons)
return?0;
return?1;
}
/*?Does?a?word?have?valid?characters?
*/
int?hasokchars(word)
?????char?*word;
{
int?i?j;
char?c;
c?=?word[strlen(word)?-?1];
for?(i?=?j?=?0;?beginchars[i]?!=?‘\0‘;?i++)
if?(word[0]?==?beginchars[i])
j++;
if?(!j)
return?0;
for?(i?=?j?=?0;?endchars[i]?!=?‘\0‘;?i++)
if?(c?==?endchars[i])
j++;
if?(!j)
return?0;
for?(i?=?0;?word[i]?!=?‘\0‘;?i++)
for?(j?=?0;?wordchars[j]?!=?‘\0‘;?j++)
if?(word[i]?==?wordchars[j])
return?1;
return?0;
}
/*?Is?a?letter?a?vowel?
*/
int?isvowel(char?c)
{
if?(c?==?‘a‘?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3140??1998-12-02?02:23??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\check.c
?????文件???????1081??1998-12-01?07:09??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\check.h
?????文件???????9319??1998-12-12?05:12??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\config.h
?????文件???????7911??1998-12-02?03:45??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\docprop.c
?????文件???????1025??1998-12-02?03:11??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\docprop.h
?????文件???????1048??1998-12-01?07:10??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\error.c
?????文件???????1024??1998-12-01?07:10??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\error.h
?????文件??????12070??1998-12-12?02:54??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\file.c
?????文件???????1849??1998-12-02?02:11??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\file.h
?????文件??????10286??1999-01-07?02:27??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\fs.c
?????文件???????5202??1998-12-01?07:11??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\hash.c
?????文件???????1423??1998-12-01?07:11??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\hash.h
?????文件??????12463??1999-01-07?02:34??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\http.c
?????文件????????722??1998-12-01?07:12??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\http.h
?????文件??????10043??1998-12-01?07:12??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\httpserver.c
?????文件????????635??1998-12-01?07:13??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\httpserver.h
?????文件??????29670??1998-12-15?03:04??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\index.c
?????文件???????2475??1998-12-01?07:13??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\index.h
?????文件???????3004??1999-01-07?03:46??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\index.swish
?????文件???????1297??1998-12-01?07:13??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\list.c
?????文件???????1053??1998-12-01?07:13??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\list.h
?????文件???????1216??1999-01-07?02:17??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\Makefile
?????文件???????1440??1998-12-01?07:14??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\mem.c
?????文件???????1091??1998-12-01?07:14??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\mem.h
?????文件??????23634??1998-12-01?07:14??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\merge.c
?????文件???????4077??1998-12-01?07:14??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\merge.h
?????文件????????501??1999-01-07?02:07??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\methods.c
?????文件???????4182??1999-03-19?00:37??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\README-SWISH-E
?????文件??????28461??1998-12-01?07:15??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\search.c
?????文件???????2613??1998-12-01?07:15??用C語言寫的C搜索引擎含多種建立索引的方式swish-efiles.1.3.2\src\search.h
............此處省略20個文件信息
評論
共有 條評論