欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

lucene-使用lius解析pdf、ppt、rtf、txt、xml

系統 1864 0

1、代碼

package liusextract;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;

import lius.index.pdf.PdfIndexer;
import lius.index.powerpoint.PPTIndexer;
import lius.index.rtf.RTFIndexer;
import lius.index.txt.TXTIndexer;
import lius.index.xml.XmlFileIndexer;


public class pptandpdftest {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//pdf
PdfIndexer pi=new PdfIndexer();
File f=new File("./htmls/readme.pdf");
try {
pi.setStreamToIndex(new FileInputStream(f));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String text1=pi.getContent().substring(0, 200);
System.out.println("pdf:"+text1);
//ppt
PPTIndexer ppi=new PPTIndexer();
f=new File("./htmls/123.ppt");
try {
ppi.setStreamToIndex(new FileInputStream(f));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String text2=ppi.getContent().substring(0, 200);
System.out.println("ppt:"+text2);
//rtf
RTFIndexer rti=new RTFIndexer();
f=new File("./htmls/111.rtf");
try {
rti.setStreamToIndex(new FileInputStream(f));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String text3=rti.getContent();
try {
text3=new String(text3.getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("rtf:"+text3);
//txt
TXTIndexer ti=new TXTIndexer();
f=new File("./htmls/readme.txt");
try {
ti.setStreamToIndex(new FileInputStream(f));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String text4=ti.getContent().substring(0, 200);
System.out.println("txt:"+text4);
//xml
XmlFileIndexer xmli=new XmlFileIndexer();
f=new File("./htmls/cd_catalog.xml");
try {
xmli.setStreamToIndex(new FileInputStream(f));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String text5=xmli.getContent();
try {
text5=new String(text5.getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("xml:"+text5);

}

}
2、效果

lucene-使用lius解析pdf、ppt、rtf、txt、xml

lucene-使用lius解析pdf、ppt、rtf、txt、xml


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 午夜小视频在线观看 | 97精品国产高清久久久久蜜芽 | 日本高清乱理伦片中文字幕啊 | 欧美五月 | 久久综合久色欧美综合狠狠 | 欧美成人免费高清二区三区 | 91茄子在线观看 | 欧美高清一区二区三区欧美 | 男女视频免费在线观看 | 偷拍亚洲制服另类无码专区 | 91免费在线看片 | 色老头永久免费视频 | 九草视频在线 | 青青草国产成人久久91网 | 国产五月色综合 | 深爱五月综合网 | 欧美一级毛片高清免费观看 | 国产在线观看91一区二区三区 | 一区在线视频 | 男女超猛烈啪啦啦的免费视频 | 国产亚洲一区二区三区在线观看 | 人妖一区 | www.天天草 | 久久九九综合 | 精品视频日本 | 九九热精品在线观看 | 国产精品亚洲精品青青青 | 亚洲视频毛片 | 国产做国产爱免费视频 | 久久综合婷婷香五月 | 日本中文字幕免费 | 久久99国产精品久久99无号码 | 亚洲第一黄色网址 | 久草欧美视频 | 国产成人综合一区精品 | 午夜小视频免费观看 | 亚洲视频免费在线观看 | 久久99精品热在线观看15 | 三级黄色一级视频 | 在线观看a视频 | 涩涩撸 |