|
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.TermCodes
public class TermCodes
This class is used for assigning codes to terms as we index a document collection.
It makes use of two properties from the default properties file. The first one is termcodes.initialcapacity, which specifies the initial capacity of the used hash map. The default value is 3000000.
The second property is termcodes.garbagecollect, which enables or disables garbage collection during the call of the method reset(). The default value is true.
Constructor Summary | |
---|---|
TermCodes()
|
Method Summary | |
---|---|
static int |
getCode(java.lang.String term)
Returns the code for a given term. |
static void |
initialise()
Initialises the properties from the property file. |
static void |
reset()
Resets the hashmap that contains the mapping from the terms to the term ids. |
static void |
setTermCode(java.lang.String term,
int termCode)
For when you manually want to set the term for a given term, and you know that this term and termcodes do NOT exist, then you can use this method. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TermCodes()
Method Detail |
---|
public static void initialise()
public static final int getCode(java.lang.String term)
term
- String the term for which
the code will be returned.
public static void reset()
public static void setTermCode(java.lang.String term, int termCode)
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |