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

TreeBank.h

Go to the documentation of this file.
00001 // TreeBank.h: TreeBank file loader class definition
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 _TREEBANK_H_
00010 #define _TREEBANK_H_
00011 
00012 #include <AGTypes.h>
00013 #include "agfio.h"
00014 #include "TBEscapeHandler.h"
00015 #include "TB_UPenn_WSJ_EscapeHandler.h"
00016 #include <fstream>
00017 
00019 class DllExport TreeBank : public agfio
00020 {
00021 
00022 private:
00023 
00024   TBEscapeHandler* escHandler;
00025   bool usingDefault;
00026 
00027   virtual bool
00028   is_id_required()
00029   { return true; }
00030 
00031   virtual AGIds
00032   load();
00033 
00034   void
00035   output_forest(ostream& OUT, const AGId& agId);
00036 
00037   void
00038   output_tree(ostream& OUT, const AGId& agId, const string& indent="");
00039 
00040 public:
00041 
00042   TreeBank() {
00043     escHandler = new TB_UPenn_WSJ_EscapeHandler;
00044     usingDefault = true;
00045   }
00046 
00047   TreeBank(TBEscapeHandler& eh): escHandler(&eh), usingDefault(false) {}
00048 
00049   ~TreeBank()
00050   { if (usingDefault) delete escHandler; }
00051 
00052 
00054 
00062   virtual void
00063   store(const string&       filename,
00064         const AGIds&        agIds = "",
00065         map<string,string>* options = NULL);
00066 
00067 };
00068 
00069 #endif

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