Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

InvFPTypes.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 /* type definitions for objects we will use */
00014 #ifndef _INVFPTYPES_H
00015 #define _INVFPTYPES_H
00016 
00017 #include "common_headers.hpp"
00018 
00019 typedef int   FILEID_T;
00020 typedef int   TERMID_T;
00021 typedef TERMID_T LOC_T;  // for simplifying implementation of memory management, it's helpful for termid and location to be of the same type.
00022 typedef TERMID_T DOCID_T;
00023 typedef float SCORE_T;
00024 typedef char* TERM_T;
00025 typedef char* EXDOCID_T;
00026 
00027 // suffixes for filenames
00028 #define INVINDEX  ".invfp"
00029 #define INVLOOKUP  ".invlookup"
00030 #define DTINDEX  ".dt"
00031 #define DTLOOKUP  ".dtlookup"
00032 #define TERMIDMAP  ".tid"
00033 #define DOCIDMAP  ".did"
00034 #define MAINTOC  ".ifp"
00035 
00036 // what to call out of vocabulary ids
00037 #define INVALID_STR "[OOV]"
00038 
00039 // name for parameters
00040 #define NUMDOCS_PAR "NUM_DOCS"
00041 #define NUMTERMS_PAR "NUM_TERMS"
00042 #define NUMUTERMS_PAR "NUM_UNIQUE_TERMS"
00043 #define AVEDOCLEN_PAR "AVE_DOCLEN"
00044 #define INVINDEX_PAR  "INV_INDEX"
00045 #define INVLOOKUP_PAR  "INV_LOOKUP"
00046 #define DTINDEX_PAR  "DT_INDEX"
00047 #define DTLOOKUP_PAR  "DT_LOOKUP"
00048 #define TERMIDMAP_PAR  "TERMIDS"
00049 #define DOCIDMAP_PAR  "DOCIDS"
00050 #define NUMDT_PAR  "NUM_DTFILES"
00051 #define NUMINV_PAR  "NUM_INVFILES"
00052 
00053 struct LocatedTerm { // pair of term and its location
00054   TERMID_T term;
00055   LOC_T loc;
00056 };
00057 
00058 struct dt_entry {   // an entry in the lookup table for docterm lists index
00059   FILEID_T fileid;  // which file the word is in
00060   long offset;        // what the offset into the file is
00061   int length;         // the length of the inverted list
00062 };
00063 
00064 struct inv_entry {   // an entry in the lookup table for docterm lists index
00065   FILEID_T fileid;  // which file the word is in
00066   long offset;        // what the offset into the file is
00067   int ctf;            // collection term freq
00068   int df;             // doc freq
00069 };
00070 
00071 struct ltstr
00072 {
00073   bool operator()(char* s1, char* s2) const{
00074     return strcmp(s1, s2) < 0;
00075   }
00076 };
00077 
00078 #endif

Generated at Fri Jul 26 18:22:26 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000