org.terrier.structures
Class FSOMapFileLexicon

java.lang.Object
  extended by org.terrier.structures.Lexicon<java.lang.String>
      extended by org.terrier.structures.MapLexicon
          extended by org.terrier.structures.FSOMapFileLexicon
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<java.util.Map.Entry<java.lang.String,LexiconEntry>>

public class FSOMapFileLexicon
extends MapLexicon

Instance of a Lexicon where a FSOrderedMapFile is always used as a backing store.

Index Properties:

Since:
3.0
Author:
Craig Macdonald

Nested Class Summary
static class FSOMapFileLexicon.MapFileLexiconEntryIterator
          Iterate through the values in order
static class FSOMapFileLexicon.MapFileLexiconIterator
          An iterator over the lexicon
 
Nested classes/interfaces inherited from class org.terrier.structures.MapLexicon
MapLexicon.Id2EntryIndexLookup, MapLexicon.IdIsIndex
 
Field Summary
 
Fields inherited from class org.terrier.structures.MapLexicon
keyFactory
 
Constructor Summary
FSOMapFileLexicon(java.lang.String structureName, Index index)
          Construct a new FSOMapFileLexicon
FSOMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix, FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory, FixedSizeWriteableFactory<LexiconEntry> _valueFactory, java.lang.String termIdLookup, java.lang.String termLookup, java.lang.String dataFile)
          Construct an instance of the class with
 
Method Summary
 void close()
          
static java.lang.String constructFilename(java.lang.String structureName, java.lang.String path, java.lang.String prefix, java.lang.String extension)
          Constructs a filename
static void deleteMapFileLexicon(java.lang.String structureName, java.lang.String path, java.lang.String prefix)
          Delete a FSOMapFileLexicon within the specified index location
 java.util.Iterator<java.util.Map.Entry<java.lang.String,LexiconEntry>> iterator()
          
static void optimise(java.lang.String structureName, Index index, LexiconBuilder.CollectionStatisticsCounter statsCounter)
          Does two things to a FSOMapFileLexicon: adds the termid lookup file (if required), and also creates the lexicon has file.
static void optimise(java.lang.String structureName, Index index, LexiconBuilder.CollectionStatisticsCounter statsCounter, int numEntries)
          optimise
static void renameMapFileLexicon(java.lang.String SrcStructureName, java.lang.String SrcPath, java.lang.String SrcPrefix, java.lang.String destStructureName, java.lang.String destPath, java.lang.String destPrefix)
          Rename a FSOMapFileLexicon within the specified index location
 
Methods inherited from class org.terrier.structures.MapLexicon
getIthLexiconEntry, getLexiconEntry, getLexiconEntry, numberOfEntries, setTermIdLookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSOMapFileLexicon

public FSOMapFileLexicon(java.lang.String structureName,
                         Index index)
                  throws java.io.IOException
Construct a new FSOMapFileLexicon

Throws:
java.io.IOException

FSOMapFileLexicon

public FSOMapFileLexicon(java.lang.String structureName,
                         java.lang.String path,
                         java.lang.String prefix,
                         FixedSizeWriteableFactory<org.apache.hadoop.io.Text> _keyFactory,
                         FixedSizeWriteableFactory<LexiconEntry> _valueFactory,
                         java.lang.String termIdLookup,
                         java.lang.String termLookup,
                         java.lang.String dataFile)
                  throws java.io.IOException
Construct an instance of the class with

Parameters:
structureName -
path -
prefix -
_keyFactory -
_valueFactory -
termIdLookup -
termLookup -
dataFile -
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Description copied from class: MapLexicon

Specified by:
close in interface java.io.Closeable
Overrides:
close in class MapLexicon
Throws:
java.io.IOException

iterator

public java.util.Iterator<java.util.Map.Entry<java.lang.String,LexiconEntry>> iterator()


optimise

public static void optimise(java.lang.String structureName,
                            Index index,
                            LexiconBuilder.CollectionStatisticsCounter statsCounter)
                     throws java.io.IOException
Does two things to a FSOMapFileLexicon: adds the termid lookup file (if required), and also creates the lexicon has file.

Parameters:
structureName - - name of the index structure that this FSOMapFileLexicon represents
index - - the index that the index belongs
Throws:
java.io.IOException - if an IO problem occurs

optimise

public static void optimise(java.lang.String structureName,
                            Index index,
                            LexiconBuilder.CollectionStatisticsCounter statsCounter,
                            int numEntries)
                     throws java.io.IOException
optimise

Parameters:
structureName -
index -
statsCounter -
numEntries -
Throws:
java.io.IOException

constructFilename

public static java.lang.String constructFilename(java.lang.String structureName,
                                                 java.lang.String path,
                                                 java.lang.String prefix,
                                                 java.lang.String extension)
Constructs a filename

Parameters:
structureName -
path -
prefix -
extension -
Returns:
filename

renameMapFileLexicon

public static void renameMapFileLexicon(java.lang.String SrcStructureName,
                                        java.lang.String SrcPath,
                                        java.lang.String SrcPrefix,
                                        java.lang.String destStructureName,
                                        java.lang.String destPath,
                                        java.lang.String destPrefix)
Rename a FSOMapFileLexicon within the specified index location


deleteMapFileLexicon

public static void deleteMapFileLexicon(java.lang.String structureName,
                                        java.lang.String path,
                                        java.lang.String prefix)
Delete a FSOMapFileLexicon within the specified index location



Terrier 3.5. Copyright © 2004-2011 University of Glasgow