-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencoder.h
48 lines (42 loc) · 979 Bytes
/
encoder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// CRF++ -- Yet Another CRF toolkit
//
// $Id: encoder.h 1588 2007-02-12 09:03:39Z taku $;
//
// Copyright(C) 2005-2007 Taku Kudo <[email protected]>
//
#ifndef CRFPP_ENCODER_H_
#define CRFPP_ENCODER_H_
#include "common.h"
#ifdef USE_MPI
#include "mpi_comm.h"
#endif // USE_MPI
namespace CRFPP {
class Encoder {
public:
enum { CRF_L2, CRF_L1, MIRA };
bool learn(const char *, const char *,
const char *,
bool, size_t, size_t,
double, double,
unsigned short,
unsigned short, int
#ifdef USE_MPI
, const std::vector<std::string> &
#endif // USE_MPI
);
bool convert(const char *text_file,
const char *binary_file);
const char* what() { return what_.str(); }
#ifdef USE_MPI
void setMpiComm(MpiComm *comm) { comm_ = comm; }
#endif // USE_MPI
private:
whatlog what_;
#ifdef USE_MPI
uint8_t data_part_;
MpiComm *comm_;
#endif // USE_MPI
};
}
#endif