public class CorpusPathResolver extends Object
Modifier and Type | Field and Description |
---|---|
static int |
NUMBER_OF_SAMPLED_FILES
The number of files which are read for sampling when invoking
#findAppropriateImporters(URI) . |
static int |
NUMBER_OF_SAMPLED_LINES
The number of lines in a file which are read for sampling when invoking
#findAppropriateImporters(URI) . |
protected com.google.common.collect.Multimap<String,org.corpus_tools.pepper.impl.CorpusPathResolver.FileContent> |
readFilesGroupedByExtension |
protected com.google.common.collect.Multimap<String,File> |
unreadFilesGroupedByExtension |
Modifier | Constructor and Description |
---|---|
protected |
CorpusPathResolver() |
|
CorpusPathResolver(org.eclipse.emf.common.util.URI corpusPath) |
Modifier and Type | Method and Description |
---|---|
protected Collection<org.corpus_tools.pepper.impl.CorpusPathResolver.FileContent> |
getXFilesWithExtension(int numOfFiles,
int numOfLinesToRead,
String fileEnding) |
protected com.google.common.collect.Multimap<String,File> |
groupFilesByEnding(org.eclipse.emf.common.util.URI corpusPath)
Groups files for their file ending into a multimap.
|
protected String |
readFirstLines(File file,
int numOfLinesToRead)
Reads the first X lines of the passed file and returns them as a String
|
Collection<String> |
sampleFileContent(int numberOfSampledFiles,
int numberOfSampledLines,
String... fileEndings)
Returns
fileEndings lines of a sampled set of
numberOfSampledLines files having the ending specified by
fileEndings recursively from specified corpus path. |
Collection<String> |
sampleFileContent(String... fileEndings)
|
protected Collection<File> |
sampleFiles(Collection<File> files,
int numberOfSampledFiles)
Creates a sampled set of
numberOfSampledFiles files
recursively from directory dir with specified endings. |
protected void |
setCorpusPath(org.eclipse.emf.common.util.URI corpusPath) |
public static final int NUMBER_OF_SAMPLED_FILES
#findAppropriateImporters(URI)
.public static final int NUMBER_OF_SAMPLED_LINES
#findAppropriateImporters(URI)
.protected com.google.common.collect.Multimap<String,File> unreadFilesGroupedByExtension
protected com.google.common.collect.Multimap<String,org.corpus_tools.pepper.impl.CorpusPathResolver.FileContent> readFilesGroupedByExtension
protected CorpusPathResolver()
public CorpusPathResolver(org.eclipse.emf.common.util.URI corpusPath) throws FileNotFoundException
FileNotFoundException
protected void setCorpusPath(org.eclipse.emf.common.util.URI corpusPath) throws FileNotFoundException
FileNotFoundException
public Collection<String> sampleFileContent(String... fileEndings)
public Collection<String> sampleFileContent(int numberOfSampledFiles, int numberOfSampledLines, String... fileEndings)
fileEndings
lines of a sampled set of
numberOfSampledLines
files having the ending specified by
fileEndings
recursively from specified corpus path.numberOfSampledFiles
- number of files to be readnumberOfSampledLines
- number of lines to be readfileEnding
- ending to be considered. If no endings specified, all files
are considerednumberOfSampledLines
filesprotected com.google.common.collect.Multimap<String,File> groupFilesByEnding(org.eclipse.emf.common.util.URI corpusPath) throws FileNotFoundException
corpusPath
- FileNotFoundException
protected Collection<org.corpus_tools.pepper.impl.CorpusPathResolver.FileContent> getXFilesWithExtension(int numOfFiles, int numOfLinesToRead, String fileEnding)
protected Collection<File> sampleFiles(Collection<File> files, int numberOfSampledFiles)
numberOfSampledFiles
files
recursively from directory dir
with specified endings.dir
- the directory to be traversed recursivelynumberOfSampledFiles
- number of files to be sampledfileEndings
- endings of files to be sampledendings
in directory dir
Copyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.