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

TBhandler.h

Go to the documentation of this file.
00001 // TBhandler.h: TreeBank file handler class for TreeBank parser
00002 // Haejoong Lee, Xiaoyi Ma, Steven Bird
00003 // Copyright (C) 2001 Linguistic Data Consortium, U Penn.
00004 // Web: http://www.ldc.upenn.edu/; Email: ldc@ldc.upenn.edu
00005 // For license information, see the file `LICENSE' included
00006 // with the distribution.
00007 
00008 
00009 #ifndef _TBHANDLER_H_
00010 #define _TBHANDLER_H_
00011 
00012 #include <AGAPI.h>
00013 #include <stack>
00014 #include <map>
00015 #include <vector>
00016 #include "agtree.h"
00017 #include "TBEscapeHandler.h"
00018 
00020 class TBhandler
00021 {
00022 private:
00023   AGId agId;
00024   AnchorId prevAncrId;
00025   int prevIdx;
00026 
00027   TBEscapeHandler* escHandler;
00028 
00029   stack<AnchorId> AnchorStack;
00030   stack<string> TagStack;
00031   stack<string> AnnTypeStack;
00032   stack<AnnotationId> ChildStack;
00033   vector<AnnotationId> traces;
00034 
00035   bool eos_flag;    // indicate end-of-sentence
00036 
00037   
00038 public:
00039   TBhandler(const AGId &id, TBEscapeHandler& eh):
00040     agId(id), escHandler(&eh), eos_flag(true) {
00041     AnnotationId ann = tree_last_tree(id);
00042     if (! ann.empty()) prevAncrId = GetEndAnchor(ann);
00043   }
00044   
00048   void start_paren(const string &tag, const string &label);
00049 
00053   void end_paren();
00054 };
00055 
00056 #endif

Generated at Wed Jul 3 14:54:04 2002 for Annotation Graph API by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001