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


Java DocumentStreamParser.getBufferedReader方法代码示例

本文整理汇总了Java中org.lemurproject.galago.core.parse.DocumentStreamParser.getBufferedReader方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentStreamParser.getBufferedReader方法的具体用法?Java DocumentStreamParser.getBufferedReader怎么用?Java DocumentStreamParser.getBufferedReader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lemurproject.galago.core.parse.DocumentStreamParser的用法示例。


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

示例1: process

import org.lemurproject.galago.core.parse.DocumentStreamParser; //导入方法依赖的package包/类
@Override
public void process(DocumentSplit doc) throws IOException {
    BufferedReader reader = DocumentStreamParser.getBufferedReader(doc);
    for (String str = reader.readLine();
            str != null;
            str = reader.readLine()) {

        String[] parts = str.split(delim);
        if (parts.length > 0) {
            String t = parts[0];
            long cf = 1;
            long dc = 1;
            long mxdf = 1;
            if (parts.length >= 2) {
                cf = Long.parseLong(parts[1]);
            }
            if (parts.length >= 3) {
                dc = Long.parseLong(parts[2]);
            }
            if (parts.length >= 4) {
                mxdf = Long.parseLong(parts[4]);
            }

            WordCount wc = new WordCount(ByteUtil.fromString(t), cf, dc, mxdf);
            processor.process(wc);

        }

    }
    reader.close();
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:32,代码来源:ParseWordCountString.java

示例2: readEach

import org.lemurproject.galago.core.parse.DocumentStreamParser; //导入方法依赖的package包/类
public static void readEach(List<DocumentSplit> splits, Operation<BufferedReader> action) throws IOException {
  for (DocumentSplit split : splits) {
    try (BufferedReader reader = DocumentStreamParser.getBufferedReader(split)) {
      action.process(reader);
    }
  }
}
 
开发者ID:jjfiv,项目名称:ecir2015timebooks,代码行数:8,代码来源:GalagoUtil.java

示例3: BufferedReaderParser

import org.lemurproject.galago.core.parse.DocumentStreamParser; //导入方法依赖的package包/类
public BufferedReaderParser(DocumentSplit split, Parameters p) throws IOException {
  super(split, p);
  this.reader = DocumentStreamParser.getBufferedReader(split);
  this.conf = p;
}
 
开发者ID:jjfiv,项目名称:ecir2015timebooks,代码行数:6,代码来源:BufferedReaderParser.java

示例4: DbpediaAbstractParser

import org.lemurproject.galago.core.parse.DocumentStreamParser; //导入方法依赖的package包/类
public DbpediaAbstractParser(DocumentSplit split, Parameters p) throws IOException {
  super(split, p);
  this.reader = DocumentStreamParser.getBufferedReader(split);
}
 
开发者ID:jjfiv,项目名称:ecir2015timebooks,代码行数:5,代码来源:DbpediaAbstractParser.java

示例5: SignalMediaJSONParser

import org.lemurproject.galago.core.parse.DocumentStreamParser; //导入方法依赖的package包/类
/**
 * This is the constructor expected by UniversalParser
 * It must be implemented in each implementing class
 *
 * @param split
 * @param p
 */
public SignalMediaJSONParser(DocumentSplit split, Parameters p) throws IOException {
  super(split, p);
  this.reader = DocumentStreamParser.getBufferedReader(split);
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:12,代码来源:SignalMediaJSONParser.java


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