Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class 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 namespace indri
00020 {
00021   namespace parse
00022   {
00023     
00024     class Tag {
00025     public:
00026       Tag() {
00027         next = NULL;
00028         prev = NULL;
00029         begin = -1;
00030         end = -1;
00031       }
00032 
00033       Tag(char *n, int b) {
00034         next = NULL;
00035         prev = NULL;
00036         strncpy(name, n, MAX_TAG_LENGTH);
00037         begin = b;
00038         end = -1;
00039       }
00040 
00041       ~Tag() { }  
00042   
00043       void set_next(Tag *t) { next = t; t->set_prev(this);}
00044       void set_prev(Tag *t) { prev = t; }
00045       void set_end(int e) { end = e; }
00046       Tag * get_next() { return next; }
00047       Tag * get_prev() { return prev; }
00048       char * get_name() { return name; }
00049       int get_begin() { return begin; }
00050       int get_end() { return end; }
00051     private:
00052       char name[MAX_TAG_LENGTH];
00053       Tag *next;
00054       Tag *prev;
00055       int begin;
00056       int end;
00057     };
00058   }
00059 }
00060 
00061 #endif

Generated on Tue Jun 15 11:02:55 2010 for Lemur by doxygen 1.3.4