Skip to content

Commit

Permalink
Merge pull request HIT-SCIR#247 from HIT-SCIR/patch-1
Browse files Browse the repository at this point in the history
use xml as default response format  in ltp_server
  • Loading branch information
carfly authored Aug 15, 2017
2 parents 9c023e3 + 6eba7b5 commit d786785
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/ltp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,12 @@ static int Service(struct mg_connection *conn) {
TRACE_LOG("Analysis is done.");

std::string strResult;
if (str_format == "xml") {
if (str_format == "xml") { //xml
xml4nlp.SaveDOM(strResult);
} else { //json
} else if (str_format == "json") { //json
strResult = xml2jsonstr(xml4nlp, str_type);
} else { // if str_format not set, or is invalid, use xml
xml4nlp.SaveDOM(strResult);
}


Expand Down

0 comments on commit d786785

Please sign in to comment.