Class FileSeparatorQuerySource
java.lang.Object
org.aksw.iguana.cc.query.source.QuerySource
org.aksw.iguana.cc.query.source.impl.FileSeparatorQuerySource
- Direct Known Subclasses:
FileLineQuerySource
The FileSeparatorQuerySource reads queries from a file with
(multiline) queries that are separated by a separator.
- Author:
- frensing
-
Field Summary
Fields inherited from class org.aksw.iguana.cc.query.source.QuerySource
hashCode, path
-
Constructor Summary
ConstructorDescriptionFileSeparatorQuerySource
(Path path) This constructor indexes the queries inside the given file.FileSeparatorQuerySource
(Path path, String separator) This constructor indexes the queries inside the given file. -
Method Summary
Modifier and TypeMethodDescriptionThis method returns all queries in the source as a list of Strings.getQuery
(int index) This method returns the query at the given index.getQueryStream
(int index) int
size()
This method returns the amount of queries in the source.Methods inherited from class org.aksw.iguana.cc.query.source.QuerySource
getPath, hashCode
-
Field Details
-
iqr
-
-
Constructor Details
-
FileSeparatorQuerySource
This constructor indexes the queries inside the given file. It assumes, that the queries inside the file are separated with the default separator ('###').- Parameters:
path
- path to the queries-file- Throws:
IOException
-
FileSeparatorQuerySource
This constructor indexes the queries inside the given file. Queries inside the file should be separated with the given separator string. If the separator string parameter is blank, it assumes that the queries inside the file are separated by blank lines.- Parameters:
path
- path to the queries-fileseparator
- string with which the queries inside the file are separated- Throws:
IOException
-
-
Method Details
-
size
public int size()Description copied from class:QuerySource
This method returns the amount of queries in the source.- Specified by:
size
in classQuerySource
- Returns:
- the number of queries in the source
-
getQuery
Description copied from class:QuerySource
This method returns the query at the given index.- Specified by:
getQuery
in classQuerySource
- Parameters:
index
- the index of the query counted from the first query (in the first file)- Returns:
- String of the query
- Throws:
IOException
- if the query could not be read
-
getQueryStream
- Specified by:
getQueryStream
in classQuerySource
- Throws:
IOException
-
getAllQueries
Description copied from class:QuerySource
This method returns all queries in the source as a list of Strings.- Specified by:
getAllQueries
in classQuerySource
- Returns:
- List of Strings of all queries
- Throws:
IOException
- if the queries could not be read
-