Tanl Linguistic Pipeline |
00001 /* 00002 ** Tanl 00003 ** SST/SstEventStream.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2005 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_SST_SstEventStream_H 00025 #define Tanl_SST_SstEventStream_H 00026 00027 #include "SstFeatureExtractor.h" 00028 00029 namespace Tanl { 00030 namespace SST { 00031 00035 class SstEventStream : public Classifier::EventStream 00036 { 00037 public: 00038 SstEventStream(Resources& resources); 00039 00041 void analyze(Sentence* sent, int zone = 3) { 00042 sentence = sent; 00043 position = 0; 00044 featureExtractor.analyze(sent, zone); 00045 } 00046 00047 bool hasNext(); 00048 00049 Classifier::Event* next(); 00050 00052 void reset() { featureExtractor.reset(); } 00053 00055 void predicted(char const* sstag, int position = -1); 00056 00057 private: 00058 SstFeatureExtractor featureExtractor; 00059 Sentence* sentence; 00060 int position; 00061 00062 }; 00063 00064 } // namespace SST 00065 } // namespace Tanl 00066 00067 #endif // Tanl_SST_SstEventStream_H