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

Tag.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2003-2004 University of Massachusetts.  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.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 #include <stdlib.h>
00013 #include <string.h>
00014 
00015 #ifndef _TAG_HPP
00016 #define _TAG_HPP
00017 
00018 #define MAX_TAG_LENGTH 1024
00019 
00020 class Tag {
00021 public:
00022   Tag() {
00023     next = NULL;
00024     prev = NULL;
00025     begin = -1;
00026     end = -1;
00027   }
00028 
00029   Tag(char *n, int b) {
00030     next = NULL;
00031     prev = NULL;
00032     strncpy(name, n, MAX_TAG_LENGTH);
00033     begin = b;
00034     end = -1;
00035   }
00036 
00037   ~Tag() { }  
00038   
00039   void set_next(Tag *t) { next = t; t->set_prev(this);}
00040   void set_prev(Tag *t) { prev = t; }
00041   void set_end(int e) { end = e; }
00042   Tag * get_next() { return next; }
00043   Tag * get_prev() { return prev; }
00044   char * get_name() { return name; }
00045   int get_begin() { return begin; }
00046   int get_end() { return end; }
00047 private:
00048   char name[MAX_TAG_LENGTH];
00049   Tag *next;
00050   Tag *prev;
00051   int begin;
00052   int end;
00053 };
00054 
00055 #endif

Generated on Wed Nov 3 12:59:04 2004 for Lemur Toolkit by doxygen1.2.18