当前位置: 首页>>代码示例>>Java>>正文


Java DefaultExtractor类代码示例

本文整理汇总了Java中de.l3s.boilerpipe.extractors.DefaultExtractor的典型用法代码示例。如果您正苦于以下问题:Java DefaultExtractor类的具体用法?Java DefaultExtractor怎么用?Java DefaultExtractor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DefaultExtractor类属于de.l3s.boilerpipe.extractors包,在下文中一共展示了DefaultExtractor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TargetModelElasticSearch

import de.l3s.boilerpipe.extractors.DefaultExtractor; //导入依赖的package包/类
public TargetModelElasticSearch(Page page) {
    this.url = page.getURL().toString();
    this.retrieved = new Date();
    this.domain = page.getDomainName();
    this.html = page.getContentAsString();
    this.responseHeaders = page.getResponseHeaders();
    this.topPrivateDomain = LinkRelevance.getTopLevelDomain(page.getDomainName());
    this.isRelevant = page.getTargetRelevance().isRelevant() ? "relevant" : "irrelevant";
    if (page.isHtml()) {
        this.words = page.getParsedData().getWords();
        this.wordsMeta = page.getParsedData().getWordsMeta();
        this.title = page.getParsedData().getTitle();
        this.relevance = page.getTargetRelevance().getRelevance();
        try {
            this.text = DefaultExtractor.getInstance().getText(page.getContentAsString());
        } catch (Exception e) {
            this.text = "";
        }
    }
}
 
开发者ID:ViDA-NYU,项目名称:ache,代码行数:21,代码来源:TargetModelElasticSearch.java

示例2: testBoilerpipe

import de.l3s.boilerpipe.extractors.DefaultExtractor; //导入依赖的package包/类
@Test
public void testBoilerpipe() throws IOException, BoilerpipeProcessingException{
	String plain = ArticleExtractor.getInstance().getText(_html);
	System.out.println("=== BEGIN BOILERPIPE OUTPUT 1 ===");
	System.out.println(plain);
	System.out.println("=== END BOILERPIPE OUTPUT 1 ===");
	
	plain = DefaultExtractor.getInstance().getText(_html);
	System.out.println("=== BEGIN BOILERPIPE OUTPUT 2 ===");
	System.out.println(plain);
	System.out.println("=== END BOILERPIPE OUTPUT 2 ===");
}
 
开发者ID:tudarmstadt-lt,项目名称:topicrawler,代码行数:13,代码来源:BoilerplateTests.java

示例3: extractHtml

import de.l3s.boilerpipe.extractors.DefaultExtractor; //导入依赖的package包/类
private void extractHtml(InputStream record, Document doc) throws TextExtractionException {
    try {
        BoundedInputStream in = new BoundedInputStream(record, maxDocSize);
        TextDocument textDoc = new BoilerpipeSAXInput(new InputSource(in)).getTextDocument();
        doc.setTitle(textDoc.getTitle());
        doc.setText(textDoc.getText(true, true).replace("\uFFFF", ""));
        if (boilingEnabled) {
            DefaultExtractor.INSTANCE.process(textDoc);
            doc.setBoiled(textDoc.getContent().replace("\uFFFF", ""));
        }
    } catch (SAXException | BoilerpipeProcessingException | IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
        throw new TextExtractionException(e);
    }
}
 
开发者ID:nla,项目名称:bamboo,代码行数:15,代码来源:TextExtractor.java

示例4: BoilerpipeContentHandler

import de.l3s.boilerpipe.extractors.DefaultExtractor; //导入依赖的package包/类
/**
 * Creates a new boilerpipe-based content extractor, using the
 * {@link DefaultExtractor} extraction rules and "delegate" as the content handler.
 *
 * @param delegate
 *            The {@link ContentHandler} object
 */
public BoilerpipeContentHandler(ContentHandler delegate) {
    this(delegate, DefaultExtractor.INSTANCE);
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:11,代码来源:BoilerpipeContentHandler.java


注:本文中的de.l3s.boilerpipe.extractors.DefaultExtractor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。