00001
00002
00003
00004
00005
00006
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