Tanl Linguistic Pipeline |
00001 /* 00002 ** IXE 00003 ** conf/Conversion.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2000 Ideare SpA. All rights reserved. 00006 ** Copyright (c) 2000 Giuseppe Attardi (attardi@di.unipi.it). 00007 ** ---------------------------------------------------------------------- 00008 ** 00009 ** This file is part of IXE. 00010 ** 00011 ** IXE is free software; you can redistribute it and/or modify it 00012 ** under the terms of the GNU General Public License, version 3, 00013 ** as published by the Free Software Foundation. 00014 ** 00015 ** IXE is distributed in the hope that it will be useful, 00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 ** GNU General Public License for more details. 00019 ** 00020 ** You should have received a copy of the GNU General Public License 00021 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 ** ---------------------------------------------------------------------- 00023 */ 00024 00025 #ifndef IXE_Conversion_H 00026 #define IXE_Conversion_H 00027 00028 // standard 00029 00030 // local 00031 #include "conf/conf_set.h" 00032 #include "Index/Converter.h" 00033 #include "conf/PatternMap.h" 00034 00035 namespace IXE { 00036 00043 class Conversion : public Var< PatternMap<Converter> > 00044 { 00045 public: 00046 Conversion(char const* name) : Var<value_type>(name) { } 00047 00048 Converter const* operator [](value_type::key_type key) const { 00049 value_type::const_iterator const kit = value.find(key); 00050 return kit != value.end() ? &kit->second : 0; 00051 } 00052 00053 void insert(char const* pattern, char const* directive); 00054 00055 private: 00056 virtual void parseValue(char const*& line); 00057 virtual void reset() { value.clear(); } 00058 }; 00059 00060 } // namespace IXE 00061 00062 #endif /* IXE_Conversion_H */