-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (60 loc) · 1.52 KB
/
main.cpp
File metadata and controls
64 lines (60 loc) · 1.52 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* main.cpp -- main test program
* Author: Hins
* Create date: 07/27/2010
* Last modified date: 04/22/2014
*/
#include "./include/Hidden_Markov_Model.h"
using namespace std;
namespace HMM
{
using namespace std;
int test(int argc, char *argv[])
{
#ifdef TEST
printf("Begin generate object...\n");
#endif
HMM* instance = new HMM();
#ifdef TEST
printf("Generate object over...\n");
#endif
CommandType On = static_cast<CommandType>(ParseCommand(argc,argv));
switch(On)
{
case CTHelp:
instance->PrintHelp();
break;
case CTTrain:
#ifdef TEST
printf("train data over\n");
#endif
break;
case CTSplit:
{
#ifdef TEST
printf("split start\n");
#endif
if(instance->SplitWord(argv[2]))
return ERROR;
#ifdef TEST
printf("split sentence over\n");
#endif
break;
}
case CTEstimate:
if(instance->SplitWord(argv[2]))
return ERROR;
printf("%f\n",instance->GetBestResult());
break;
default:
instance->PrintHelp();
break;
}
delete instance;
return 0;
}
}
int main(int argc, char *argv[])
{
return HMM::test(argc,argv);
}