|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.utility.ApplicationSetup
public class ApplicationSetup
This class retrieves and provides access
to all the constants and parameters for
the system. When it is statically initialised,
it loads the properties file specified by the system property
terrier.setup. If this is not specified, then the default value is
the value of the terrier.home system property, appended by etc/terrier.properties.
eg java -D terrier.home=$TERRIER_HOME -Dterrier.setup=$TERRIER_HOME/etc/terrier.properties TrecTerrier
System Properties used:
terrier.setup | Specifies where the terrier.properties file can be found. |
terrier.home | Specified where Terrier has been installed, if the terrier.properties
file cannot be found, or the terrier.properties file does not specify the terrier.home in it.
NB:In the future, this may further default to $TERRIER_HOME from the environment. |
file.separator | What separates directory names in this platform. Set automatically by Java |
line.separator | What separates lines in a file on this platform. Set automatically by Java |
In essence, for Terrier to function properly, you need to specify one of the following on the command line:
Any property defined in the properties file can be overridden as follows:
Nested Class Summary | |
---|---|
static interface |
ApplicationSetup.TerrierApplicationPlugin
|
Field Summary | |
---|---|
static boolean |
BLOCK_INDEXING
Specifies whether block information will be used for indexing. |
static int |
BLOCK_SIZE
The size of a block of terms in a document. |
static int |
BUNDLE_SIZE
The number of documents to be processed as a group during indexing. |
static java.lang.String |
COLLECTION_SPEC
The name of the file that contains the list of resources to be processed during indexing. |
static java.lang.String |
DEFAULT_LOG4J_CONFIG
Default log4j config Terrier loads if no TERRIER_ETC/terrier-log.xml file exists |
static java.lang.String |
DF_SUFFIX
The suffix of the direct index. |
static java.lang.String |
DIRECT_FILENAME
The filename of the direct file. |
static java.lang.String |
DOC_INDEX_SUFFIX
The suffix of the file that contains the document index. |
static int |
DOCNO_BYTE_LENGTH
The number of bytes used to store a document number. |
static int |
DOCS_CHECK_SINGLEPASS
Number of documents between each memory check in the single pass inversion method. |
static java.lang.String |
DOCUMENT_INDEX_FILENAME
The filename of the document index. |
static java.lang.String |
EOL
The new line character used by the operating system. |
static int |
EXPANSION_DOCUMENTS
The number of top ranked documents considered for expanding the query. |
static java.lang.String |
EXPANSION_MODELS
The name of the file which contains the query expansion methods used. |
static int |
EXPANSION_TERMS
The number of terms added to the original query. |
static boolean |
FIELD_QUERYING
Specifies whether fields will be used for querying. |
static java.lang.String |
FILE_SEPARATOR
The file separator used by the operating system. |
static java.lang.String |
IFSUFFIX
The suffix of the inverted file. |
static boolean |
IGNORE_EMPTY_DOCUMENTS
Ignore or not empty documents. |
static java.lang.String |
INVERTED_FILENAME
The filename of the inverted file. |
static java.lang.String |
LEXICON_FILENAME
The filename of the lexicon file. |
static java.lang.String |
LEXICON_HASH_SUFFIX
The suffix of the lexicon hash file. |
static java.lang.String |
LEXICON_INDEX_FILENAME
The filename of the lexicon index file. |
static java.lang.String |
LEXICON_INDEX_SUFFIX
The suffix of the lexicon index file that contains the offset of each term in the lexicon. |
static java.lang.String |
LEXICONSUFFIX
The suffix of the file that contains the lexicon. |
static java.lang.String |
LOG_FILENAME
The filename of the log (statistics) file. |
static java.lang.String |
LOG_SUFFIX
The suffix of the file that contains the collection statistics. |
static java.lang.String |
LOG4J_CONFIG
The configuration file used by log4j |
static int |
MAX_BLOCKS
The maximum number of blocks in a document. |
static int |
MAX_TERM_LENGTH
The maximum size of a term. |
static int |
MEMORY_THRESHOLD_SINGLEPASS
Memory threshold in the single pass inversion method. |
static java.lang.String |
MERGE_PREFIX
The prefix of the temporary merged files, which are created during merging the lexicon files. |
static int |
MERGE_TEMP_NUMBER
A progressive number which is assigned to the temporary lexicon files built during the indexing. |
static java.lang.String |
PROPERTIES_SUFFIX
The suffix of the file that contains the index properties. |
static int |
STRING_BYTE_LENGTH
The number of bytes used to store a term. |
static java.lang.String |
TERRIER_ETC
The directory under which the configuration files of Terrier are stored. |
static java.lang.String |
TERRIER_HOME
The directory under which the application is installed. |
static java.lang.String |
TERRIER_INDEX_PATH
The name of the directory where the inverted file and other data structures are stored. |
static java.lang.String |
TERRIER_INDEX_PREFIX
The prefix of the data structures' filenames. |
static java.lang.String |
TERRIER_SHARE
The name of the directory where installation independent read-only data is stored. |
static java.lang.String |
TERRIER_VAR
The name of the directory where the data structures and the output of Terrier are stored. |
static java.lang.String |
TERRIER_VERSION
|
static java.lang.String |
TREC_MODELS
The filename of the file that contains the weighting models to be used. |
static java.lang.String |
TREC_QRELS
The name of the file that contains a list of qrels files to be used for evaluation. |
static java.lang.String |
TREC_RESULTS
The name of the directory where the results are stored. |
static java.lang.String |
TREC_RESULTS_SUFFIX
The suffix of the files, where the results are stored. |
static java.lang.String |
TREC_TOPICS_LIST
The name of the file that contains a list of files where queries are stored. |
Constructor Summary | |
---|---|
ApplicationSetup()
|
Method Summary | |
---|---|
static void |
configure(java.io.InputStream propertiesStream)
|
ApplicationSetup.TerrierApplicationPlugin |
getPlugin(java.lang.String name)
Return a loaded plugin by name. |
static java.util.Properties |
getProperties()
|
static java.lang.String |
getProperty(java.lang.String propertyKey,
java.lang.String defaultValue)
Returns the value for the specified property, given a default value, in case the property was not defined during the initialization of the system. |
static java.util.Properties |
getUsedProperties()
Returns a properties object detailing all the properties fetched during the lifetime of this class. |
static void |
loadCommonProperties()
|
static java.lang.String |
makeAbsolute(java.lang.String filename,
java.lang.String DefaultPath)
Checks whether the given filename is absolute and if not, it adds on the default path to make it absolute. |
static void |
setDefaultProperty(java.lang.String propertyKey,
java.lang.String defaultValue)
set a property value only if it has not already been set |
static void |
setProperty(java.lang.String propertyKey,
java.lang.String value)
Sets a value for the specified property. |
static void |
setupFilenames()
Sets up the names of the inverted file, the direct file, the document index file and the lexicon file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TERRIER_VERSION
public static final java.lang.String DEFAULT_LOG4J_CONFIG
public static java.lang.String FILE_SEPARATOR
public static java.lang.String EOL
public static java.lang.String TERRIER_HOME
public static java.lang.String TERRIER_ETC
public static java.lang.String TERRIER_SHARE
public static java.lang.String TERRIER_VAR
public static java.lang.String TERRIER_INDEX_PATH
public static java.lang.String COLLECTION_SPEC
public static java.lang.String TREC_RESULTS
public static java.lang.String TREC_TOPICS_LIST
public static java.lang.String TREC_QRELS
public static java.lang.String TREC_RESULTS_SUFFIX
public static java.lang.String TREC_MODELS
public static java.lang.String IFSUFFIX
public static java.lang.String LEXICONSUFFIX
public static java.lang.String DOC_INDEX_SUFFIX
public static java.lang.String LEXICON_INDEX_SUFFIX
public static java.lang.String LEXICON_HASH_SUFFIX
public static java.lang.String LOG_SUFFIX
public static java.lang.String PROPERTIES_SUFFIX
public static java.lang.String DF_SUFFIX
public static java.lang.String MERGE_PREFIX
public static int MERGE_TEMP_NUMBER
public static int BUNDLE_SIZE
public static int STRING_BYTE_LENGTH
public static int DOCNO_BYTE_LENGTH
public static int MAX_TERM_LENGTH
public static boolean IGNORE_EMPTY_DOCUMENTS
public static java.lang.String TERRIER_INDEX_PREFIX
public static java.lang.String INVERTED_FILENAME
public static java.lang.String DIRECT_FILENAME
public static java.lang.String DOCUMENT_INDEX_FILENAME
public static java.lang.String LEXICON_FILENAME
public static java.lang.String LEXICON_INDEX_FILENAME
public static java.lang.String LOG_FILENAME
public static int EXPANSION_TERMS
public static int EXPANSION_DOCUMENTS
public static java.lang.String EXPANSION_MODELS
public static int BLOCK_SIZE
public static int MAX_BLOCKS
public static boolean BLOCK_INDEXING
public static boolean FIELD_QUERYING
public static int MEMORY_THRESHOLD_SINGLEPASS
public static int DOCS_CHECK_SINGLEPASS
public static java.lang.String LOG4J_CONFIG
Constructor Detail |
---|
public ApplicationSetup()
Method Detail |
---|
public static void loadCommonProperties()
public static void configure(java.io.InputStream propertiesStream) throws java.io.IOException
java.io.IOException
public static java.lang.String getProperty(java.lang.String propertyKey, java.lang.String defaultValue)
propertyKey
- The property to be returneddefaultValue
- The default value used, in case it is not defined
public static java.util.Properties getUsedProperties()
public static java.util.Properties getProperties()
public static void setProperty(java.lang.String propertyKey, java.lang.String value)
propertyKey
- the name of the property to set.value
- the value of the property to set.public static void setDefaultProperty(java.lang.String propertyKey, java.lang.String defaultValue)
propertyKey
- the name of the property to set.defaultValue
- the value of the property to set.public static void setupFilenames()
public ApplicationSetup.TerrierApplicationPlugin getPlugin(java.lang.String name)
public static java.lang.String makeAbsolute(java.lang.String filename, java.lang.String DefaultPath)
filename
- String the filename to make absoluteDefaultPath
- String the prefix to add
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |