资源简介
用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 < minwordlimit) || (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个文件信息
相关资源
- 操作系统c语言模拟文件管理系统844
- C语言开发实战宝典
- C++中头文件与源文件的作用详解
- C语言代码高亮html输出工具
- 猜数字游戏 c语言代码
- C语言课程设计
- 数字电位器C语言程序
- CCS FFT c语言算法
- 使用C语言编写的病房管理系统
- 通信过程中的RS编译码程序(c语言)
- 计算机二级C语言上机填空,改错,编
- 用回溯法解决八皇后问题C语言实现
- 简易教务管理系统c语言开发文档
- 操作系统课设 读写者问题 c语言实现
- 小波变换算法 c语言版
- C流程图生成器,用C语言代码 生成C语
- 3des加密算法C语言实现
- 简单的C语言点对点聊天程序
- 单片机c语言源程序(51定时器 八个按
- 个人日常财务管理系统(C语言)
- c语言电子商务系统
- 小甲鱼C语言课件 源代码
- 将图片转换为C语言数组的程序
- C语言实现的一个内存泄漏检测程序
- DES加密算法C语言实现
- LINUX下命令行界面的C语言细胞游戏
- 用单片机控制蜂鸣器播放旋律程序(
- 学校超市选址问题(数据结构C语言版
- 电子时钟 有C语言程序,PROTEUS仿真图
- 尚观培训linux许巍老师关于c语言的课
评论
共有 条评论