public static CollectionReaderDescription getDescription(String fileOrDir) throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( FilesCollectionReader.class, null, PARAM_ROOT_FILE, fileOrDir); }
@Override public CollectionReaderDescription getReaderDescription() throws ResourceInitializationException { return createReaderDescription(BinaryCasReader.class); }
public static CollectionReaderDescription getDescriptionFromFiles(Collection<File> files) throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( UriCollectionReader.class, null, PARAM_FILES, files); }
public static CollectionReaderDescription getDescriptionFromUris(Collection<URI> uris) throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( UriCollectionReader.class, null, PARAM_URIS, uris); }
public CollectionReaderDescription getTrainReader() throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription(PairTwentyNewsgroupsReader.class, PairTwentyNewsgroupsReader.PARAM_LISTFILE, listFilePathTrain, PairTwentyNewsgroupsReader.PARAM_LANGUAGE_CODE, languageCode); }
private static CollectionReaderDescription getTrainReader() throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( ReutersCorpusReader.class, ReutersCorpusReader.PARAM_SOURCE_LOCATION, documentTrainFolderReuters, ReutersCorpusReader.PARAM_GOLD_LABEL_FILE, documentGoldLabelsReuters, ReutersCorpusReader.PARAM_LANGUAGE, "en", ReutersCorpusReader.PARAM_PATTERNS, ReutersCorpusReader.INCLUDE_PREFIX + "*.txt"); }
private static CollectionReaderDescription getTrainReader() throws Exception { return CollectionReaderFactory.createReaderDescription( FolderwiseDataReader.class, FolderwiseDataReader.PARAM_SOURCE_LOCATION, corpusFilePathTrain, FolderwiseDataReader.PARAM_LANGUAGE, LANGUAGE_CODE, FolderwiseDataReader.PARAM_PATTERNS, "*/*.txt"); }
private static CollectionReaderDescription getTestReader() throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( TeiReader.class, TeiReader.PARAM_LANGUAGE, "en", TeiReader.PARAM_SOURCE_LOCATION, corpusFilePathTest, TeiReader.PARAM_PATTERNS, "*.xml"); }
public CollectionReaderDescription getReaderTrain() throws Exception { return CollectionReaderFactory.createReaderDescription(FolderwiseDataReader.class, FolderwiseDataReader.PARAM_SOURCE_LOCATION, corpusFilePathTrain, FolderwiseDataReader.PARAM_LANGUAGE, LANGUAGE_CODE, FolderwiseDataReader.PARAM_PATTERNS, "*/*.txt"); }
@Override public CollectionReaderDescription getReaderDescription() throws ResourceInitializationException { return createReaderDescription(WebannoTsv3Reader.class); }
@Override public CollectionReaderDescription getReaderDescription() throws ResourceInitializationException { return createReaderDescription(LineOrientedTextReader.class); } }
@Override public CollectionReaderDescription getReaderDescription() throws ResourceInitializationException { return createReaderDescription(TextReader.class); }
@Override public CollectionReaderDescription getCollectionReaderDescription(TaskContext aContext) throws ResourceInitializationException, IOException { CollectionReaderDescription readerDesc = createReaderDescription(readerTrain, readerTrainParams.toArray()); return readerDesc; }
private static CollectionReaderDescription getTestReader() throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( TeiReader.class, TeiReader.PARAM_LANGUAGE, "en", TeiReader.PARAM_SOURCE_LOCATION, corpusFilePathTrain, TeiReader.PARAM_PATTERNS, asList(INCLUDE_PREFIX + "a01.xml")); }
private static CollectionReaderDescription getTrainReader() throws ResourceInitializationException { return CollectionReaderFactory.createReaderDescription( TeiReader.class, TeiReader.PARAM_LANGUAGE, "en", TeiReader.PARAM_SOURCE_LOCATION, corpusFilePathTrain, TeiReader.PARAM_PATTERNS, asList(INCLUDE_PREFIX + "a01.xml")); }
@Override public CollectionReaderDescription getCollectionReaderDescription(TaskContext aContext) throws ResourceInitializationException, IOException { Class<? extends CollectionReader> reader = isTesting ? readerTest : readerTrain; List<Object> readerParams = isTesting ? readerTestParams : readerTrainParams; CollectionReaderDescription readerDesc = createReaderDescription(reader, readerParams.toArray()); return readerDesc; }
/** * @param readerClass Collection Reader class * @param parameters parameters for the main component * @return Description with specified parameters plus those loaded from properties * @throws ResourceInitializationException if UimaFit has a problem */ public CollectionReaderDescription createReaderDescription( final Class<? extends CollectionReader> readerClass, final Object... parameters ) throws ResourceInitializationException { final Object[] allParameters = getAllParameters( parameters ); return CollectionReaderFactory.createReaderDescription( readerClass, allParameters ); }
public static void testRoundTrip(Class<? extends CollectionReader> aReader, Class<? extends AnalysisComponent> aWriter, String aFile, TestOptions aOptions) throws Exception { testOneWay(createReaderDescription(aReader), createEngineDescription(aWriter), aFile, aFile, aOptions); }
public static void testOneWay(CollectionReaderDescription aReader, String aExpectedFile, String aFile) throws Exception { testOneWay(aReader, aExpectedFile, aFile, null); }
public static void testOneWay(CollectionReaderDescription aReader, String aExpectedFile, String aFile) throws Exception { testOneWay(aReader, aExpectedFile, aFile, null); }