Class DUUIYouTubeReader
java.lang.Object
org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIYouTubeReader
- All Implemented Interfaces:
DUUICollectionReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionDUUIYouTubeReader(String youtubeLink, String apiKey) DUUIYouTubeReader(String youtubeLink, String apiKey, String viewName) DUUIYouTubeReader(String youtubeLink, String apiKey, String viewName, int debugCount, int iRandom, boolean bAddMetadata, String language) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFilesToConcurrentList(File folder, String ending, ConcurrentLinkedQueue<String> paths) formatSize(long lSize) longgetDone()How many JCas have already been processed?voidgetNextCas(org.apache.uima.jcas.JCas empty) Fill and get the next JCasGet the ProgresslonggetSize()Get size of CollectionbooleanhasNext()Are there still cas to be processed?static intparseToSeconds(String input) static ConcurrentLinkedQueue<org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIYouTubeReader.YouTubeVideo> random(ConcurrentLinkedQueue<org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIYouTubeReader.YouTubeVideo> videos, int iRandom) voidreset()static ConcurrentLinkedQueue<String> skipBySize(ConcurrentLinkedQueue<String> paths, int skipSmallerFiles) Skips files smaller than skipSmallerFilesstatic ConcurrentLinkedQueue<String> sortBySize(ConcurrentLinkedQueue<String> paths)
-
Constructor Details
-
DUUIYouTubeReader
public DUUIYouTubeReader(String youtubeLink, String apiKey) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
DUUIYouTubeReader
public DUUIYouTubeReader(String youtubeLink, String apiKey, String viewName) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
DUUIYouTubeReader
public DUUIYouTubeReader(String youtubeLink, String apiKey, String viewName, int debugCount, int iRandom, boolean bAddMetadata, String language) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
-
Method Details
-
addFilesToConcurrentList
public static void addFilesToConcurrentList(File folder, String ending, ConcurrentLinkedQueue<String> paths) -
sortBySize
-
skipBySize
public static ConcurrentLinkedQueue<String> skipBySize(ConcurrentLinkedQueue<String> paths, int skipSmallerFiles) Skips files smaller than skipSmallerFiles- Parameters:
paths- paths to filesskipSmallerFiles- skip files smaller than this value in bytes- Returns:
- filtered paths to files
-
random
public static ConcurrentLinkedQueue<org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIYouTubeReader.YouTubeVideo> random(ConcurrentLinkedQueue<org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIYouTubeReader.YouTubeVideo> videos, int iRandom) -
getProgress
Description copied from interface:DUUICollectionReaderGet the Progress- Specified by:
getProgressin interfaceDUUICollectionReader- Returns:
-
getNextCas
public void getNextCas(org.apache.uima.jcas.JCas empty) Description copied from interface:DUUICollectionReaderFill and get the next JCas- Specified by:
getNextCasin interfaceDUUICollectionReader- Parameters:
empty-
-
reset
public void reset() -
hasNext
public boolean hasNext()Description copied from interface:DUUICollectionReaderAre there still cas to be processed?- Specified by:
hasNextin interfaceDUUICollectionReader- Returns:
-
getSize
public long getSize()Description copied from interface:DUUICollectionReaderGet size of Collection- Specified by:
getSizein interfaceDUUICollectionReader- Returns:
-
getDone
public long getDone()Description copied from interface:DUUICollectionReaderHow many JCas have already been processed?- Specified by:
getDonein interfaceDUUICollectionReader- Returns:
-
formatSize
-
parseToSeconds
-