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

IdentifinderParser.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2003 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.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 #include "Parser.hpp"
00013 #include "TextHandler.hpp"
00014 #include "LinkedPropertyList.hpp"
00015 
00016 #ifndef _IDENTIPARSER_HPP
00017 #define _IDENTIPARSER_HPP
00018 
00036 // Source code in IdentifinderParser.l
00037 
00038 
00039 #define BEGIN_PREFIX "B_"
00040 #define END_PREFIX "E_"
00041 // for simplicity, make both prefixes the same length
00042 #define PREFIX_LEN 2
00043 
00044 class IdentifinderParser : public Parser {
00045 
00046 public:
00047   static const string identifier;
00048 
00049   IdentifinderParser();
00050 
00052   void parseFile(const string &filename);
00053   
00054   void parseBuffer(char * buf, int len);
00055  
00056   long fileTell() const;
00057 
00058 private:
00060   void doParse();
00061 
00063   int state;
00064 
00066   int poscount;
00067 
00069   Property wordpos;
00070   Property tag;   // entity tag
00071   Property btag;  // the begin tag
00072   Property etag;  // the end tag
00073 
00074   
00076   LinkedPropertyList proplist;
00077 };
00078 
00079 #endif

Generated on Wed Nov 3 12:58:57 2004 for Lemur Toolkit by doxygen1.2.18