1 Star 0 Fork 0

Smile/C2023

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.cc 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
Smile 提交于 2024-05-03 23:13 +08:00 . wu
#include "../include/pageLib.h"
#include "../include/PageLibPreprocessor.h"
#include "../include/queryPage.h"
#include "../include/queryPageWeb.h"
#include <iostream>
#include <string>
#include <vector>
#include <string.h>
#define PAGEPWD "../conf/page/"
using std::cerr;
using std::cout;
using std::endl;
using std::cin;
using std::string;
using std::vector;
void test()
{
querypageWeb qpw(PAGEPWD);
// qpw.start(); //注释掉将不会生成文件(耗时)
cout << "网页库建立完毕" << endl;
while(1)
{
vector<queryResult> qrs; //存数据到qrs里面,qrs是一个vector数组
string s;
cin >> s;
qpw.query(s,qrs); //s:用户查询词
for(auto &elem : qrs)
{
cout << "标题:" << elem.title << endl;
cout << "摘要:" << elem.description << endl;
cout << "链接:" << elem.link << endl;
cout << "正文:" << elem.content << endl;
}
cout << "*************" << endl;
}
}
int main()
{
test();
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yk-cr7/c2023.git
git@gitee.com:yk-cr7/c2023.git
yk-cr7
c2023
C2023
master

搜索帮助

371d5123 14472233 46e8bd33 14472233