SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
features
StringFileFeatures.h
浏览该文件的文档.
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
机器学习工具包 - 项目文档