SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
features
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/features/StringFeatures.h
>
15
#include <
shogun/features/Alphabet.h
>
16
#include <
shogun/io/MemoryMappedFile.h
>
17
#include <
shogun/mathematics/Math.h
>
18
#include <
shogun/io/SGIO.h
>
19
20
namespace
shogun
21
{
22
class
CAlphabet;
23
template
<
class
T>
class
CMemoryMappedFile;
24
34
template
<
class
ST>
class
CStringFileFeatures
:
public
CStringFeatures
<ST>
35
{
36
public
:
37
41
CStringFileFeatures
();
42
48
CStringFileFeatures
(
const
char
* fname,
EAlphabet
alpha);
49
53
virtual
~CStringFileFeatures
();
54
59
virtual
const
char
*
get_name
()
const
{
return
"StringFileFeatures"
; }
60
61
protected
:
76
ST*
get_line
(uint64_t& len, uint64_t& offs, int32_t& line_nr, uint64_t file_length);
77
79
virtual
void
cleanup
();
80
82
virtual
void
cleanup_feature_vector
(int32_t num);
83
88
void
fetch_meta_info_from_file
(int32_t granularity=1048576);
89
90
protected
:
92
CMemoryMappedFile<ST>
*
file
;
93
};
94
}
95
#endif // _CSTRINGFILEFEATURES__H__
SHOGUN
Machine Learning Toolbox - Documentation