Skip to content

Commit

Permalink
Switch the constructor of LTP from config file to argument. Add progr…
Browse files Browse the repository at this point in the history
…am_options to ltp-server and console application.
  • Loading branch information
Oneplus committed May 17, 2015
1 parent 5dc348a commit ecf1542
Show file tree
Hide file tree
Showing 35 changed files with 1,197 additions and 8,433 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compiler:
before_install:
- sudo apt-get install gfortran
- sudo apt-get install cmake
- sudo apt-get install libopenblas
- sudo apt-get install libopenblas-dev

script:
- ./configure
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,3 @@ add_subdirectory (src)

# enable test
enable_testing()

# compile testing
#add_subdirectory (test)
9 changes: 5 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
set (utils_DIR ${SOURCE_DIR}/utils)
set (xml4nlp_DIR ${SOURCE_DIR}/__xml4nlp/)
set (xml4nlp_DIR ${SOURCE_DIR}/xml4nlp/)
set (segmentor_DIR ${SOURCE_DIR}/segmentor)
set (postagger_DIR ${SOURCE_DIR}/postagger)
set (parser_DIR ${SOURCE_DIR}/parser)
set (parser_n_DIR ${SOURCE_DIR}/parser_n)
set (splitsnt_DIR ${SOURCE_DIR}/splitsnt)
set (ner_DIR ${SOURCE_DIR}/ner/)
set (srl_DIR ${SOURCE_DIR}/srl/)
set (ltp_dll_DIR ${SOURCE_DIR}/__ltp_dll/)
set (ltp_DIR ${SOURCE_DIR}/ltp/)
set (server_DIR ${SOURCE_DIR}/server/)

add_subdirectory ("__xml4nlp")
add_subdirectory ("xml4nlp")
add_subdirectory ("splitsnt")
add_subdirectory ("segmentor")
add_subdirectory ("postagger")
add_subdirectory ("ner")
#add_subdirectory ("parser")
add_subdirectory ("parser.n")
add_subdirectory ("srl")
add_subdirectory ("__ltp_dll")
add_subdirectory ("ltp")
add_subdirectory ("console")

# mongoose server is not supported in windows
if (UNIX)
Expand Down
15 changes: 0 additions & 15 deletions src/__ltp_dll/CMakeLists.txt

This file was deleted.

151 changes: 0 additions & 151 deletions src/__ltp_dll/LTPResource.h

This file was deleted.

56 changes: 56 additions & 0 deletions src/console/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
include_directories (./
${SOURCE_DIR}/
${THIRDPARTY_DIR}/tinythreadpp
${THIRDPARTY_DIR}/maxent
${THIRDPARTY_DIR}/tinyxml)

set (ltp_test_SRC ltp_test.cpp ${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)

link_directories ( ${LIBRARY_OUTPUT_PATH} )
add_executable (ltp_test ${ltp_test_SRC})
target_link_libraries (ltp_test
maxent_static_lib
ltp
splitsnt_static_lib
segmentor_static_lib
postagger_static_lib
parser_static_lib
ner_static_lib
srl_static_lib
xml4nlp
boost_regex_static_lib
boost_program_options_static_lib)

add_executable (cws_cmdline cws_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
target_link_libraries (cws_cmdline segmentor_static_lib
boost_program_options_static_lib
boost_regex_static_lib)
set_target_properties(cws_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

add_executable (pos_cmdline pos_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
target_link_libraries (pos_cmdline postagger_static_lib
boost_program_options_static_lib)
set_target_properties(pos_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

add_executable (par_cmdline par_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
target_link_libraries (par_cmdline parser_static_lib
boost_program_options_static_lib)
set_target_properties(par_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

if (MSVC)
target_link_libraries (ltp_test
${THIRDPARTY_DIR}/openblas/lib/libopenblas.dll.a)
else()
target_link_libraries (ltp_test openblas pthread)
target_link_libraries (cws_cmdline pthread)
target_link_libraries (pos_cmdline pthread)
target_link_libraries (par_cmdline openblas pthread)
endif ()


Loading

0 comments on commit ecf1542

Please sign in to comment.