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 #ifndef _INVFPTERM_HPP 00013 #define _INVFPTERM_HPP 00014 00015 #include "TermInfoList.hpp" 00016 #include "InvFPTypes.hpp" 00017 00019 00022 class InvFPTerm: public TermInfo { 00023 public: 00024 friend class InvTermList; 00025 friend class InvFPTermList; 00026 00027 InvFPTerm() { freq=1;}; 00028 ~InvFPTerm() {}; 00029 00030 const char* spelling() { return word; }; 00031 void spelling(TERM_T term) { word = term; }; 00032 int strLength() { return strlen; }; 00033 void strLength(int len) { strlen = len; }; 00034 int count() {return freq; }; 00035 TERMID_T id() { return tid; }; 00036 LOC_T position() { return loc; }; 00037 vector<LOC_T>* positions() { return loclist; }; 00038 void position(LOC_T pos) { loc = pos; }; 00039 00040 protected: 00041 00042 TERMID_T tid; 00043 int strlen; 00044 TERM_T word; 00045 int freq; // number of times this term occurs in this documen 00046 LOC_T loc; // where this term (currently) occurs in the document 00047 vector<LOC_T>* loclist; // list of all places term occurs in the document 00048 }; 00049 00050 #endif