forked from HIT-SCIR/ltp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,277 additions
and
1,176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,53 @@ | ||
#ifndef _LTP_OPTION_ | ||
#define _LTP_OPTION_ | ||
#ifndef __LTP_OPTION__ | ||
#define __LTP_OPTION__ | ||
|
||
#include <string> | ||
#include <iostream> | ||
using namespace std; | ||
/* | ||
isPER用于设置是否使用人名识别,若用则为1,否则为0。 | ||
isLOC用于设置是否使用地名识别, | ||
isPOS用于设置是否进行词性标注。 | ||
但要使用这些,需在配置文件中选择加载了相关的资源才行。 | ||
*/ | ||
|
||
struct tagIRLASOption{ | ||
int isPER; | ||
int isLOC; | ||
int isPOS; | ||
string confFile; | ||
string dataFolder; | ||
|
||
tagIRLASOption(int aIsPER=1, int aIsLOC=1, int aIsPOS=1) : isPER(aIsPER), isLOC(aIsLOC), isPOS(aIsPOS) {} | ||
struct tagIRLASOption &operator=(const struct tagIRLASOption &irlasOpt) | ||
{ | ||
isPER = irlasOpt.isPER; | ||
isLOC = irlasOpt.isLOC; | ||
isPOS = irlasOpt.isPOS; | ||
return *this; | ||
} | ||
void output() | ||
{ | ||
cout << "IRLAS options: " << endl | ||
<< "isPER: " << isPER << endl | ||
<< "isLOC: " << isLOC << endl | ||
<< "isPOS: " << isPOS << endl | ||
<< "confFile: \"" << confFile << "\"" << endl; | ||
} | ||
}; | ||
typedef struct tagIRLASOption IRLASOption; | ||
struct tagNEOption { | ||
int isEntity; | ||
int isTime; | ||
int isNum; | ||
|
||
struct tagNEOption{ | ||
int isEntity; | ||
int isTime; | ||
int isNum; | ||
tagNEOption(int aIsEntity=1, int aIsTime=1, int aIsNum=1) : | ||
isEntity(aIsEntity), | ||
isTime(aIsTime), | ||
isNum(aIsNum) {} | ||
|
||
tagNEOption(int aIsEntity=1, int aIsTime=1, int aIsNum=1) : isEntity(aIsEntity), isTime(aIsTime), isNum(aIsNum) {} | ||
struct tagNEOption& operator=(const struct tagNEOption &neOpt) | ||
{ | ||
isEntity = neOpt.isEntity; | ||
isTime = neOpt.isTime; | ||
isNum = neOpt.isNum; | ||
return *this; | ||
} | ||
struct tagNEOption& operator=(const struct tagNEOption & neOpt) { | ||
isEntity = neOpt.isEntity; | ||
isTime = neOpt.isTime; | ||
isNum = neOpt.isNum; | ||
return *this; | ||
} | ||
|
||
void output() | ||
{ | ||
cout << "NE options: " << endl | ||
<< "isEntity: " << isEntity << endl | ||
<< "isTime: " << isTime << endl | ||
<< "isNum: " << isNum << endl; | ||
} | ||
void output() { | ||
std::cout << "NE options" << std::endl | ||
<< "isEntity : " << isEntity << std::endl | ||
<< "isTime : " << isTime << std::endl | ||
<< "isNum : " << isNum << std::endl; | ||
} | ||
}; | ||
|
||
typedef struct tagNEOption NEOption; | ||
|
||
struct tagLTPOption | ||
{ | ||
string strLTPDataPath; | ||
IRLASOption irlasOpt; | ||
NEOption neOpt; | ||
void output() | ||
{ | ||
cout << "ltp options: " << endl | ||
<< "ltp data path: " << strLTPDataPath << endl; | ||
irlasOpt.output(); | ||
neOpt.output(); | ||
} | ||
struct tagLTPOption { | ||
std::string strLTPDataPath; | ||
std::string segmentor_model_path; | ||
std::string postagger_model_path; | ||
std::string parser_model_path; | ||
std::string ner_data_dir; | ||
std::string srl_data_dir; | ||
|
||
NEOption neOpt; | ||
|
||
void output() { | ||
std::cout << "ltp options : " << std::endl | ||
<< "ltp data path : " << strLTPDataPath << std::endl; | ||
neOpt.output(); | ||
} | ||
}; | ||
|
||
typedef tagLTPOption LTPOption; | ||
|
||
#endif | ||
#endif // end for __LTP_OPTION__ |
Oops, something went wrong.