File based string features.
StringFeatures that are file based. Underneath memory mapped files are used. Derived from CStringFeatures thus transparently enabling all of the StringFeature functionality.
Supported file format contains one string per line, lines of variable length are supported and must be separated by '
'.
在文件StringFileFeatures.h第34行定义。
公有成员 | |
CStringFileFeatures () | |
CStringFileFeatures (const char *fname, EAlphabet alpha) | |
virtual | ~CStringFileFeatures () |
保护成员 | |
ST * | get_line (uint64_t &len, uint64_t &offs, int32_t &line_nr, uint64_t file_length) |
virtual void | cleanup () |
virtual void | cleanup_feature_vector (int32_t num) |
void | fetch_meta_info_from_file (int32_t granularity=1048576) |
保护属性 | |
CMemoryMappedFile< ST > * | file |
default constructor
在文件StringFileFeatures.h第41行定义。
CStringFileFeatures | ( | const char * | fname, | |
EAlphabet | alpha | |||
) |
constructor
fname | filename of the file containing line based features | |
alpha | alphabet (type) to use for string features |
在文件StringFileFeatures.h第50行定义。
virtual ~CStringFileFeatures | ( | ) | [virtual] |
default destructor
在文件StringFileFeatures.h第60行定义。
virtual void cleanup | ( | ) | [protected, virtual] |
virtual void cleanup_feature_vector | ( | int32_t | num | ) | [protected, virtual] |
void fetch_meta_info_from_file | ( | int32_t | granularity = 1048576 |
) | [protected] |
obtain meta information from file
i.e., determine number of strings and their lengths
在文件StringFileFeatures.h第141行定义。
ST* get_line | ( | uint64_t & | len, | |
uint64_t & | offs, | |||
int32_t & | line_nr, | |||
uint64_t | file_length | |||
) | [protected] |
get next line from file
The returned line may be modfied in case the file was opened read/write. It is otherwise read-only.
len | length of line (returned via reference) | |
offs | offset to be passed for reading next line, should be 0 initially (returned via reference) | |
line_nr | used to indicate errors (returned as reference should be 0 initially) | |
file_length | total length of the file (for error checking) |
在文件StringFileFeatures.h第81行定义。
CMemoryMappedFile<ST>* file [protected] |
memory mapped file
在文件StringFileFeatures.h第190行定义。