From d74183622e90977246037761f7e4f481fa468de3 Mon Sep 17 00:00:00 2001 From: Wanxiang Che Date: Tue, 30 Jul 2013 14:00:55 +0800 Subject: [PATCH 1/2] ltp_server: don't support NER and SRL --- src/__xml4nlp/Xml4nlp.cpp | 2 +- src/server/ltp_server.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/__xml4nlp/Xml4nlp.cpp b/src/__xml4nlp/Xml4nlp.cpp index 7778314fe..277c230d5 100644 --- a/src/__xml4nlp/Xml4nlp.cpp +++ b/src/__xml4nlp/Xml4nlp.cpp @@ -101,7 +101,7 @@ int XML4NLP::CreateDOMFromString(const string& str) { string strTmp = str; replace_char_by_char(strTmp, '\r', '\n'); - std::cout << strTmp << std::endl; + // std::cout << strTmp << std::endl; istringstream in(strTmp); // How to use istringstream? string line; int i = 0; diff --git a/src/server/ltp_server.cpp b/src/server/ltp_server.cpp index 7accb1a41..455ec899b 100644 --- a/src/server/ltp_server.cpp +++ b/src/server/ltp_server.cpp @@ -114,14 +114,10 @@ static int Service(struct mg_connection *conn) ltp.wordseg(); } else if(str_type == "pos"){ ltp.postag(); - } else if(str_type == "ner"){ - ltp.ner(); } else if(str_type == "dp"){ ltp.parser(); - } else if(str_type == "srl"){ - ltp.srl(); } else { - ltp.srl(); + ltp.parser(); } string strResult; From fa9ea10cc7fd16a1b644d6493b71ee4504d982cf Mon Sep 17 00:00:00 2001 From: Wanxiang Che Date: Wed, 31 Jul 2013 23:12:30 +0800 Subject: [PATCH 2/2] ltp_server: resupport NER and SRL --- src/server/ltp_server.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/ltp_server.cpp b/src/server/ltp_server.cpp index 455ec899b..7accb1a41 100644 --- a/src/server/ltp_server.cpp +++ b/src/server/ltp_server.cpp @@ -114,10 +114,14 @@ static int Service(struct mg_connection *conn) ltp.wordseg(); } else if(str_type == "pos"){ ltp.postag(); + } else if(str_type == "ner"){ + ltp.ner(); } else if(str_type == "dp"){ ltp.parser(); + } else if(str_type == "srl"){ + ltp.srl(); } else { - ltp.parser(); + ltp.srl(); } string strResult;