代码拉取完成,页面将自动刷新
#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;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。