SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StringFileFeatures.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2009 Soeren Sonnenburg
8  * Copyright (C) 2009 Berlin Institute of Technology
9  */
10 
11 #ifndef _CSTRINGFILEFEATURES__H__
12 #define _CSTRINGFILEFEATURES__H__
13 
14 #include <shogun/lib/config.h>
15 
20 #include <shogun/io/SGIO.h>
21 
22 namespace shogun
23 {
24 class CAlphabet;
25 template <class T> class CMemoryMappedFile;
26 
36 template <class ST> class CStringFileFeatures : public CStringFeatures<ST>
37 {
38  public:
39 
44 
50  CStringFileFeatures(const char* fname, EAlphabet alpha);
51 
55  virtual ~CStringFileFeatures();
56 
61  virtual const char* get_name() const { return "StringFileFeatures"; }
62 
63  protected:
78  ST* get_line(uint64_t& len, uint64_t& offs, int32_t& line_nr, uint64_t file_length);
79 
81  virtual void cleanup();
82 
84  virtual void cleanup_feature_vector(int32_t num);
85 
90  void fetch_meta_info_from_file(int32_t granularity=1048576);
91 
92  protected:
95 };
96 }
97 #endif // _CSTRINGFILEFEATURES__H__
Template class StringFeatures implements a list of strings.
ST * get_line(uint64_t &len, uint64_t &offs, int32_t &line_nr, uint64_t file_length)
virtual const char * get_name() const
EAlphabet
Alphabet of charfeatures/observations.
Definition: Alphabet.h:23
CMemoryMappedFile< ST > * file
void fetch_meta_info_from_file(int32_t granularity=1048576)
File based string features.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void cleanup_feature_vector(int32_t num)

SHOGUN Machine Learning Toolbox - Documentation