DocumentStreamParser implements Closeable { public static boolean hasParserForExtension(String ext) { return fileTypeMap.containsKey(ext); } DocumentStreamParser(DocumentSplit split, Parameters p); static boolean hasParserForExtension(String ext); static void addExternalParsers(Parameters parameters); @Deprecated static DocumentStreamParser instance(DocumentSplit split, Parameters parameters); static DocumentStreamParser create(DocumentSplit split, Parameters parameters); abstract Document nextDocument(); @Override abstract void close(); static BufferedReader getBufferedReader(DocumentSplit split); static BufferedInputStream getBufferedInputStream(DocumentSplit split); static String getFullPath(DocumentSplit split); static String getFileName(DocumentSplit split); static String getExtension(DocumentSplit split); static ConcurrentHashMap<String, Class> fileTypeMap; }
@Test public void sanity() { assertTrue(DocumentStreamParser.hasParserForExtension("trecweb")); assertTrue(DocumentStreamParser.hasParserForExtension("trectext")); }