CharFeatures.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2008 Soeren Sonnenburg
00008  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _CHARFEATURES__H__
00012 #define _CHARFEATURES__H__
00013 
00014 #include "features/SimpleFeatures.h"
00015 #include "features/Alphabet.h"
00016 #include "lib/common.h"
00017 
00022 class CCharFeatures : public CSimpleFeatures<char>
00023 {
00024     public:
00030         CCharFeatures(EAlphabet alpha, int32_t size=0);
00031 
00037         CCharFeatures(CAlphabet* alpha, int32_t size=0);
00038 
00040         CCharFeatures(const CCharFeatures & orig);
00041 
00049         CCharFeatures(EAlphabet alphabet, char* feature_matrix, int32_t num_feat, int32_t num_vec);
00050 
00056         CCharFeatures(EAlphabet alphabet, char* fname);
00057 
00058         ~CCharFeatures();
00059 
00064         inline CAlphabet* get_alphabet()
00065         {
00066             return alphabet;
00067         }
00068 
00077         inline virtual void copy_feature_matrix(char* src, int32_t num_feat, int32_t num_vec)
00078         {
00079             CSimpleFeatures<char>::copy_feature_matrix(src, num_feat, num_vec);
00080         }
00081 
00087         virtual bool load(char* fname);
00088 
00094         virtual bool save(char* fname);
00095 
00096     protected:
00098         CAlphabet* alphabet;
00099 };
00100 #endif

SHOGUN Machine Learning Toolbox - Documentation