本文整理汇总了Java中org.galagosearch.core.parse.IndexReaderSplitParser类的典型用法代码示例。如果您正苦于以下问题:Java IndexReaderSplitParser类的具体用法?Java IndexReaderSplitParser怎么用?Java IndexReaderSplitParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IndexReaderSplitParser类属于org.galagosearch.core.parse包,在下文中一共展示了IndexReaderSplitParser类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testNextDocument
import org.galagosearch.core.parse.IndexReaderSplitParser; //导入依赖的package包/类
/**
* Test of nextDocument method, of class IndexReaderSplitParser.
*/
public void testNextDocument() throws Exception {
buildIndex();
DocumentSplit split = new DocumentSplit();
split.fileName = temporaryName;
split.fileType = "corpus";
split.startKey = new byte[0];
split.endKey = new byte[0];
// Open up the file:
IndexReaderSplitParser parser = new IndexReaderSplitParser(split);
// Check the document:
Document actual = parser.nextDocument();
assertNotNull(actual);
assertEquals(document.identifier, actual.identifier);
assertEquals(document.text, actual.text);
assertEquals(2, actual.metadata.size());
assertNotNull(document.metadata.get("Key"));
assertNotNull(document.metadata.get("Something"));
assertEquals("Value", document.metadata.get("Key"));
assertEquals("Else", document.metadata.get("Something"));
// Make sure there aren't any left:
assertNull(parser.nextDocument());
}
示例2: testStartKey
import org.galagosearch.core.parse.IndexReaderSplitParser; //导入依赖的package包/类
public void testStartKey() throws FileNotFoundException, IOException {
buildIndex();
DocumentSplit split = new DocumentSplit();
split.fileName = temporaryName;
split.fileType = "corpus";
split.startKey = new byte[] { (byte) 'z' };
split.endKey = new byte[0];
// Open up the file:
IndexReaderSplitParser parser = new IndexReaderSplitParser(split);
assertNull(parser.nextDocument());
}
示例3: testEndKey
import org.galagosearch.core.parse.IndexReaderSplitParser; //导入依赖的package包/类
public void testEndKey() throws FileNotFoundException, IOException {
buildIndex();
DocumentSplit split = new DocumentSplit();
split.fileName = temporaryName;
split.fileType = "corpus";
split.startKey = new byte[0];
split.endKey = new byte[] { (byte) 'a' };
// Open up the file:
IndexReaderSplitParser parser = new IndexReaderSplitParser(split);
assertNull(parser.nextDocument());
}