Skip to content

Commit

Permalink
change examples/*.cpp into test/
Browse files Browse the repository at this point in the history
  • Loading branch information
ruoshui1126 committed Oct 17, 2014
1 parent 9a3c91b commit 16aba41
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 98 deletions.
86 changes: 0 additions & 86 deletions examples/Makefile

This file was deleted.

28 changes: 25 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ include_directories (./
${SOURCE_DIR}/__util
${SOURCE_DIR}/__xml4nlp
${SOURCE_DIR}/_split_sentence
${SOURCE_DIR}/_ner
${SOURCE_DIR}/_srl
${SOURCE_DIR}/segmentor
${SOURCE_DIR}/postagger
${SOURCE_DIR}/ner
${SOURCE_DIR}/parser
${SOURCE_DIR}/srl
${SOURCE_DIR}/__ltp_dll
${THIRDPARTY_DIR}/tinythreadpp
${THIRDPARTY_DIR}/crfpp
Expand All @@ -19,6 +22,17 @@ set (multi_ltp_test_SRC multi_ltp_test.cpp
link_directories ( ${LIBRARY_OUTPUT_PATH} )

add_executable (ltp_test ${ltp_test_SRC})
add_executable (cws cws.cpp)
add_executable (cws_cmdline cws_cmdline.cpp)
add_executable (multi_cws_cmdline multi_cws_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
add_executable (pos pos.cpp)
add_executable (pos_cmdline pos.cpp)
add_executable (multi_pos_cmdline multi_pos_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
add_executable (ner ner.cpp)
add_executable (par par.cpp)
add_executable (srl srl.cpp)
#add_executable (ltp_test_xml ${ltp_test_xml_SRC})
#add_executable (ltp_test2 ${ltp_test2_SRC})

Expand All @@ -40,7 +54,15 @@ set (ltp_test_LIBS ${ltp_test_LIBS} pthread)
endif()

target_link_libraries (ltp_test ${ltp_test_LIBS})

target_link_libraries (cws segmentor_static_lib boost_regex_static_lib)
target_link_libraries (cws_cmdline segmentor_static_lib boost_regex_static_lib)
target_link_libraries (multi_cws_cmdline segmentor_static_lib boost_regex_static_lib pthread)
target_link_libraries (pos postagger_static_lib)
target_link_libraries (pos_cmdline postagger_static_lib)
target_link_libraries (multi_pos_cmdline postagger_static_lib pthread)
target_link_libraries (ner ner_static_lib)
target_link_libraries (par parser_static_lib)
target_link_libraries (srl srl_static_lib)
#
# multithreaded ltp test is not supported in Windows
#
Expand Down
2 changes: 1 addition & 1 deletion examples/cws.cpp → test/cws.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include <string>
#include "ltp/segment_dll.h"
#include "segment_dll.h"

int main(int argc, char * argv[]) {
if (argc < 2) {
Expand Down
2 changes: 1 addition & 1 deletion examples/cws_cmdline.cpp → test/cws_cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <string>
#include <sys/time.h>
#include <sys/types.h>
#include "ltp/segment_dll.h"
#include "segment_dll.h"

double get_time(void) {
struct timeval tv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "tinythread.h"
#include "fast_mutex.h"
#include "ltp/segment_dll.h"
#include "segment_dll.h"

using namespace std;
using namespace tthread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "tinythread.h"
#include "fast_mutex.h"
#include "ltp/postag_dll.h"
#include "postag_dll.h"

using namespace std;
using namespace tthread;
Expand Down
2 changes: 1 addition & 1 deletion examples/ner.cpp → test/ner.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>

#include "ltp/ner_dll.h"
#include "ner_dll.h"

int main(int argc, char * argv[]) {
if (argc < 2) {
Expand Down
2 changes: 1 addition & 1 deletion examples/par.cpp → test/par.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>

#include "ltp/parser_dll.h"
#include "parser_dll.h"

int main(int argc, char * argv[]) {
if (argc < 2) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/pos.cpp → test/pos.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>

#include "ltp/postag_dll.h"
#include "postag_dll.h"

int main(int argc, char * argv[]) {
if (argc < 1) {
Expand Down
2 changes: 1 addition & 1 deletion examples/pos_cmdline.cpp → test/pos_cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>
#include <sys/time.h>
#include <sys/types.h>
#include "ltp/postag_dll.h"
#include "postag_dll.h"

double get_time(void) {
struct timeval tv;
Expand Down
2 changes: 1 addition & 1 deletion examples/srl.cpp → test/srl.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>

#include "ltp/SRL_DLL.h"
#include "SRL_DLL.h"

int main(int argc, char * argv[]) {
if (argc < 2) {
Expand Down

0 comments on commit 16aba41

Please sign in to comment.