Skip to content

Commit

Permalink
revise include output, delete rulebase in SRL, splitsnt output shared…
Browse files Browse the repository at this point in the history
… library
  • Loading branch information
Oneplus committed May 13, 2014
1 parent 82e0c86 commit ed91d97
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 66 deletions.
2 changes: 1 addition & 1 deletion src/ner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ set_target_properties (otner
RUNTIME_OUTPUT_DIRECTORY ${TOOLS_DIR}/train/)
configure_file (
ner_dll.h
${INCLUDE_OUTPUT_PATH}/ner_dll.h)
${INCLUDE_OUTPUT_PATH}/ltp/ner_dll.h)
2 changes: 1 addition & 1 deletion src/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ set_target_properties (lgdpj

configure_file (
parser_dll.h
${INCLUDE_OUTPUT_PATH}/parser_dll.h)
${INCLUDE_OUTPUT_PATH}/ltp/parser_dll.h)
2 changes: 1 addition & 1 deletion src/postagger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ set_target_properties (otpos

configure_file (
postag_dll.h
${INCLUDE_OUTPUT_PATH}/postag_dll.h)
${INCLUDE_OUTPUT_PATH}/ltp/postag_dll.h)
2 changes: 1 addition & 1 deletion src/segmentor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ set_target_properties (otcws

configure_file (
segment_dll.h
${INCLUDE_OUTPUT_PATH}/segment_dll.h)
${INCLUDE_OUTPUT_PATH}/ltp/segment_dll.h)
4 changes: 3 additions & 1 deletion src/splitsnt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ set_target_properties (splitsnt_shared_lib PROPERTIES
VERSION ${splitsnt_VERSION}
OUTPUT_NAME splitsnt)


configure_file (
SplitSentence.h
${INCLUDE_OUTPUT_PATH}/ltp/SplitSentence.h)
28 changes: 23 additions & 5 deletions src/srl/SRL_DLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,30 @@ int DoSRL(
const vector< pair<int, string> > &parse,
vector< pair< int, vector< pair<string, pair< int, int > > > > > &tmp_vecSRLResult)
{
if(!ltp::srl::rulebase::dll_validity_check(words,POSs,NEs,parse)) {
return -1;
if (words.size() != POSs.size()
|| words.size() != parse.size()
|| words.size() != NEs.size()) {
return -1;
}

int len = words.size();
for (int i = 0; i < len; ++ i) {
if (words[i].empty() || POSs[i].empty() || NEs.empty()) {
return -1;
}
int father = parse[i].first;
if (father < -1 || father >= len || parse[i].second.empty()) {
return -1;
}
tmp_vecSRLResult.clear();
if (0 == g_depSRL.GetSRLResult(words, POSs, NEs, parse, tmp_vecSRLResult)) return -1;;
return tmp_vecSRLResult.size();
}

tmp_vecSRLResult.clear();

if (0 == g_depSRL.GetSRLResult(words, POSs, NEs, parse, tmp_vecSRLResult)) {
return -1;
}

return tmp_vecSRLResult.size();
}

int GetSRLResult_size(
Expand Down
1 change: 0 additions & 1 deletion src/srl/SRL_DLL.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <string>
#include <vector>
#include <stdlib.h>
#include "rulebase.h"

using namespace std;

Expand Down
55 changes: 0 additions & 55 deletions src/srl/rulebase.h

This file was deleted.

0 comments on commit ed91d97

Please sign in to comment.