Tanl Linguistic Pipeline |
00001 /* 00002 ** Tanl 00003 ** tag/NER/PyPipe.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2006 Giuseppe Attardi (attardi@di.unipi.it). 00006 ** ---------------------------------------------------------------------- 00007 ** 00008 ** This file is part of Tanl. 00009 ** 00010 ** Tanl is free software; you can redistribute it and/or modify it 00011 ** under the terms of the GNU General Public License, version 3, 00012 ** as published by the Free Software Foundation. 00013 ** 00014 ** Tanl is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 ** GNU General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU General Public License 00020 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 ** ---------------------------------------------------------------------- 00022 */ 00023 00024 #ifndef Tanl_NER_PyPipe_H 00025 #define Tanl_NER_PyPipe_H 00026 00027 #include "NER.h" 00028 #include <Python.h> 00029 00030 namespace Tanl { 00031 namespace NER { 00032 00036 struct NerPyPipe : public Enumerator<vector<Token*>*> 00037 { 00038 public: 00040 NerPyPipe(NER& ner, PyObject* pit); 00041 00042 bool MoveNext(); 00043 00044 vector<Token*>* Current(); 00045 00046 ~NerPyPipe(); 00047 00051 void Dispose(); 00052 00053 private: 00054 NER& ner; 00055 NerEventStream eventStream; 00056 PyObject* pit; 00057 PyObject* next; 00058 }; 00059 00060 } // namespace NER 00061 } // namespace Tanl 00062 00063 #endif // Tanl_NER_PyPipe_H